The next version. Changes:
- Renamed variables related to the lines displayed in the window, to better reflect the content of that lines
- The rename button now shows up properly, when the line where the name is displayed is selected
stip_v24.zip [159.88 KiB]
Downloaded 23 times
Then I asked me the question, why some of the buttons occupy that much space, blowing up the minimum size of the window For the left button, I found the reason in the conditional order dropdown:
ButtonSize.png [103.42 KiB]
Not downloaded yet
(Probably) because the conditional order dropdown contains one extra-long string ("Remaining lifetime (years)"), the whole button becomes that big (minimum) size, even if some significant shorter text (e.g. "Arrival") is displayed. The technical reason is that the NWID_SELECTION (sample code below) of course takes the space of the biggest part, which here is the WID_VT_COND_VARIABLE_DROPDOWN.
The code below is from my patch, but similar code exists in the trunk order window as well.
At least unbeautiful effect of that GUI, although I don´t see a simple solution to that right now. In theory, moving the NWID_SELECTION outside would be an option (i.e. the selection doesn´t select single buttons, but whole button rows), but then some buttons would have to be present in multiple selection alternatives, and then I believe things start to become unbeautiful in a programming sense as well...
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_VT_SELECTION_TOP_1),
NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, WID_VT_NON_STOP_DROPDOWN), SetFill(1, 0),
SetDataTip(STR_ORDER_NON_STOP, STR_ORDER_TOOLTIP_NON_STOP), SetResize(1, 0),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_ARRIVAL_BUTTON), SetResize(1, 0), SetFill(1, 1),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_START_BUTTON), SetResize(1, 0), SetFill(1, 1),
NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 0), SetResize(1, 0), EndContainer(),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_VT_COND_VARIABLE_DROPDOWN), SetFill(1, 0),
SetDataTip(STR_NULL, STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP), SetResize(1, 0),