Changeset - r28043:6d63424774d6
[Not reviewed]
master
0 1 0
Peter Nelson - 13 months ago 2023-10-25 21:12:38
peter1138@openttd.org
Change: Use modalpopup spacing for engine preview window.
1 file changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/engine_gui.cpp
Show inline comments
 
@@ -48,30 +48,31 @@ StringID GetEngineCategoryName(EngineID 
 
		case VEH_SHIP:              return STR_ENGINE_PREVIEW_SHIP;
 
		case VEH_TRAIN:
 
			return GetRailTypeInfo(e->u.rail.railtype)->strings.new_loco;
 
	}
 
}
 

	
 
static const NWidgetPart _nested_engine_preview_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
 
		NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE),
 
		NWidget(WWT_EMPTY, INVALID_COLOUR, WID_EP_QUESTION), SetMinimalSize(300, 0), SetPadding(8, 8, 8, 8), SetFill(1, 0),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(85, 10, 85),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
 
		NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
 
			NWidget(WWT_EMPTY, INVALID_COLOUR, WID_EP_QUESTION), SetMinimalSize(300, 0), SetFill(1, 0),
 
			NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(85, WidgetDimensions::unscaled.hsep_wide, 85),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, WID_EP_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 8),
 
	EndContainer(),
 
};
 

	
 
struct EnginePreviewWindow : Window {
 
	int vehicle_space; // The space to show the vehicle image
 

	
 
	EnginePreviewWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc)
 
	{
 
		this->InitNested(window_number);
 

	
 
		/* There is no way to recover the window; so disallow closure via DEL; unless SHIFT+DEL */
 
		this->flags |= WF_STICKY;
0 comments (0 inline, 0 general)