diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-05 01:39:19 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-05 01:39:19 (GMT) |
commit | ac1bd7e0981222bf340ce7defb2bb8307d42a0a2 (patch) | |
tree | c8fb9c618184e7ac44f6138409cab3fab86b23e4 /src/WorkspaceNameTool.cc | |
parent | 60ba709c2f47cc2c7b877aef1b0f297b097853e5 (diff) | |
download | fluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.zip fluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.tar.bz2 |
update code to use ThemeProxy
Diffstat (limited to 'src/WorkspaceNameTool.cc')
-rw-r--r-- | src/WorkspaceNameTool.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc index b261423..79ac724 100644 --- a/src/WorkspaceNameTool.cc +++ b/src/WorkspaceNameTool.cc | |||
@@ -31,14 +31,14 @@ | |||
31 | #include <algorithm> | 31 | #include <algorithm> |
32 | 32 | ||
33 | WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent, | 33 | WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent, |
34 | ToolTheme &theme, BScreen &screen): | 34 | FbTk::ThemeProxy<ToolTheme> &theme, BScreen &screen): |
35 | ToolbarItem(ToolbarItem::FIXED), | 35 | ToolbarItem(ToolbarItem::FIXED), |
36 | m_button(parent, theme.font(), "a workspace name"), | 36 | m_button(parent, theme->font(), "a workspace name"), |
37 | m_theme(theme), | 37 | m_theme(theme), |
38 | m_screen(screen), | 38 | m_screen(screen), |
39 | m_pixmap(0) { | 39 | m_pixmap(0) { |
40 | // set text | 40 | // set text |
41 | m_button.setGC(m_theme.textGC()); | 41 | m_button.setGC(m_theme->textGC()); |
42 | m_button.setText(m_screen.currentWorkspace()->name()); | 42 | m_button.setText(m_screen.currentWorkspace()->name()); |
43 | 43 | ||
44 | // setup signals | 44 | // setup signals |
@@ -88,7 +88,7 @@ unsigned int WorkspaceNameTool::width() const { | |||
88 | BScreen::Workspaces::const_iterator it; | 88 | BScreen::Workspaces::const_iterator it; |
89 | for (it = workspaces.begin(); it != workspaces.end(); it++) { | 89 | for (it = workspaces.begin(); it != workspaces.end(); it++) { |
90 | const std::string &name = (*it)->name(); | 90 | const std::string &name = (*it)->name(); |
91 | max_size = std::max(m_theme.font().textWidth(name, name.size()), | 91 | max_size = std::max(m_theme->font().textWidth(name, name.size()), |
92 | max_size); | 92 | max_size); |
93 | } | 93 | } |
94 | // so align text dont cut the last character | 94 | // so align text dont cut the last character |
@@ -106,7 +106,7 @@ unsigned int WorkspaceNameTool::height() const { | |||
106 | BScreen::Workspaces::const_iterator it; | 106 | BScreen::Workspaces::const_iterator it; |
107 | for (it = workspaces.begin(); it != workspaces.end(); it++) { | 107 | for (it = workspaces.begin(); it != workspaces.end(); it++) { |
108 | const std::string &name = (*it)->name(); | 108 | const std::string &name = (*it)->name(); |
109 | max_size = std::max(m_theme.font().textWidth(name, name.size()), | 109 | max_size = std::max(m_theme->font().textWidth(name, name.size()), |
110 | max_size); | 110 | max_size); |
111 | } | 111 | } |
112 | // so align text dont cut the last character | 112 | // so align text dont cut the last character |
@@ -128,31 +128,31 @@ void WorkspaceNameTool::hide() { | |||
128 | } | 128 | } |
129 | 129 | ||
130 | void WorkspaceNameTool::updateSizing() { | 130 | void WorkspaceNameTool::updateSizing() { |
131 | m_button.setBorderWidth(m_theme.border().width()); | 131 | m_button.setBorderWidth(m_theme->border().width()); |
132 | } | 132 | } |
133 | 133 | ||
134 | void WorkspaceNameTool::reRender() { | 134 | void WorkspaceNameTool::reRender() { |
135 | if (m_theme.texture().usePixmap()) { | 135 | if (m_theme->texture().usePixmap()) { |
136 | if (m_pixmap) | 136 | if (m_pixmap) |
137 | m_screen.imageControl().removeImage(m_pixmap); | 137 | m_screen.imageControl().removeImage(m_pixmap); |
138 | m_pixmap = m_screen.imageControl().renderImage(width(), height(), | 138 | m_pixmap = m_screen.imageControl().renderImage(width(), height(), |
139 | m_theme.texture(), orientation()); | 139 | m_theme->texture(), orientation()); |
140 | m_button.setBackgroundPixmap(m_pixmap); | 140 | m_button.setBackgroundPixmap(m_pixmap); |
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | void WorkspaceNameTool::renderTheme(unsigned char alpha) { | 144 | void WorkspaceNameTool::renderTheme(unsigned char alpha) { |
145 | 145 | ||
146 | m_button.setJustify(m_theme.justify()); | 146 | m_button.setJustify(m_theme->justify()); |
147 | m_button.setBorderWidth(m_theme.border().width()); | 147 | m_button.setBorderWidth(m_theme->border().width()); |
148 | m_button.setBorderColor(m_theme.border().color()); | 148 | m_button.setBorderColor(m_theme->border().color()); |
149 | m_button.setAlpha(alpha); | 149 | m_button.setAlpha(alpha); |
150 | 150 | ||
151 | if (!m_theme.texture().usePixmap()) { | 151 | if (!m_theme->texture().usePixmap()) { |
152 | if (m_pixmap) | 152 | if (m_pixmap) |
153 | m_screen.imageControl().removeImage(m_pixmap); | 153 | m_screen.imageControl().removeImage(m_pixmap); |
154 | m_pixmap = 0; | 154 | m_pixmap = 0; |
155 | m_button.setBackgroundColor(m_theme.texture().color()); | 155 | m_button.setBackgroundColor(m_theme->texture().color()); |
156 | } else { | 156 | } else { |
157 | reRender(); | 157 | reRender(); |
158 | } | 158 | } |