Tracerestrict: Make condition type dropdown variable width
This commit is contained in:
@@ -1585,7 +1585,7 @@ public:
|
||||
if (type != TRIT_NULL) {
|
||||
uint32 hide_mask = 0;
|
||||
const TraceRestrictDropDownListSet *set = GetTypeDropDownListSet(type, &hide_mask);
|
||||
this->ShowDropDownListWithValue(set, type, false, widget, 0, hide_mask, 0);
|
||||
this->ShowDropDownListWithValue(set, type, false, widget, 0, hide_mask, UINT_MAX);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -510,7 +510,7 @@ void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button,
|
||||
* @param button Button widget number of the parent window \a w that wants the dropdown menu.
|
||||
* @param disabled_mask Bitmask for disabled items (items with their bit set are displayed, but not selectable in the dropdown list).
|
||||
* @param hidden_mask Bitmask for hidden items (items with their bit set are not copied to the dropdown list).
|
||||
* @param width Width of the dropdown menu. If \c 0, use the width of parent widget \a button.
|
||||
* @param width Width of the dropdown menu. If \c 0, use the width of parent widget \a button. If \c UINT_MAX, use the width of parent widget \a button, and use auto_width.
|
||||
*/
|
||||
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask, uint width, DropDownSyncFocus sync_parent_focus)
|
||||
{
|
||||
@@ -522,7 +522,13 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
|
||||
}
|
||||
}
|
||||
|
||||
if (!list.empty()) ShowDropDownList(w, std::move(list), selected, button, width, false, false, sync_parent_focus);
|
||||
bool auto_width = false;
|
||||
if (width == UINT_MAX) {
|
||||
width = 0;
|
||||
auto_width = true;
|
||||
}
|
||||
|
||||
if (!list.empty()) ShowDropDownList(w, std::move(list), selected, button, width, auto_width, false, sync_parent_focus);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user