Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/buttonmenu.cc2
-rw-r--r--src/client/notifications.cc8
-rw-r--r--src/ui/ui.cc17
-rw-r--r--src/ui/ui.h16
4 files changed, 30 insertions, 13 deletions
diff --git a/src/client/buttonmenu.cc b/src/client/buttonmenu.cc
index 18139d0..b5e8959 100644
--- a/src/client/buttonmenu.cc
+++ b/src/client/buttonmenu.cc
@@ -57,7 +57,7 @@ void ButtonMenu::resize()
w->set_size(ui::UI::elementsize);
w->set_location(x, y);
- y += ui::UI::elementsize.height() + ui::UI::elementmargin;
+ y += ui::UI::elementsize.height() + ui::UI::spacing;
}
// resize container widget
diff --git a/src/client/notifications.cc b/src/client/notifications.cc
index 90c5e3e..793303e 100644
--- a/src/client/notifications.cc
+++ b/src/client/notifications.cc
@@ -56,12 +56,12 @@ void Notifications::draw()
t = notify_timestamp.begin();
}
- const float margin = ui::UI::elementmargin;
+ const float spacing = ui::UI::spacing;
math::Vector2f s(size());
- s[0] -= margin * 2;
- s[1] -= margin * 2;
+ s[0] -= spacing * 2;
+ s[1] -= spacing * 2;
- notify_scrollpane->set_location(margin, margin);
+ notify_scrollpane->set_location(spacing, spacing);
notify_scrollpane->set_size(s.x(), s.y());
}
diff --git a/src/ui/ui.cc b/src/ui/ui.cc
index 97b633b..1502419 100644
--- a/src/ui/ui.cc
+++ b/src/ui/ui.cc
@@ -27,8 +27,10 @@ namespace ui
bool UI::ui_debug = false;
-float UI::elementmargin = 16;
-math::Vector2f UI::elementsize(256, 48);
+math::Vector2f UI::elementsize(256, 32);
+
+float UI::spacing = 16.0f;
+float UI::margin = 8.0f;
UI *global_ui = 0;
@@ -119,8 +121,8 @@ void UI::load_settings()
float w = elementsize.width();
float h = elementsize.height();
- float m = elementmargin;
-
+ float m = spacing;
+ float s = spacing;
while (ini.getline()) {
@@ -155,8 +157,11 @@ void UI::load_settings()
} else if (ini.got_key_float("elementheight", h)) {
elementsize.assign(w, h);
continue;
- } else if (ini.got_key_float("elementmargin", m)) {
- elementmargin = m;
+ } else if (ini.got_key_float("margin", m)) {
+ margin = m;
+ continue;
+ } else if (ini.got_key_float("spacing", s)) {
+ spacing = s;
continue;
} else {
ini.unknown_key();
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 5c44643..4b5d2da 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -92,9 +92,21 @@ public:
void set_pointer(const char *pointerbitmap = 0, const Palette::Color color = Palette::Highlight, const bool animated = false);
static bool ui_debug;
-
- static float elementmargin;
+
+ /**
+ * global size of a ui element, used by resize() functions
+ * */
static math::Vector2f elementsize;
+ /**
+ * global spacing between ui elements, used by resize() functions
+ * */
+ static float spacing;
+ /**
+ * global margin for frames and widgets, used by resize() functions
+ * see @Widget::resize();
+ * */
+ static float margin;
+
protected:
/* -- event handlers --------------------------------------- */