summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-11-07 13:56:13 +0000
committeralberth <alberth@openttd.org>2010-11-07 13:56:13 +0000
commit17695611cb4aa1e7cf9d3fbf60eecfe8283b3d27 (patch)
tree4499393fe0eeb09b00b776cad640ad7fe1006aec /src
parenta026ee9b4c3978e12530aa4169fa55d111602a08 (diff)
downloadopenttd-17695611cb4aa1e7cf9d3fbf60eecfe8283b3d27.tar.xz
(svn r21111) -Add: Remove the buttons below the newgrf details if the list is not editable.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_gui.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 572952b8e..3ee1a8a19 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -497,6 +497,7 @@ enum ShowNewGRFStateWidgets {
SNGRFS_CONTENT_DOWNLOAD,
SNGRFS_CONTENT_DOWNLOAD2,
SNGRFS_SHOW_REMOVE, ///< Select active list buttons (0 = normal, 1 = simple layout).
+ SNGRFS_SHOW_APPLY, ///< Select display of the buttons below the 'details'.
};
/**
@@ -549,6 +550,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
this->vscroll2 = this->GetScrollbar(SNGRFS_SCROLL2BAR);
this->GetWidget<NWidgetStacked>(SNGRFS_SHOW_REMOVE)->SetDisplayedPlane(this->editable ? 0 : 1);
+ this->GetWidget<NWidgetStacked>(SNGRFS_SHOW_APPLY)->SetDisplayedPlane(this->editable ? 0 : SZSP_HORIZONTAL);
this->FinishInitNested(desc);
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, EDITBOX_MAX_LENGTH);
@@ -1579,16 +1581,18 @@ static const NWidgetPart _nested_newgrf_infopanel_widgets[] = {
NWidget(WWT_EMPTY, COLOUR_MAUVE, SNGRFS_NEWGRF_INFO_TITLE), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_EMPTY, COLOUR_MAUVE, SNGRFS_NEWGRF_INFO), SetFill(1, 1), SetResize(1, 1), SetMinimalSize(150, 100),
EndContainer(),
- /* Right side, buttons. */
- NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(0, WD_RESIZEBOX_WIDTH, 0),
- NWidget(NWID_VERTICAL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_SET_PARAMETERS), SetFill(1, 0), SetResize(1, 0),
- SetDataTip(STR_NEWGRF_SETTINGS_SET_PARAMETERS, STR_NULL),
- NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_TOGGLE_PALETTE), SetFill(1, 0), SetResize(1, 0),
- SetDataTip(STR_NEWGRF_SETTINGS_TOGGLE_PALETTE, STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP),
+ NWidget(NWID_SELECTION, INVALID_COLOUR, SNGRFS_SHOW_APPLY),
+ /* Right side, buttons. */
+ NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(0, WD_RESIZEBOX_WIDTH, 0),
+ NWidget(NWID_VERTICAL),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_SET_PARAMETERS), SetFill(1, 0), SetResize(1, 0),
+ SetDataTip(STR_NEWGRF_SETTINGS_SET_PARAMETERS, STR_NULL),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_TOGGLE_PALETTE), SetFill(1, 0), SetResize(1, 0),
+ SetDataTip(STR_NEWGRF_SETTINGS_TOGGLE_PALETTE, STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP),
+ EndContainer(),
+ NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_APPLY_CHANGES), SetFill(1, 0), SetResize(1, 0),
+ SetDataTip(STR_NEWGRF_SETTINGS_APPLY_CHANGES, STR_NULL),
EndContainer(),
- NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_APPLY_CHANGES), SetFill(1, 0), SetResize(1, 0),
- SetDataTip(STR_NEWGRF_SETTINGS_APPLY_CHANGES, STR_NULL),
EndContainer(),
};