added focused/unfocused borders to styles
@@ -811,8 +811,8 @@ return true;
FbWinFrameTheme &theme = screen->winFrameTheme(); long title_h = theme.titleHeight() || theme.font().height() + 2*theme.bevelWidth() + 2; - title_h += theme.border().width(); - long handle_h = theme.handleWidth() + theme.border().width(); + title_h += theme.border(true).width(); + long handle_h = theme.handleWidth() + theme.border(true).width(); long extents[4]; // our frames currently don't protrude from left/right extents[0] = 0;
@@ -127,7 +127,7 @@ // reparent tab container
if (tabmode == EXTERNAL) { m_label.show(); m_tab_container.setBorderWidth(m_window.borderWidth()); - m_tab_container.setBorderColor(theme().border().color()); + m_tab_container.setBorderColor(theme().border(m_focused).color()); m_tab_container.setEventMask( ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask |@@ -497,6 +497,12 @@ m_tab_container.setAlpha(alpha);
m_window.setOpaque(255); } } + + if (m_decoration_mask & DECORM_BORDER && + (theme().border(true).width() != theme().border(false).width() || + theme().border(true).color().pixel() != + theme().border(false).color().pixel())) + setBorderWidth(theme().border(newvalue).width()); applyAll(); clearAll();@@ -1487,21 +1493,21 @@ if (m_use_handle)
bw_changes += static_cast<signed>(border_width - handle().borderWidth()); window().setBorderWidth(border_width); - window().setBorderColor(theme().border().color()); + window().setBorderColor(theme().border(m_focused).color()); setTabMode(NOTSET); titlebar().setBorderWidth(border_width); - titlebar().setBorderColor(theme().border().color()); + titlebar().setBorderColor(theme().border(m_focused).color()); handle().setBorderWidth(border_width); - handle().setBorderColor(theme().border().color()); + handle().setBorderColor(theme().border(m_focused).color()); gripLeft().setBorderWidth(border_width); - gripLeft().setBorderColor(theme().border().color()); + gripLeft().setBorderColor(theme().border(m_focused).color()); gripRight().setBorderWidth(border_width); - gripRight().setBorderColor(theme().border().color()); + gripRight().setBorderColor(theme().border(m_focused).color()); if (bw_changes != 0) resize(width(), height() + bw_changes);
@@ -51,7 +51,8 @@ m_shape_place(*this, "window.roundCorners", "Window.RoundCorners"),
m_title_height(*this, "window.title.height", "Window.Title.Height"), m_bevel_width(*this, "window.bevelWidth", "Window.BevelWidth"), m_handle_width(*this, "window.handleWidth", "Window.handleWidth"), - m_border(*this, "window", "Window"), // for window.border* + m_border_focus(*this, "window.focus", "Window.Focus"), + m_border_unfocus(*this, "window.unfocus", "Window.Unfocus"), m_button_pic_focus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_button_pic_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), m_focused_alpha(255),@@ -83,10 +84,13 @@
} 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"); + if (item.name() == "window.focus.borderWidth" || + item.name() == "window.unfocus.borderWidth") + return FbTk::ThemeManager::instance().loadItem(item, "window.borderWidth", "Window.BorderWidth") || + FbTk::ThemeManager::instance().loadItem(item, "borderWidth", "BorderWidth"); + else if (item.name() == "window.focus.borderColor" || item.name() == "window.unfocus.borderColor") + return FbTk::ThemeManager::instance().loadItem(item, "window.borderColor", "Window.BorderColor") || + FbTk::ThemeManager::instance().loadItem(item, "borderColor", "BorderColor"); else if (item.name() == "window.bevelWidth") return FbTk::ThemeManager::instance().loadItem(item, "bevelWidth", "bevelWidth"); else if (item.name() == "window.handleWidth")
@@ -84,7 +84,7 @@ inline Cursor topSideCursor() const { return m_cursor_top_side; }
inline Cursor bottomSideCursor() const { return m_cursor_bottom_side; } inline Shape::ShapePlace shapePlace() const { return *m_shape_place; } - inline const BorderTheme &border() const { return m_border; } + inline const BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); } unsigned int titleHeight() const { return *m_title_height; } unsigned int bevelWidth() const { return *m_bevel_width; }@@ -109,7 +109,7 @@ FbTk::ThemeItem<FbTk::Font> m_font;
FbTk::ThemeItem<Shape::ShapePlace> m_shape_place; FbTk::ThemeItem<int> m_title_height, m_bevel_width, m_handle_width; - BorderTheme m_border; + BorderTheme m_border_focus, m_border_unfocus; FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc;
@@ -306,7 +306,7 @@ // in the given direction
FluxboxWindow *foundwin = 0; int weight = 999999, exposure = 0; // extreme values - int borderW = m_screen.winFrameTheme().border().width(), + int borderW = win.frame().window().borderWidth(), top = win.y() + borderW, bottom = win.y() + win.height() + borderW, left = win.x() + borderW,
@@ -1943,8 +1943,8 @@ int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2;
int geom_w = winFrameTheme().font().textWidth(label, strlen(label)) + winFrameTheme().bevelWidth()*2; m_geom_window.resize(geom_w, geom_h); - m_geom_window.setBorderWidth(winFrameTheme().border().width()); - m_geom_window.setBorderColor(winFrameTheme().border().color()); + m_geom_window.setBorderWidth(winFrameTheme().border(true).width()); + m_geom_window.setBorderColor(winFrameTheme().border(true).color()); Pixmap tmp = geom_pixmap;@@ -1981,8 +1981,8 @@ int pos_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2;
int pos_w = winFrameTheme().font().textWidth("0:00000 x 0:00000", 17) + winFrameTheme().bevelWidth()*2; m_pos_window.resize(pos_w, pos_h); - m_pos_window.setBorderWidth(winFrameTheme().border().width()); - m_pos_window.setBorderColor(winFrameTheme().border().color()); + m_pos_window.setBorderWidth(winFrameTheme().border(true).width()); + m_pos_window.setBorderColor(winFrameTheme().border(true).color()); Pixmap tmp = pos_pixmap;
@@ -2981,7 +2981,7 @@ frame().clientArea().setBorderWidth(0); // client area bordered by other things
unsigned int border_width = 0; if (decorations.border) - border_width = frame().theme().border().width(); + border_width = frame().theme().border(m_focused).width(); bool client_move = false;@@ -4032,7 +4032,7 @@ */
void FluxboxWindow::reconfigTheme() { m_frame.setBorderWidth(decorations.border ? - frame().theme().border().width() : 0); + frame().theme().border(m_focused).width() : 0); if (decorations.handle && frame().theme().handleWidth() != 0) frame().showHandle(); else