Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/Makefile.am4
-rw-r--r--src/ui/inputbox.cc3
-rw-r--r--src/ui/palette.cc16
-rw-r--r--src/ui/widget.cc20
-rw-r--r--src/ui/widget.h14
5 files changed, 39 insertions, 18 deletions
diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am
index e230203..a89cdaa 100644
--- a/src/ui/Makefile.am
+++ b/src/ui/Makefile.am
@@ -8,10 +8,10 @@ noinst_LTLIBRARIES = libui.la
endif
noinst_HEADERS = bitmap.h button.h console.h container.h definitions.h font.h \
- inputbox.h label.h menu.h menuview.h paint.h palette.h scrollpane.h ui.h \
+ inputbox.h label.h menu.h menuview.h paint.h palette.h scrollpane.h toolbar.h ui.h \
widget.h window.h
libui_la_SOURCES = bitmap.cc button.cc console.cc console.h container.cc \
font.cc inputbox.cc label.cc menu.cc menuview.cc paint.cc palette.cc \
- scrollpane.cc ui.cc widget.cc window.cc
+ scrollpane.cc toolbar.cc ui.cc widget.cc window.cc
libui_la_LDFLAGS = -avoid-version -no-undefined
diff --git a/src/ui/inputbox.cc b/src/ui/inputbox.cc
index 39f8393..968038c 100644
--- a/src/ui/inputbox.cc
+++ b/src/ui/inputbox.cc
@@ -136,6 +136,9 @@ void InputBox::draw()
cursor += (char) 11;
paint::text(v, size(), font(), cursor);
}
+
+ // reset color
+ paint::color(palette()->foreground());
}
bool InputBox::on_keypress(const int key, const unsigned int modifier)
diff --git a/src/ui/palette.cc b/src/ui/palette.cc
index 2ee67f3..01fd99a 100644
--- a/src/ui/palette.cc
+++ b/src/ui/palette.cc
@@ -14,16 +14,16 @@ Palette::Palette() :
palette_foreground(1.0f, 1.0f),
palette_background(0.5f, 0.75f),
palette_border(0.0f, 0.8f, 0.0f, 0.5f),
- palette_text(0.75f),
+ palette_text(0.75f, 1.0f),
palette_highlight(1.0f, 1.0f, 0.5f),
- palette_pointer(0.0f, 0.75f, 0.0f),
- palette_active(0.0f, 1.0f, 0.0f),
+ palette_pointer(0.0f, 0.75f, 0.0f, 1.0f),
+ palette_active(0.0f, 1.0f, 0.0f, 1.0f),
palette_debug(0.50f, 0.75f),
- palette_mission(1.0f, 0.5f, 1.0f),
- palette_bold(1.0f),
- palette_fancy(0.0f, 1.0f, 0.0f),
- palette_warning(1.0f, 1.0f, 0.0f),
- palette_error(1.0f, 0.0f, 0.0f)
+ palette_mission(1.0f, 0.5f, 1.0f, 1.0f),
+ palette_bold(1.0f, 1.0f),
+ palette_fancy(0.0f, 1.0f, 0.0f, 1.0f),
+ palette_warning(1.0f, 1.0f, 0.0f, 1.0f),
+ palette_error(1.0f, 0.0f, 0.0f, 1.0f)
{
}
diff --git a/src/ui/widget.cc b/src/ui/widget.cc
index a7c667e..ef5d472 100644
--- a/src/ui/widget.cc
+++ b/src/ui/widget.cc
@@ -190,7 +190,19 @@ void Widget::set_font(const Font *font)
widget_font = font;
}
-void Widget::set_location(float const x, float const y)
+void Widget::set_geometry(const float x, const float y, const float w, const float h)
+{
+ widget_location.assign(x, y);
+ widget_size.assign(w, h);
+}
+
+void Widget::set_geometry(const math::Vector2f &location, const math::Vector2f &size)
+{
+ widget_location.assign(location);
+ widget_size.assign(size);
+}
+
+void Widget::set_location(const float x, const float y)
{
widget_location.assign(x, y);
}
@@ -200,7 +212,7 @@ void Widget::set_location(const math::Vector2f &location)
widget_location.assign(location);
}
-void Widget::set_size(float const w, float const h)
+void Widget::set_size(const float w, const float h)
{
widget_size.assign(w, h);
}
@@ -210,12 +222,12 @@ void Widget::set_size(const math::Vector2f &size)
widget_size.assign(size);
}
-void Widget::set_width(float const w)
+void Widget::set_width(const float w)
{
widget_size.x = w;
}
-void Widget::set_height(float const h)
+void Widget::set_height(const float h)
{
widget_size.y = h;
}
diff --git a/src/ui/widget.h b/src/ui/widget.h
index c002c73..acee725 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -138,24 +138,30 @@ public:
/// set input focus
void set_focus();
+
+ /// set the widget geometry
+ void set_geometry(const float x, const float y, const float w, const float h);
+
+ /// set the widget geometry
+ void set_geometry(const math::Vector2f &location, const math::Vector2f &size);
/// set location of the top-left corner, relative to the parent
- void set_location(float const x, float const y);
+ void set_location(const float x, const float y);
/// set location of the top-left corner, relative to the parent
void set_location(const math::Vector2f &location);
/// set the widgets width and height
- void set_size(float const w, float const h);
+ void set_size(const float w, const float h);
/// set the widgets width and height
void set_size(const math::Vector2f &size);
/// set the widgets width
- void set_width(float const w);
+ void set_width(const float w);
/// set the widgets height
- void set_height(float const h);
+ void set_height(const float h);
/// set the widgets palette
void set_palette(const Palette *palette);