From ff277dccf7c364015b5912c042281365041ec4c4 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 17 Apr 2014 15:46:01 -0300 Subject: [PATCH] Add Widget::onSetColor() --- src/ui/widget.cpp | 11 +++++++++++ src/ui/widget.h | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ui/widget.cpp b/src/ui/widget.cpp index 2b4b7e894..db8addbc2 100644 --- a/src/ui/widget.cpp +++ b/src/ui/widget.cpp @@ -167,6 +167,12 @@ void Widget::setFont(FONT* f) invalidate(); } +void Widget::setBgColor(ui::Color color) +{ + m_bgColor = color; + onSetBgColor(); +} + void Widget::setTheme(Theme* theme) { m_theme = theme; @@ -1384,6 +1390,11 @@ void Widget::onSetText() invalidate(); } +void Widget::onSetBgColor() +{ + invalidate(); +} + void Widget::offsetWidgets(int dx, int dy) { m_bounds.offset(dx, dy); diff --git a/src/ui/widget.h b/src/ui/widget.h index 55e1afdae..dafab4fe3 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -175,9 +175,7 @@ namespace ui { } // Sets the background color of the widget - void setBgColor(ui::Color bg_color) { - m_bgColor = bg_color; - } + void setBgColor(ui::Color color); Theme* getTheme() const { return m_theme; } void setTheme(Theme* theme); @@ -376,6 +374,7 @@ namespace ui { virtual void onSelect(); virtual void onDeselect(); virtual void onSetText(); + virtual void onSetBgColor(); private: base::string m_id; // Widget's id