From 2ccb04a1db2056d49c51ed930ae20fb500bd863e Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 19 Aug 2003 21:28:57 +0000 Subject: fixed some theme items --- src/Toolbar.cc | 29 ++++++++++++++++++++++------- src/Toolbar.hh | 12 ++++++++---- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/Toolbar.cc b/src/Toolbar.cc index cbe5148..8d748d4 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.111 2003/08/16 12:10:19 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.112 2003/08/19 21:28:57 fluxgen Exp $ #include "Toolbar.hh" @@ -38,6 +38,7 @@ #include "I18n.hh" #include "fluxbox.hh" #include "Screen.hh" +#include "ImageControl.hh" #include "EventManager.hh" #include "SimpleCommand.hh" @@ -201,6 +202,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi m_editing(false), m_hidden(false), frame(*this, scrn.screenNumber()), + m_window_pm(0), m_screen(scrn), m_toolbarmenu(menu), m_placementmenu(*scrn.menuTheme(), @@ -212,6 +214,9 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi this, true), m_theme(scrn.screenNumber()), + m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"), + m_workspace_theme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace"), + m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"), m_layeritem(frame.window, layer), m_strut(0), // lock rcmanager here @@ -229,9 +234,6 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"), m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"), m_shape(new Shape(frame.window, 0)), - m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"), - m_workspace_theme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace"), - m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"), m_resize_lock(false) { // we need to get notified when the theme is reloaded @@ -289,6 +291,9 @@ Toolbar::~Toolbar() { m_item_list.pop_back(); } + if (m_window_pm) + screen().imageControl().removeImage(m_window_pm); + clearStrut(); } @@ -384,9 +389,19 @@ void Toolbar::reconfigure() { frame.window.moveResize(frame.x, frame.y, frame.width, frame.height); } - - - + // render frame window + Pixmap tmp = m_window_pm; + if (theme().toolbar().type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { + m_window_pm = 0; + frame.window.setBackgroundColor(theme().toolbar().color()); + } else { + m_window_pm = screen().imageControl().renderImage(frame.window.width(), frame.window.height(), + theme().toolbar()); + frame.window.setBackgroundPixmap(m_window_pm); + } + if (tmp) + screen().imageControl().removeImage(tmp); + frame.window.setBorderColor(theme().border().color()); frame.window.setBorderWidth(theme().border().width()); frame.window.clear(); diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 4f75d89..3e9878c 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.hh,v 1.43 2003/08/15 13:25:03 fluxgen Exp $ +// $Id: Toolbar.hh,v 1.44 2003/08/19 21:28:57 fluxgen Exp $ #ifndef TOOLBAR_HH #define TOOLBAR_HH @@ -158,6 +158,8 @@ private: int x, y, x_hidden, y_hidden, grab_x, grab_y; unsigned int width, height, bevel_w; } frame; + // background pixmap + Pixmap m_window_pm; BScreen &m_screen; ///< screen connection @@ -166,14 +168,17 @@ private: FbTk::Menu m_placementmenu; LayerMenu m_layermenu; - + // themes ToolbarTheme m_theme; + ToolTheme m_clock_theme, m_workspace_theme; + IconbarTheme m_iconbar_theme; FbTk::XLayerItem m_layeritem; typedef std::list ItemList; ItemList m_item_list; Strut *m_strut; ///< created and destroyed by BScreen + // resources FbTk::Resource m_rc_auto_hide, m_rc_maximize_over; FbTk::Resource m_rc_width_percent; @@ -183,8 +188,7 @@ private: FbTk::Resource m_rc_height; std::auto_ptr m_shape; - ToolTheme m_clock_theme, m_workspace_theme; - IconbarTheme m_iconbar_theme; + bool m_resize_lock; ///< to lock rearrangeItems or not }; -- cgit v0.11.2