summaryrefslogtreecommitdiff
path: root/src/transparency_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-28 14:30:00 +0000
committerrubidium <rubidium@openttd.org>2009-11-28 14:30:00 +0000
commit6a367fda8a7f8e563310f7254d612dbb0010d919 (patch)
treeb4ce5effc9523320c78bde57d6ab55eefd2c2f16 /src/transparency_gui.cpp
parenta825349bf108aa99b6080c3bceb35e8b3c75cc97 (diff)
downloadopenttd-6a367fda8a7f8e563310f7254d612dbb0010d919.tar.xz
(svn r18320) -Codechange: make the terraform and transparency window not use absolute location but manually calculate based on toolbar size etc.
Diffstat (limited to 'src/transparency_gui.cpp')
-rw-r--r--src/transparency_gui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp
index 1195c4f95..6233817c8 100644
--- a/src/transparency_gui.cpp
+++ b/src/transparency_gui.cpp
@@ -117,6 +117,13 @@ public:
}
}
+ virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
+ {
+ Point pt = GetToolbarAlignedWindowPosition(sm_width);
+ pt.y += 2 * (sm_height - this->GetWidget<NWidgetBase>(TTW_WIDGET_BUTTONS)->current_y);
+ return pt;
+ }
+
virtual void OnInvalidateData(int data)
{
for (uint i = TTW_WIDGET_BEGIN; i < TTW_WIDGET_END; i++) {
@@ -149,7 +156,7 @@ static const NWidgetPart _nested_transparency_widgets[] = {
};
static const WindowDesc _transparency_desc(
- WDP_ALIGN_TBR, 94, 219, 49,
+ WDP_MANUAL, WDP_MANUAL, 219, 49,
WC_TRANSPARENCY_TOOLBAR, WC_NONE,
0,
_nested_transparency_widgets, lengthof(_nested_transparency_widgets)