summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-04-22 19:41:36 +0000
committerterkhen <terkhen@openttd.org>2010-04-22 19:41:36 +0000
commit92a6710cb70f13ef67f0a9e98e6a293b7d27b38f (patch)
treebb8f363195c4014127067ff762a670e4d9ddf41e /src/terraform_gui.cpp
parent26af87bbaaf818011e52fe55154e5cebce0ac686 (diff)
downloadopenttd-92a6710cb70f13ef67f0a9e98e6a293b7d27b38f.tar.xz
(svn r19696) -Fix [FS#3781]: Avoid showing building toolbars behind the main toolbar when the "Link landscape toolbar" setting is active.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 2340ddcd9..9f3355b79 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -333,19 +333,19 @@ Window *ShowTerraformToolbar(Window *link)
{
if (!Company::IsValidID(_local_company)) return NULL;
- Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
- if (link == NULL) return w;
-
- if (w == NULL) {
- w = FindWindowById(WC_SCEN_LAND_GEN, 0);
- if (w == NULL) return NULL;
- } else {
- w->top -= w->height;
- w->SetDirty();
+ Window *w;
+ if (link == NULL) {
+ w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
+ return w;
}
- /* Align the terraform toolbar under the main toolbar and put the linked
- * toolbar to left/right of it */
+ /* Delete the terraform toolbar to place it again. */
+ DeleteWindowById(WC_SCEN_LAND_GEN, 0, true);
+ w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
+ /* Align the terraform toolbar under the main toolbar. */
+ w->top -= w->height;
+ w->SetDirty();
+ /* Put the linked toolbar to the left / right of it. */
link->left = w->left + (_dynlang.text_dir == TD_RTL ? w->width : -link->width);
link->top = w->top;
link->SetDirty();