Removed NWST_STEP and min_step, we don't need two variables doing the same thing

This commit is contained in:
Sergii Pylypenko
2021-05-07 22:24:45 +03:00
parent 7defb52028
commit b5cf145f32
36 changed files with 107 additions and 126 deletions

View File

@@ -100,7 +100,7 @@ public:
this->town = Town::Get(window_number);
this->InitNested(window_number);
this->vscroll = this->GetScrollbar(WID_TA_SCROLLBAR);
this->actions_step = GetMinSizing(NWST_STEP, FONT_HEIGHT_NORMAL);
this->actions_step = GetMinSizing(NWST_BUTTON, FONT_HEIGHT_NORMAL);
this->vscroll->SetCapacity((this->GetWidget<NWidgetBase>(WID_TA_COMMAND_LIST)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / this->actions_step);
}
@@ -244,7 +244,7 @@ public:
}
case WID_TA_COMMAND_LIST:
resize->height = GetMinSizing(NWST_STEP, FONT_HEIGHT_NORMAL);
resize->height = GetMinSizing(NWST_BUTTON, FONT_HEIGHT_NORMAL);
size->height = WD_FRAMERECT_TOP + 3 * resize->height + WD_FRAMERECT_BOTTOM;
size->width = GetStringBoundingBox(STR_LOCAL_AUTHORITY_ACTIONS_TITLE).width;
for (uint i = 0; i < TACT_COUNT; i++ ) {
@@ -650,7 +650,7 @@ static const NWidgetPart _nested_town_directory_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(NWID_VERTICAL),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_TD_SORT_ORDER), SetSizingType(NWST_STEP), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
NWidget(WWT_TEXTBTN, COLOUR_BROWN, WID_TD_SORT_ORDER), SetSizingType(NWST_BUTTON), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER),
NWidget(WWT_DROPDOWN, COLOUR_BROWN, WID_TD_SORT_CRITERIA), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIA),
NWidget(WWT_EDITBOX, COLOUR_BROWN, WID_TD_FILTER), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP),
EndContainer(),
@@ -868,7 +868,7 @@ public:
Dimension icon_size = GetSpriteSize(SPR_TOWN_RATING_GOOD);
d.width += icon_size.width + 2;
d.height = std::max(d.height, icon_size.height);
d.height = GetMinSizing(NWST_STEP, d.height);
d.height = GetMinSizing(NWST_BUTTON, d.height);
resize->height = d.height;
d.height *= 5;
d.width += padding.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;