summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Toolbar.cc29
-rw-r--r--src/Toolbar.hh12
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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.cc,v 1.111 2003/08/16 12:10:19 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.112 2003/08/19 21:28:57 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -38,6 +38,7 @@
38#include "I18n.hh" 38#include "I18n.hh"
39#include "fluxbox.hh" 39#include "fluxbox.hh"
40#include "Screen.hh" 40#include "Screen.hh"
41#include "ImageControl.hh"
41 42
42#include "EventManager.hh" 43#include "EventManager.hh"
43#include "SimpleCommand.hh" 44#include "SimpleCommand.hh"
@@ -201,6 +202,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
201 m_editing(false), 202 m_editing(false),
202 m_hidden(false), 203 m_hidden(false),
203 frame(*this, scrn.screenNumber()), 204 frame(*this, scrn.screenNumber()),
205 m_window_pm(0),
204 m_screen(scrn), 206 m_screen(scrn),
205 m_toolbarmenu(menu), 207 m_toolbarmenu(menu),
206 m_placementmenu(*scrn.menuTheme(), 208 m_placementmenu(*scrn.menuTheme(),
@@ -212,6 +214,9 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
212 this, 214 this,
213 true), 215 true),
214 m_theme(scrn.screenNumber()), 216 m_theme(scrn.screenNumber()),
217 m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"),
218 m_workspace_theme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace"),
219 m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"),
215 m_layeritem(frame.window, layer), 220 m_layeritem(frame.window, layer),
216 m_strut(0), 221 m_strut(0),
217 // lock rcmanager here 222 // lock rcmanager here
@@ -229,9 +234,6 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
229 scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"), 234 scrn.name() + ".toolbar.placement", scrn.altName() + ".Toolbar.Placement"),
230 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"), 235 m_rc_height(scrn.resourceManager(), 0, scrn.name() + ".toolbar.height", scrn.altName() + ".Toolbar.Height"),
231 m_shape(new Shape(frame.window, 0)), 236 m_shape(new Shape(frame.window, 0)),
232 m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"),
233 m_workspace_theme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace"),
234 m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"),
235 m_resize_lock(false) { 237 m_resize_lock(false) {
236 238
237 // we need to get notified when the theme is reloaded 239 // we need to get notified when the theme is reloaded
@@ -289,6 +291,9 @@ Toolbar::~Toolbar() {
289 m_item_list.pop_back(); 291 m_item_list.pop_back();
290 } 292 }
291 293
294 if (m_window_pm)
295 screen().imageControl().removeImage(m_window_pm);
296
292 clearStrut(); 297 clearStrut();
293} 298}
294 299
@@ -384,9 +389,19 @@ void Toolbar::reconfigure() {
384 frame.window.moveResize(frame.x, frame.y, 389 frame.window.moveResize(frame.x, frame.y,
385 frame.width, frame.height); 390 frame.width, frame.height);
386 } 391 }
387 392 // render frame window
388 393 Pixmap tmp = m_window_pm;
389 394 if (theme().toolbar().type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
395 m_window_pm = 0;
396 frame.window.setBackgroundColor(theme().toolbar().color());
397 } else {
398 m_window_pm = screen().imageControl().renderImage(frame.window.width(), frame.window.height(),
399 theme().toolbar());
400 frame.window.setBackgroundPixmap(m_window_pm);
401 }
402 if (tmp)
403 screen().imageControl().removeImage(tmp);
404
390 frame.window.setBorderColor(theme().border().color()); 405 frame.window.setBorderColor(theme().border().color());
391 frame.window.setBorderWidth(theme().border().width()); 406 frame.window.setBorderWidth(theme().border().width());
392 frame.window.clear(); 407 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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.hh,v 1.43 2003/08/15 13:25:03 fluxgen Exp $ 25// $Id: Toolbar.hh,v 1.44 2003/08/19 21:28:57 fluxgen Exp $
26 26
27#ifndef TOOLBAR_HH 27#ifndef TOOLBAR_HH
28#define TOOLBAR_HH 28#define TOOLBAR_HH
@@ -158,6 +158,8 @@ private:
158 int x, y, x_hidden, y_hidden, grab_x, grab_y; 158 int x, y, x_hidden, y_hidden, grab_x, grab_y;
159 unsigned int width, height, bevel_w; 159 unsigned int width, height, bevel_w;
160 } frame; 160 } frame;
161 // background pixmap
162 Pixmap m_window_pm;
161 163
162 BScreen &m_screen; ///< screen connection 164 BScreen &m_screen; ///< screen connection
163 165
@@ -166,14 +168,17 @@ private:
166 FbTk::Menu m_placementmenu; 168 FbTk::Menu m_placementmenu;
167 LayerMenu<Toolbar> m_layermenu; 169 LayerMenu<Toolbar> m_layermenu;
168 170
169 171 // themes
170 ToolbarTheme m_theme; 172 ToolbarTheme m_theme;
173 ToolTheme m_clock_theme, m_workspace_theme;
174 IconbarTheme m_iconbar_theme;
171 175
172 FbTk::XLayerItem m_layeritem; 176 FbTk::XLayerItem m_layeritem;
173 typedef std::list<ToolbarItem *> ItemList; 177 typedef std::list<ToolbarItem *> ItemList;
174 ItemList m_item_list; 178 ItemList m_item_list;
175 179
176 Strut *m_strut; ///< created and destroyed by BScreen 180 Strut *m_strut; ///< created and destroyed by BScreen
181
177 // resources 182 // resources
178 FbTk::Resource<bool> m_rc_auto_hide, m_rc_maximize_over; 183 FbTk::Resource<bool> m_rc_auto_hide, m_rc_maximize_over;
179 FbTk::Resource<int> m_rc_width_percent; 184 FbTk::Resource<int> m_rc_width_percent;
@@ -183,8 +188,7 @@ private:
183 FbTk::Resource<int> m_rc_height; 188 FbTk::Resource<int> m_rc_height;
184 std::auto_ptr<Shape> m_shape; 189 std::auto_ptr<Shape> m_shape;
185 190
186 ToolTheme m_clock_theme, m_workspace_theme; 191
187 IconbarTheme m_iconbar_theme;
188 bool m_resize_lock; ///< to lock rearrangeItems or not 192 bool m_resize_lock; ///< to lock rearrangeItems or not
189}; 193};
190 194