summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-01-13 22:02:13 +0000
committeralberth <alberth@openttd.org>2011-01-13 22:02:13 +0000
commite8e535f58c74c47de40df3aad32f1857e438ec9f (patch)
treea40bc7d6e1c64d4c16472fa7334e59a6196a63bb
parentab91d8eb4f736ffe3b68f6763949e2a5c6ff7b15 (diff)
downloadopenttd-e8e535f58c74c47de40df3aad32f1857e438ec9f.tar.xz
(svn r21775) -Add: Allow vertical resizing of the newobject gui.
-rw-r--r--src/object_gui.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/object_gui.cpp b/src/object_gui.cpp
index cf30ae1fc..0e6020677 100644
--- a/src/object_gui.cpp
+++ b/src/object_gui.cpp
@@ -95,6 +95,7 @@ public:
}
size->width += padding.width;
this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
+ resize->height = this->line_height;
size->height = this->vscroll->GetCapacity() * this->line_height;
break;
}
@@ -286,6 +287,12 @@ public:
}
}
+ virtual void OnResize()
+ {
+ this->vscroll->SetCapacityFromWidget(this, BOW_CLASS_LIST);
+ this->GetWidget<NWidgetCore>(BOW_CLASS_LIST)->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
+ }
+
virtual void OnClick(Point pt, int widget, int click_count)
{
switch (GB(widget, 0, 16)) {