aboutsummaryrefslogtreecommitdiff
path: root/src/ToolFactory.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-12 14:56:20 (GMT)
committerrathnor <rathnor>2004-09-12 14:56:20 (GMT)
commit42c1fd3ae3dd058e146b7350c65b74386123c25c (patch)
treecc549c2c7b12c87f8c33198f5b30f00d9dd30bc6 /src/ToolFactory.cc
parentc39234195a46cece2bdb18dfdde6c91c7a190dc4 (diff)
downloadfluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.zip
fluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.tar.bz2
preliminary support for composite/compositing manager. Also general work
for consistency with transparency resources
Diffstat (limited to 'src/ToolFactory.cc')
-rw-r--r--src/ToolFactory.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index 6c1d4f8..160e1b3 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: ToolFactory.cc,v 1.8 2004/09/11 13:40:57 fluxgen Exp $ 22// $Id: ToolFactory.cc,v 1.9 2004/09/12 14:56:19 rathnor Exp $
23 23
24#include "ToolFactory.hh" 24#include "ToolFactory.hh"
25 25
@@ -83,25 +83,26 @@ ToolFactory::ToolFactory(BScreen &screen):m_screen(screen),
83} 83}
84 84
85ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &parent, Toolbar &tbar) { 85ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &parent, Toolbar &tbar) {
86 ToolbarItem * item;
86 87
87 unsigned int button_size = 24; 88 unsigned int button_size = 24;
88 if (tbar.theme().buttonSize() > 0) 89 if (tbar.theme().buttonSize() > 0)
89 button_size = tbar.theme().buttonSize(); 90 button_size = tbar.theme().buttonSize();
90 91
91 if (name == "workspacename") { 92 if (name == "workspacename") {
92 WorkspaceNameTool *item = new WorkspaceNameTool(parent, 93 WorkspaceNameTool *witem = new WorkspaceNameTool(parent,
93 *m_workspace_theme, screen()); 94 *m_workspace_theme, screen());
94 using namespace FbTk; 95 using namespace FbTk;
95 RefCount<Command> showmenu(new ShowMenuAboveToolbar(tbar)); 96 RefCount<Command> showmenu(new ShowMenuAboveToolbar(tbar));
96 item->button().setOnClick(showmenu); 97 witem->button().setOnClick(showmenu);
97 return item; 98 item = witem;
98 } else if (name == "iconbar") { 99 } else if (name == "iconbar") {
99 return new IconbarTool(parent, m_iconbar_theme, 100 item = new IconbarTool(parent, m_iconbar_theme,
100 screen(), tbar.menu()); 101 screen(), tbar.menu());
101 } else if (name == "systemtray") { 102 } else if (name == "systemtray") {
102 return new SystemTray(parent); 103 item = new SystemTray(parent);
103 } else if (name == "clock") { 104 } else if (name == "clock") {
104 return new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); 105 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu());
105 } else if (name == "nextworkspace" || 106 } else if (name == "nextworkspace" ||
106 name == "prevworkspace") { 107 name == "prevworkspace") {
107 108
@@ -118,7 +119,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
118 0, 0, 119 0, 0,
119 button_size, button_size); 120 button_size, button_size);
120 win->setOnClick(cmd); 121 win->setOnClick(cmd);
121 return new ButtonTool(win, ToolbarItem::SQUARE, 122 item = new ButtonTool(win, ToolbarItem::SQUARE,
122 dynamic_cast<ButtonTheme &>(*m_button_theme), 123 dynamic_cast<ButtonTheme &>(*m_button_theme),
123 screen().imageControl()); 124 screen().imageControl());
124 125
@@ -137,13 +138,16 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
137 0, 0, 138 0, 0,
138 button_size, button_size); 139 button_size, button_size);
139 win->setOnClick(cmd); 140 win->setOnClick(cmd);
140 return new ButtonTool(win, ToolbarItem::SQUARE, 141 item = new ButtonTool(win, ToolbarItem::SQUARE,
141 dynamic_cast<ButtonTheme &>(*m_button_theme), 142 dynamic_cast<ButtonTheme &>(*m_button_theme),
142 screen().imageControl()); 143 screen().imageControl());
143 144
144 } 145 }
145 146
146 return 0; 147 if (item)
148 item->renderTheme(tbar.alpha());
149
150 return item;
147} 151}
148 152
149void ToolFactory::updateThemes() { 153void ToolFactory::updateThemes() {