From 3ad7d05d87b0c773437662b55adc939e8fcec8a7 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 25 Aug 2003 16:37:50 +0000 Subject: moved border color and width to frame theme --- src/FbWinFrameTheme.cc | 14 ++++++++++++-- src/FbWinFrameTheme.hh | 19 +++++++++++-------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc index 728cd2d..37c7898 100644 --- a/src/FbWinFrameTheme.cc +++ b/src/FbWinFrameTheme.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrameTheme.cc,v 1.9 2003/08/22 15:02:33 fluxgen Exp $ +// $Id: FbWinFrameTheme.cc,v 1.10 2003/08/25 16:37:50 fluxgen Exp $ #include "FbWinFrameTheme.hh" #include "App.hh" @@ -60,7 +60,8 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num): m_shape_place(*this, "window.roundCorners", "Window.RoundCorners"), m_alpha(*this, "window.alpha", "Window.Alpha"), - m_title_height(*this, "window.title.height", "Window.Title.Height") { + m_title_height(*this, "window.title.height", "Window.Title.Height"), + m_border(*this, "window", "Window") { // for window.border* *m_title_height = 0; // set defaults @@ -90,6 +91,15 @@ FbWinFrameTheme::~FbWinFrameTheme() { XFreeGC(disp, m_button_pic_unfocus_gc); } +bool FbWinFrameTheme::fallback(FbTk::ThemeItem_base &item) { + if (item.name() == "window.borderWidth") + return FbTk::ThemeManager::instance().loadItem(item, "borderWidth", "BorderWidth"); + else if (item.name() == "window.borderColor") + return FbTk::ThemeManager::instance().loadItem(item, "borderColor", "BorderColor"); + + return false; +} + void FbWinFrameTheme::reconfigTheme() { if (*m_alpha > 255) *m_alpha = 255; diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh index 08d19a9..cecf781 100644 --- a/src/FbWinFrameTheme.hh +++ b/src/FbWinFrameTheme.hh @@ -19,17 +19,18 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrameTheme.hh,v 1.8 2003/08/22 15:02:33 fluxgen Exp $ +// $Id: FbWinFrameTheme.hh,v 1.9 2003/08/25 16:37:50 fluxgen Exp $ #ifndef FBWINFRAMETHEME_HH #define FBWINFRAMETHEME_HH -#include "Font.hh" -#include "Texture.hh" -#include "Text.hh" -#include "Color.hh" +#include "FbTk/Font.hh" +#include "FbTk/Texture.hh" +#include "FbTk/Text.hh" +#include "FbTk/Color.hh" #include "FbTk/Theme.hh" -#include "Subject.hh" +#include "FbTk/Subject.hh" +#include "BorderTheme.hh" #include "Shape.hh" class FbWinFrameTheme: public FbTk::Theme { @@ -78,6 +79,7 @@ public: GC buttonPicFocusGC() const { return m_button_pic_focus_gc; } GC buttonPicUnfocusGC() const { return m_button_pic_unfocus_gc; } + bool fallback(FbTk::ThemeItem_base &item); void reconfigTheme(); void addListener(FbTk::Observer &obs) { m_theme_change.attach(&obs); } @@ -88,7 +90,7 @@ public: inline Cursor lowerRightAngleCursor() const { return m_cursor_lower_right_angle; } inline Shape::ShapePlace shapePlace() const { return *m_shape_place; } - + inline const BorderTheme &border() const { return m_border; } unsigned char alpha() const { return *m_alpha; } unsigned int titleHeight() const { return *m_title_height; } @@ -108,7 +110,8 @@ private: FbTk::ThemeItem m_shape_place; FbTk::ThemeItem m_alpha, m_title_height; - + BorderTheme m_border; + GC m_label_text_focus_gc, m_label_text_unfocus_gc; GC m_button_pic_focus_gc, m_button_pic_unfocus_gc; -- cgit v0.11.2