Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-01-08 14:40:40 +0000
committerStijn Buys <ingar@osirion.org>2012-01-08 14:40:40 +0000
commitadbed6d8e57cd15020ad483ead1fed3dfb69b815 (patch)
tree9fbfa993bcb293b1809151a0bb07675f8080b40c /src/ui
parenta8a92cee21e1e5fba3d312bf3043b4e1b96d5576 (diff)
Made the slider resize itself when shown.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/slider.cc6
-rw-r--r--src/ui/slider.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/src/ui/slider.cc b/src/ui/slider.cc
index 24e59f5..559df70 100644
--- a/src/ui/slider.cc
+++ b/src/ui/slider.cc
@@ -178,6 +178,12 @@ void Slider::on_mouseover(const math::Vector2f &cursor)
slider_dragging = false;
}
+void Slider::show()
+{
+ Widget::show();
+ resize();
+}
+
void Slider::resize()
{
// note: slider expects width > height
diff --git a/src/ui/slider.h b/src/ui/slider.h
index bafd848..70a57ac 100644
--- a/src/ui/slider.h
+++ b/src/ui/slider.h
@@ -73,8 +73,12 @@ public:
* @see maximum
*/
void set_range(const float minimum, const float maximum);
-
+
+ /// show the widget
+ virtual void show();
+
protected:
+
/// resize event handler
virtual void resize();