aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-08-29 00:44:41 (GMT)
committerfluxgen <fluxgen>2003-08-29 00:44:41 (GMT)
commit76c1bd4b62ed62ffae1f3f6da8dde9716440d87c (patch)
tree121b78bbf53389c6b38ad0aa2e2feecd978b29a4
parent028897367989bc2d7402e4d9920fdf8889034162 (diff)
downloadfluxbox_paul-76c1bd4b62ed62ffae1f3f6da8dde9716440d87c.zip
fluxbox_paul-76c1bd4b62ed62ffae1f3f6da8dde9716440d87c.tar.bz2
fixed workspace theme for old themes
-rw-r--r--src/Toolbar.cc23
-rw-r--r--src/Toolbar.hh8
2 files changed, 12 insertions, 19 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 1f03cc5..5d508e4 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -22,18 +22,20 @@
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.119 2003/08/28 15:04:47 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.120 2003/08/29 00:44:41 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
29// themes 29// themes
30#include "ToolbarTheme.hh" 30#include "ToolbarTheme.hh"
31#include "WorkspaceNameTheme.hh"
31 32
32// tools 33// tools
33#include "IconbarTool.hh" 34#include "IconbarTool.hh"
34#include "WorkspaceNameTool.hh" 35#include "WorkspaceNameTool.hh"
35#include "ClockTool.hh" 36#include "ClockTool.hh"
36#include "SystemTray.hh" 37#include "SystemTray.hh"
38
37 39
38#include "I18n.hh" 40#include "I18n.hh"
39#include "fluxbox.hh" 41#include "fluxbox.hh"
@@ -216,7 +218,6 @@ Toolbar::Frame::~Frame() {
216} 218}
217 219
218Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t width): 220Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t width):
219 m_editing(false),
220 m_hidden(false), 221 m_hidden(false),
221 frame(*this, scrn.screenNumber()), 222 frame(*this, scrn.screenNumber()),
222 m_window_pm(0), 223 m_window_pm(0),
@@ -232,7 +233,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
232 true), 233 true),
233 m_theme(scrn.screenNumber()), 234 m_theme(scrn.screenNumber()),
234 m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"), 235 m_clock_theme(scrn.screenNumber(), "toolbar.clock", "Toolbar.Clock"),
235 m_workspace_theme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace"), 236 m_workspace_theme(new WorkspaceNameTheme(scrn.screenNumber(), "toolbar.workspace", "Toolbar.Workspace")),
236 m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"), 237 m_iconbar_theme(scrn.screenNumber(), "toolbar.iconbar", "Toolbar.Iconbar"),
237 m_layeritem(frame.window, layer), 238 m_layeritem(frame.window, layer),
238 m_strut(0), 239 m_strut(0),
@@ -279,7 +280,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
279 // set antialias on themes 280 // set antialias on themes
280 m_clock_theme.setAntialias(screen().antialias()); 281 m_clock_theme.setAntialias(screen().antialias());
281 m_iconbar_theme.setAntialias(screen().antialias()); 282 m_iconbar_theme.setAntialias(screen().antialias());
282 m_workspace_theme.setAntialias(screen().antialias()); 283 m_workspace_theme->setAntialias(screen().antialias());
283 284
284 // setup hide timer 285 // setup hide timer
285 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); 286 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay());
@@ -378,7 +379,7 @@ void Toolbar::lower() {
378void Toolbar::reconfigure() { 379void Toolbar::reconfigure() {
379 m_clock_theme.setAntialias(screen().antialias()); 380 m_clock_theme.setAntialias(screen().antialias());
380 m_iconbar_theme.setAntialias(screen().antialias()); 381 m_iconbar_theme.setAntialias(screen().antialias());
381 m_workspace_theme.setAntialias(screen().antialias()); 382 m_workspace_theme->setAntialias(screen().antialias());
382 383
383 384
384 385
@@ -425,7 +426,7 @@ void Toolbar::reconfigure() {
425 StringList::const_iterator item_it_end = m_tools.end(); 426 StringList::const_iterator item_it_end = m_tools.end();
426 for (; item_it != item_it_end; ++item_it) { 427 for (; item_it != item_it_end; ++item_it) {
427 if (*item_it == "workspacename") { 428 if (*item_it == "workspacename") {
428 WorkspaceNameTool *item = new WorkspaceNameTool(frame.window, m_workspace_theme, screen()); 429 WorkspaceNameTool *item = new WorkspaceNameTool(frame.window, *m_workspace_theme, screen());
429 using namespace FbTk; 430 using namespace FbTk;
430 RefCount<Command> showmenu(new ShowMenuAboveToolbar(*this)); 431 RefCount<Command> showmenu(new ShowMenuAboveToolbar(*this));
431 item->button().setOnClick(showmenu); 432 item->button().setOnClick(showmenu);
@@ -621,8 +622,8 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
621 if (max_height < m_clock_theme.font().height()) 622 if (max_height < m_clock_theme.font().height())
622 max_height = m_clock_theme.font().height(); 623 max_height = m_clock_theme.font().height();
623 624
624 if (max_height < m_workspace_theme.font().height()) 625 if (max_height < m_workspace_theme->font().height())
625 max_height = m_workspace_theme.font().height(); 626 max_height = m_workspace_theme->font().height();
626 627
627 if (max_height < m_iconbar_theme.focusedText().font().height()) 628 if (max_height < m_iconbar_theme.focusedText().font().height())
628 max_height = m_iconbar_theme.focusedText().font().height(); 629 max_height = m_iconbar_theme.focusedText().font().height();
@@ -761,12 +762,6 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
761} 762}
762 763
763void Toolbar::toggleHidden() { 764void Toolbar::toggleHidden() {
764 if (isEditing()) { // don't hide if we're editing workspace label
765 m_hide_timer.fireOnce(false);
766 m_hide_timer.start(); // restart timer and try next timeout
767 return;
768 }
769
770 m_hide_timer.fireOnce(true); 765 m_hide_timer.fireOnce(true);
771 766
772 // toggle hidden 767 // toggle hidden
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index 981fb1a..719dac3 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.45 2003/08/28 13:58:17 fluxgen Exp $ 25// $Id: Toolbar.hh,v 1.46 2003/08/29 00:44:41 fluxgen Exp $
26 26
27#ifndef TOOLBAR_HH 27#ifndef TOOLBAR_HH
28#define TOOLBAR_HH 28#define TOOLBAR_HH
@@ -114,8 +114,6 @@ public:
114 inline FbTk::Menu &layermenu() { return m_layermenu; } 114 inline FbTk::Menu &layermenu() { return m_layermenu; }
115 inline const FbTk::Menu &layermenu() const { return m_layermenu; } 115 inline const FbTk::Menu &layermenu() const { return m_layermenu; }
116 116
117 /// are we in workspacename editing?
118 inline bool isEditing() const { return m_editing; }
119 /// are we hidden? 117 /// are we hidden?
120 inline bool isHidden() const { return m_hidden; } 118 inline bool isHidden() const { return m_hidden; }
121 /// do we auto hide the toolbar? 119 /// do we auto hide the toolbar?
@@ -146,7 +144,6 @@ private:
146 void clearStrut(); 144 void clearStrut();
147 void updateStrut(); 145 void updateStrut();
148 146
149 bool m_editing; ///< edit workspace label mode
150 bool m_hidden; ///< hidden state 147 bool m_hidden; ///< hidden state
151 148
152 /// Toolbar frame 149 /// Toolbar frame
@@ -171,7 +168,8 @@ private:
171 168
172 // themes 169 // themes
173 ToolbarTheme m_theme; 170 ToolbarTheme m_theme;
174 ToolTheme m_clock_theme, m_workspace_theme; 171 ToolTheme m_clock_theme;
172 std::auto_ptr<ToolTheme> m_workspace_theme;
175 IconbarTheme m_iconbar_theme; 173 IconbarTheme m_iconbar_theme;
176 174
177 FbTk::XLayerItem m_layeritem; 175 FbTk::XLayerItem m_layeritem;