mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Rename _circle_size to _setting_circle_size.
parent
35cd05b27d
commit
c9c9973884
|
@ -94,7 +94,7 @@ uint BaseSettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int
|
|||
if (cur_row >= max_row) return cur_row;
|
||||
|
||||
bool rtl = _current_text_dir == TD_RTL;
|
||||
int offset = (rtl ? -(int)_circle_size.width : (int)_circle_size.width) / 2;
|
||||
int offset = (rtl ? -(int)_setting_circle_size.width : (int)_setting_circle_size.width) / 2;
|
||||
int level_width = rtl ? -WidgetDimensions::scaled.hsep_indent : WidgetDimensions::scaled.hsep_indent;
|
||||
|
||||
int x = rtl ? right : left;
|
||||
|
@ -621,8 +621,8 @@ uint SettingsPage::Draw(GameSettings *settings_ptr, int left, int right, int y,
|
|||
void SettingsPage::DrawSetting(GameSettings *, int left, int right, int y, bool) const
|
||||
{
|
||||
bool rtl = _current_text_dir == TD_RTL;
|
||||
DrawSprite((this->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, rtl ? right - _circle_size.width : left, y + (SETTING_HEIGHT - _circle_size.height) / 2);
|
||||
DrawString(rtl ? left : left + _circle_size.width + WidgetDimensions::scaled.hsep_normal, rtl ? right - _circle_size.width - WidgetDimensions::scaled.hsep_normal : right, y + (SETTING_HEIGHT - GetCharacterHeight(FS_NORMAL)) / 2, this->title, TC_ORANGE);
|
||||
DrawSprite((this->folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, rtl ? right - _setting_circle_size.width : left, y + (SETTING_HEIGHT - _setting_circle_size.height) / 2);
|
||||
DrawString(rtl ? left : left + _setting_circle_size.width + WidgetDimensions::scaled.hsep_normal, rtl ? right - _setting_circle_size.width - WidgetDimensions::scaled.hsep_normal : right, y + (SETTING_HEIGHT - GetCharacterHeight(FS_NORMAL)) / 2, this->title, TC_ORANGE);
|
||||
}
|
||||
|
||||
/** Construct settings tree */
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "settings_internal.h"
|
||||
#include "stringfilter_type.h"
|
||||
|
||||
extern Dimension _circle_size;
|
||||
extern Dimension _setting_circle_size;
|
||||
extern int SETTING_HEIGHT;
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,7 +83,7 @@ static const uint32_t _autosave_dropdown_to_minutes[] = {
|
|||
120,
|
||||
};
|
||||
|
||||
Dimension _circle_size; ///< Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window.
|
||||
Dimension _setting_circle_size; ///< Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window.
|
||||
|
||||
/**
|
||||
* Get index of the current screen resolution.
|
||||
|
@ -1267,14 +1267,14 @@ struct GameSettingsWindow : Window {
|
|||
|
||||
void OnInit() override
|
||||
{
|
||||
_circle_size = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED));
|
||||
_setting_circle_size = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED));
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_OPTIONSPANEL:
|
||||
resize.height = SETTING_HEIGHT = std::max({(int)_circle_size.height, SETTING_BUTTON_HEIGHT, GetCharacterHeight(FS_NORMAL)}) + WidgetDimensions::scaled.vsep_normal;
|
||||
resize.height = SETTING_HEIGHT = std::max({(int)_setting_circle_size.height, SETTING_BUTTON_HEIGHT, GetCharacterHeight(FS_NORMAL)}) + WidgetDimensions::scaled.vsep_normal;
|
||||
resize.width = 1;
|
||||
|
||||
size.height = 5 * resize.height + WidgetDimensions::scaled.framerect.Vertical();
|
||||
|
|
Loading…
Reference in New Issue