mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(svn r19696) -Fix [FS#3781]: Avoid showing building toolbars behind the main toolbar when the "Link landscape toolbar" setting is active.
This commit is contained in:
parent
26af87bbaa
commit
92a6710cb7
@ -333,19 +333,19 @@ Window *ShowTerraformToolbar(Window *link)
|
|||||||
{
|
{
|
||||||
if (!Company::IsValidID(_local_company)) return NULL;
|
if (!Company::IsValidID(_local_company)) return NULL;
|
||||||
|
|
||||||
Window *w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
Window *w;
|
||||||
if (link == NULL) return w;
|
if (link == NULL) {
|
||||||
|
w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
|
||||||
if (w == NULL) {
|
return w;
|
||||||
w = FindWindowById(WC_SCEN_LAND_GEN, 0);
|
|
||||||
if (w == NULL) return NULL;
|
|
||||||
} else {
|
|
||||||
w->top -= w->height;
|
|
||||||
w->SetDirty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Align the terraform toolbar under the main toolbar and put the linked
|
/* Delete the terraform toolbar to place it again. */
|
||||||
* toolbar to left/right of it */
|
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->left = w->left + (_dynlang.text_dir == TD_RTL ? w->width : -link->width);
|
||||||
link->top = w->top;
|
link->top = w->top;
|
||||||
link->SetDirty();
|
link->SetDirty();
|
||||||
|
Loading…
Reference in New Issue
Block a user