diff options
author | Stijn Buys <ingar@osirion.org> | 2016-07-20 00:40:01 +0200 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2016-07-20 00:40:01 +0200 |
commit | 0d3a65aad03d9ac726238b21ba8224e9558a8a08 (patch) | |
tree | 5a6d704902543025d4877b584a400d3db10ebdc2 /src/ui | |
parent | 1d99e86e3197ed7594d9ef8c1c350a6a60e7bce0 (diff) |
Renamed UI::elementmargin to IU::spacing, added UI::margin.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui.cc | 17 | ||||
-rw-r--r-- | src/ui/ui.h | 16 |
2 files changed, 25 insertions, 8 deletions
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 --------------------------------------- */ |