summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/ButtonTool.cc4
-rw-r--r--src/ClockTool.cc5
-rw-r--r--src/Container.cc15
-rw-r--r--src/GenericTool.cc4
-rw-r--r--src/IconbarTheme.cc11
-rw-r--r--src/IconbarTheme.hh4
-rw-r--r--src/IconbarTool.cc5
-rw-r--r--src/ToolTheme.cc9
-rw-r--r--src/ToolTheme.hh6
-rw-r--r--src/Toolbar.cc7
-rw-r--r--src/WorkspaceNameTool.cc4
12 files changed, 60 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a4076f..d1c3d01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.8: 2Changes for 0.9.8:
3*04/01/14:
4 * Implement transparency for toolbar (Simon)
5 - can use toolbar.alpha, as well as toolbar.<tool>.alpha
6 ToolTheme.hh/cc IconbarTheme.hh/cc *Tool.cc Container.cc Toolbar.cc
3*04/01/11: 7*04/01/11:
4 * Fixed ImageControl cache problem (Henrik) 8 * Fixed ImageControl cache problem (Henrik)
5 ImageControl.hh/cc 9 ImageControl.hh/cc
diff --git a/src/ButtonTool.cc b/src/ButtonTool.cc
index 6a3dfa4..a3b4d7b 100644
--- a/src/ButtonTool.cc
+++ b/src/ButtonTool.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: ButtonTool.cc,v 1.2 2003/12/07 16:39:43 fluxgen Exp $ 22// $Id: ButtonTool.cc,v 1.3 2004/01/13 14:41:32 rathnor Exp $
23 23
24#include "ButtonTool.hh" 24#include "ButtonTool.hh"
25 25
@@ -54,6 +54,7 @@ void ButtonTool::renderTheme() {
54 btn.setGC(static_cast<const ButtonTheme &>(theme()).gc()); 54 btn.setGC(static_cast<const ButtonTheme &>(theme()).gc());
55 btn.setBorderColor(theme().border().color()); 55 btn.setBorderColor(theme().border().color());
56 btn.setBorderWidth(theme().border().width()); 56 btn.setBorderWidth(theme().border().width());
57 btn.setAlpha(theme().alpha());
57 58
58 Pixmap old_pm = m_cache_pm; 59 Pixmap old_pm = m_cache_pm;
59 if (!theme().texture().usePixmap()) { 60 if (!theme().texture().usePixmap()) {
@@ -81,5 +82,6 @@ void ButtonTool::renderTheme() {
81 m_image_ctrl.removeImage(old_pm); 82 m_image_ctrl.removeImage(old_pm);
82 83
83 btn.clear(); 84 btn.clear();
85 btn.updateTransparent();
84} 86}
85 87
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index 889c65e..a65a4ea 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ClockTool.cc,v 1.9 2003/12/19 18:26:48 fluxgen Exp $ 23// $Id: ClockTool.cc,v 1.10 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "ClockTool.hh" 25#include "ClockTool.hh"
26 26
@@ -240,6 +240,7 @@ void ClockTool::updateTime() {
240 } 240 }
241 241
242 m_button.clear(); 242 m_button.clear();
243 m_button.updateTransparent();
243} 244}
244 245
245void ClockTool::renderTheme() { 246void ClockTool::renderTheme() {
@@ -258,5 +259,7 @@ void ClockTool::renderTheme() {
258 m_button.setJustify(m_theme.justify()); 259 m_button.setJustify(m_theme.justify());
259 m_button.setBorderWidth(m_theme.border().width()); 260 m_button.setBorderWidth(m_theme.border().width());
260 m_button.setBorderColor(m_theme.border().color()); 261 m_button.setBorderColor(m_theme.border().color());
262 m_button.setAlpha(m_theme.alpha());
261 m_button.clear(); 263 m_button.clear();
264 m_button.updateTransparent();
262} 265}
diff --git a/src/Container.cc b/src/Container.cc
index e39c582..e41e4b5 100644
--- a/src/Container.cc
+++ b/src/Container.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Container.cc,v 1.10 2003/12/21 16:12:19 rathnor Exp $ 23// $Id: Container.cc,v 1.11 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "Container.hh" 25#include "Container.hh"
26 26
@@ -130,8 +130,10 @@ void Container::removeItem(int index) {
130void Container::removeAll() { 130void Container::removeAll() {
131 m_selected = 0; 131 m_selected = 0;
132 m_item_list.clear(); 132 m_item_list.clear();
133 if (!m_update_lock) 133 if (!m_update_lock) {
134 clear(); 134 clear();
135 updateTransparent();
136 }
135 137
136} 138}
137 139
@@ -158,8 +160,10 @@ void Container::setSelected(int pos) {
158 for (; pos != 0; --pos, ++it) 160 for (; pos != 0; --pos, ++it)
159 continue; 161 continue;
160 m_selected = *it; 162 m_selected = *it;
161 if (m_selected) 163 if (m_selected) {
162 m_selected->clear(); 164 m_selected->clear();
165 m_selected->updateTransparent();
166 }
163 } 167 }
164 168
165} 169}
@@ -173,8 +177,10 @@ void Container::setAlignment(Container::Alignment a) {
173} 177}
174 178
175void Container::exposeEvent(XExposeEvent &event) { 179void Container::exposeEvent(XExposeEvent &event) {
176 if (!m_update_lock) 180 if (!m_update_lock) {
177 clearArea(event.x, event.y, event.width, event.height); 181 clearArea(event.x, event.y, event.width, event.height);
182 updateTransparent(event.x, event.y, event.width, event.height);
183 }
178} 184}
179 185
180void Container::repositionItems() { 186void Container::repositionItems() {
@@ -212,6 +218,7 @@ void Container::repositionItems() {
212 max_width_per_client + extra, 218 max_width_per_client + extra,
213 height()); 219 height());
214 (*it)->clear(); 220 (*it)->clear();
221 (*it)->updateTransparent();
215 } 222 }
216 223
217} 224}
diff --git a/src/GenericTool.cc b/src/GenericTool.cc
index 0dcdf4c..05da41b 100644
--- a/src/GenericTool.cc
+++ b/src/GenericTool.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: GenericTool.cc,v 1.2 2003/10/26 20:11:27 fluxgen Exp $ 22// $Id: GenericTool.cc,v 1.3 2004/01/13 14:41:32 rathnor Exp $
23 23
24#include "GenericTool.hh" 24#include "GenericTool.hh"
25#include "FbTk/FbWindow.hh" 25#include "FbTk/FbWindow.hh"
@@ -78,7 +78,9 @@ unsigned int GenericTool::borderWidth() const {
78 78
79 79
80void GenericTool::renderTheme() { 80void GenericTool::renderTheme() {
81 m_window->setAlpha(theme().alpha());
81 m_window->clear(); 82 m_window->clear();
83 m_window->updateTransparent();
82} 84}
83 85
84void GenericTool::update(FbTk::Subject *subj) { 86void GenericTool::update(FbTk::Subject *subj) {
diff --git a/src/IconbarTheme.cc b/src/IconbarTheme.cc
index 3c73376..69e0a7b 100644
--- a/src/IconbarTheme.cc
+++ b/src/IconbarTheme.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTheme.cc,v 1.7 2003/08/29 00:48:41 fluxgen Exp $ 23// $Id: IconbarTheme.cc,v 1.8 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "IconbarTheme.hh" 25#include "IconbarTheme.hh"
26#include "FbTk/App.hh" 26#include "FbTk/App.hh"
@@ -37,7 +37,8 @@ IconbarTheme::IconbarTheme(int screen_num,
37 m_border(*this, name, altname), 37 m_border(*this, name, altname),
38 m_focused_text(*this, name + ".focused", altname + ".Focused"), 38 m_focused_text(*this, name + ".focused", altname + ".Focused"),
39 m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused"), 39 m_unfocused_text(*this, name + ".unfocused", altname + ".Unfocused"),
40 m_name(name) { 40 m_name(name),
41 m_alpha(*this, name+".alpha", altname+".Alpha") {
41 42
42 FbTk::ThemeManager::instance().loadTheme(*this); 43 FbTk::ThemeManager::instance().loadTheme(*this);
43 44
@@ -103,9 +104,11 @@ bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) {
103 104
104 return tm.loadItem(item, "window.label.focus.textColor", "Window.Label.Focus.TextColor"); 105 return tm.loadItem(item, "window.label.focus.textColor", "Window.Label.Focus.TextColor");
105 106
106 } else if (item.name() == m_name + ".unfocused.textColor") 107 } else if (item.name() == m_name + ".unfocused.textColor") {
107 return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); 108 return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor");
108 109 } else if (item.name() == m_name + ".alpha") {
110 return tm.loadItem(item, "toolbar.alpha", "Toolbar.Alpha");
111 }
109 112
110 return false; 113 return false;
111} 114}
diff --git a/src/IconbarTheme.hh b/src/IconbarTheme.hh
index 7545454..e0c76c6 100644
--- a/src/IconbarTheme.hh
+++ b/src/IconbarTheme.hh
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTheme.hh,v 1.5 2003/08/19 21:26:45 fluxgen Exp $ 23// $Id: IconbarTheme.hh,v 1.6 2004/01/13 14:41:32 rathnor Exp $
24 24
25#ifndef ICONBARTHEME_HH 25#ifndef ICONBARTHEME_HH
26#define ICONBARTHEME_HH 26#define ICONBARTHEME_HH
@@ -51,12 +51,14 @@ public:
51 const FbTk::Texture &focusedTexture() const { return *m_focused_texture; } 51 const FbTk::Texture &focusedTexture() const { return *m_focused_texture; }
52 const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; } 52 const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; }
53 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; } 53 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; }
54 inline unsigned char alpha() const { return *m_alpha; }
54 55
55private: 56private:
56 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture; 57 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture;
57 BorderTheme m_focused_border, m_unfocused_border, m_border; 58 BorderTheme m_focused_border, m_unfocused_border, m_border;
58 TextTheme m_focused_text, m_unfocused_text; 59 TextTheme m_focused_text, m_unfocused_text;
59 std::string m_name; 60 std::string m_name;
61 FbTk::ThemeItem<int> m_alpha;
60}; 62};
61 63
62#endif // ICONBARTHEME_HH 64#endif // ICONBARTHEME_HH
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index ff10018..79ed89b 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: IconbarTool.cc,v 1.28 2004/01/10 01:19:13 rathnor Exp $ 23// $Id: IconbarTool.cc,v 1.29 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "IconbarTool.hh" 25#include "IconbarTool.hh"
26 26
@@ -576,6 +576,7 @@ void IconbarTool::renderTheme() {
576 576
577 m_icon_container.setBorderWidth(m_theme.border().width()); 577 m_icon_container.setBorderWidth(m_theme.border().width());
578 m_icon_container.setBorderColor(m_theme.border().color()); 578 m_icon_container.setBorderColor(m_theme.border().color());
579 m_icon_container.setAlpha(m_theme.alpha());
579 580
580 // update buttons 581 // update buttons
581 IconList::iterator icon_it = m_icon_list.begin(); 582 IconList::iterator icon_it = m_icon_list.begin();
@@ -587,6 +588,7 @@ void IconbarTool::renderTheme() {
587void IconbarTool::renderButton(IconButton &button) { 588void IconbarTool::renderButton(IconButton &button) {
588 589
589 button.setPixmap(*m_rc_use_pixmap); 590 button.setPixmap(*m_rc_use_pixmap);
591 button.setAlpha(m_theme.alpha());
590 592
591 // if we're rendering a button, there must be a back button. 593 // if we're rendering a button, there must be a back button.
592 // The last button is always the regular width 594 // The last button is always the regular width
@@ -628,6 +630,7 @@ void IconbarTool::renderButton(IconButton &button) {
628 } 630 }
629 631
630 button.clear(); 632 button.clear();
633 button.updateTransparent();
631} 634}
632 635
633void IconbarTool::deleteIcons() { 636void IconbarTool::deleteIcons() {
diff --git a/src/ToolTheme.cc b/src/ToolTheme.cc
index 730c9a3..f7dd118 100644
--- a/src/ToolTheme.cc
+++ b/src/ToolTheme.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolTheme.cc,v 1.4 2003/08/29 00:46:18 fluxgen Exp $ 23// $Id: ToolTheme.cc,v 1.5 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "ToolTheme.hh" 25#include "ToolTheme.hh"
26 26
@@ -28,7 +28,8 @@ ToolTheme::ToolTheme(int screen_num, const std::string &name, const std::string
28 FbTk::Theme(screen_num), 28 FbTk::Theme(screen_num),
29 TextTheme(*this, name, altname), 29 TextTheme(*this, name, altname),
30 m_texture(*this, name, altname), 30 m_texture(*this, name, altname),
31 m_border(*this, name, altname) { 31 m_border(*this, name, altname),
32 m_alpha(*this, name+".alpha", altname+".Alpha") {
32 33
33} 34}
34 35
@@ -46,6 +47,10 @@ bool ToolTheme::fallback(FbTk::ThemeItem_base &item) {
46 return FbTk::ThemeManager::instance().loadItem(item, 47 return FbTk::ThemeManager::instance().loadItem(item,
47 "toolbar.justify", 48 "toolbar.justify",
48 "Toolbar.Justify"); 49 "Toolbar.Justify");
50 } else if (item.name().find(".alpha") != std::string::npos) {
51 return FbTk::ThemeManager::instance().loadItem(item,
52 "toolbar.alpha",
53 "Toolbar.Alpha");
49 } 54 }
50 55
51 return false; 56 return false;
diff --git a/src/ToolTheme.hh b/src/ToolTheme.hh
index 24ae863..5ca5401 100644
--- a/src/ToolTheme.hh
+++ b/src/ToolTheme.hh
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolTheme.hh,v 1.4 2003/08/29 00:45:41 fluxgen Exp $ 23// $Id: ToolTheme.hh,v 1.5 2004/01/13 14:41:32 rathnor Exp $
24 24
25#ifndef TOOLTHEME_HH 25#ifndef TOOLTHEME_HH
26#define TOOLTHEME_HH 26#define TOOLTHEME_HH
@@ -34,6 +34,8 @@
34#include <X11/Xlib.h> 34#include <X11/Xlib.h>
35#include <string> 35#include <string>
36 36
37class ToolbarTheme;
38
37/// Handles toolbar item theme for text and texture 39/// Handles toolbar item theme for text and texture
38class ToolTheme: public FbTk::Theme, public TextTheme { 40class ToolTheme: public FbTk::Theme, public TextTheme {
39public: 41public:
@@ -46,6 +48,7 @@ public:
46 // textures 48 // textures
47 const FbTk::Texture &texture() const { return *m_texture; } 49 const FbTk::Texture &texture() const { return *m_texture; }
48 const BorderTheme &border() const { return m_border; } 50 const BorderTheme &border() const { return m_border; }
51 inline unsigned char alpha() const { return *m_alpha; }
49 52
50protected: 53protected:
51 FbTk::ThemeItem<FbTk::Texture> &textureTheme() { return m_texture; } 54 FbTk::ThemeItem<FbTk::Texture> &textureTheme() { return m_texture; }
@@ -53,6 +56,7 @@ protected:
53private: 56private:
54 FbTk::ThemeItem<FbTk::Texture> m_texture; 57 FbTk::ThemeItem<FbTk::Texture> m_texture;
55 BorderTheme m_border; 58 BorderTheme m_border;
59 FbTk::ThemeItem<int> m_alpha;
56}; 60};
57 61
58#endif // TOOLTHEME_HH 62#endif // TOOLTHEME_HH
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index e804aed..b267b77 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.135 2004/01/11 16:08:57 fluxgen Exp $ 25// $Id: Toolbar.cc,v 1.136 2004/01/13 14:41:32 rathnor Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -450,7 +450,9 @@ void Toolbar::reconfigure() {
450 450
451 frame.window.setBorderColor(theme().border().color()); 451 frame.window.setBorderColor(theme().border().color());
452 frame.window.setBorderWidth(theme().border().width()); 452 frame.window.setBorderWidth(theme().border().width());
453 frame.window.setAlpha(theme().alpha());
453 frame.window.clear(); 454 frame.window.clear();
455 frame.window.updateTransparent();
454 456
455 if (theme().shape() && m_shape.get()) 457 if (theme().shape() && m_shape.get())
456 m_shape->update(); 458 m_shape->update();
@@ -543,6 +545,8 @@ void Toolbar::exposeEvent(XExposeEvent &ee) {
543 if (ee.window == frame.window) { 545 if (ee.window == frame.window) {
544 frame.window.clearArea(ee.x, ee.y, 546 frame.window.clearArea(ee.x, ee.y,
545 ee.width, ee.height); 547 ee.width, ee.height);
548 frame.window.updateTransparent(ee.x, ee.y,
549 ee.width, ee.height);
546 } 550 }
547} 551}
548 552
@@ -920,6 +924,7 @@ void Toolbar::rearrangeItems() {
920 // unlock 924 // unlock
921 m_resize_lock = false; 925 m_resize_lock = false;
922 frame.window.clear(); 926 frame.window.clear();
927 frame.window.updateTransparent();
923 928
924} 929}
925 930
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc
index e0a01f9..f2291e3 100644
--- a/src/WorkspaceNameTool.cc
+++ b/src/WorkspaceNameTool.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: WorkspaceNameTool.cc,v 1.6 2003/12/07 16:39:43 fluxgen Exp $ 23// $Id: WorkspaceNameTool.cc,v 1.7 2004/01/13 14:41:32 rathnor Exp $
24 24
25#include "WorkspaceNameTool.hh" 25#include "WorkspaceNameTool.hh"
26 26
@@ -123,5 +123,7 @@ void WorkspaceNameTool::renderTheme() {
123 m_button.setJustify(m_theme.justify()); 123 m_button.setJustify(m_theme.justify());
124 m_button.setBorderWidth(m_theme.border().width()); 124 m_button.setBorderWidth(m_theme.border().width());
125 m_button.setBorderColor(m_theme.border().color()); 125 m_button.setBorderColor(m_theme.border().color());
126 m_button.setAlpha(m_theme.alpha());
126 m_button.clear(); 127 m_button.clear();
128 m_button.updateTransparent();
127} 129}