From 3e6def97d18133baf82b596cb742a2f7ef4f9f00 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 17 Apr 2006 15:19:07 +0000 Subject: fix transparency updates for the toolbar when autohide is on --- ChangeLog | 2 ++ src/ClockTool.hh | 2 ++ src/Container.cc | 8 ++++++++ src/Container.hh | 2 ++ src/GenericTool.cc | 5 +++++ src/GenericTool.hh | 2 ++ src/IconbarTool.hh | 1 + src/SystemTray.hh | 2 ++ src/Toolbar.cc | 8 +++++++- src/ToolbarItem.hh | 3 +++ src/WorkspaceNameTool.hh | 2 ++ 11 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4718efd..3d86d64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.16: *06/04/17: + * Fix toolbar transparency when autohide enabled (Simon) + Toolbar.cc Container.hh/cc ToolbarItem.hh/cc *Tool.hh/cc * Fix toolbar transparency (frame and empty iconbar) (Simon) Container.cc Toolbar.cc * Fix display of label for dialog-type boxes (Simon) diff --git a/src/ClockTool.hh b/src/ClockTool.hh index 9993ee6..d55bf5f 100644 --- a/src/ClockTool.hh +++ b/src/ClockTool.hh @@ -65,6 +65,8 @@ public: void setOrientation(FbTk::Orientation orient); + void parentMoved() { m_button.parentMoved(); } + private: void updateTime(); void update(FbTk::Subject *subj); diff --git a/src/Container.cc b/src/Container.cc index db460c2..4cd0fa8 100644 --- a/src/Container.cc +++ b/src/Container.cc @@ -510,6 +510,14 @@ void Container::setAlpha(unsigned char alpha) { (*it)->setAlpha(alpha); } +void Container::parentMoved() { + FbTk::FbWindow::parentMoved(); + ItemList::iterator it = m_item_list.begin(); + ItemList::iterator it_end = m_item_list.end(); + for (; it != it_end; ++it) + (*it)->parentMoved(); +} + void Container::clear() { ItemList::iterator it = m_item_list.begin(); ItemList::iterator it_end = m_item_list.end(); diff --git a/src/Container.hh b/src/Container.hh index 20f7048..448abee 100644 --- a/src/Container.hh +++ b/src/Container.hh @@ -83,6 +83,8 @@ public: bool tryButtonPressEvent(XButtonEvent &event); bool tryButtonReleaseEvent(XButtonEvent &event); + void parentMoved(); + /// accessors inline Alignment alignment() const { return m_align; } inline FbTk::Orientation orientation() const { return m_orientation; } diff --git a/src/GenericTool.cc b/src/GenericTool.cc index caed5f4..809b9e4 100644 --- a/src/GenericTool.cc +++ b/src/GenericTool.cc @@ -84,3 +84,8 @@ void GenericTool::renderTheme(unsigned char alpha) { void GenericTool::update(FbTk::Subject *subj) { m_window->clear(); } + +void GenericTool::parentMoved() { + m_window->parentMoved(); +} + diff --git a/src/GenericTool.hh b/src/GenericTool.hh index e77232c..c44c9cc 100644 --- a/src/GenericTool.hh +++ b/src/GenericTool.hh @@ -52,6 +52,8 @@ public: unsigned int height() const; unsigned int borderWidth() const; + void parentMoved(); + const ToolTheme &theme() const { return m_theme; } FbTk::FbWindow &window() { return *m_window; } const FbTk::FbWindow &window() const { return *m_window; } diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh index c56e7a3..3589185 100644 --- a/src/IconbarTool.hh +++ b/src/IconbarTool.hh @@ -86,6 +86,7 @@ public: void setMode(Mode mode); void setDeiconifyMode(DeiconifyMode mode); void setWheelMode(WheelMode mode); + void parentMoved() { m_icon_container.parentMoved(); } unsigned int width() const; unsigned int height() const; diff --git a/src/SystemTray.hh b/src/SystemTray.hh index 7bb884f..8be1cd8 100644 --- a/src/SystemTray.hh +++ b/src/SystemTray.hh @@ -71,6 +71,8 @@ public: inline void renderTheme(unsigned char alpha) {} inline void updateSizing() {} + void parentMoved() { m_window.parentMoved(); } + private: void update(FbTk::Subject *subj); diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 484719e..6384430 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -782,8 +782,14 @@ void Toolbar::toggleHidden() { m_hidden = ! m_hidden; if (isHidden()) frame.window.move(frame.x_hidden, frame.y_hidden); - else + else { frame.window.move(frame.x, frame.y); + ItemList::iterator item_it = m_item_list.begin(); + ItemList::iterator item_it_end = m_item_list.end(); + for (item_it = m_item_list.begin(); item_it != item_it_end; ++item_it) { + (*item_it)->parentMoved(); + } + } } diff --git a/src/ToolbarItem.hh b/src/ToolbarItem.hh index a240880..5e1ed25 100644 --- a/src/ToolbarItem.hh +++ b/src/ToolbarItem.hh @@ -58,6 +58,9 @@ public: // the toolbar instead. Otherwise there are ordering problems. virtual void renderTheme(unsigned char alpha) = 0; + // insist implemented, even if blank + virtual void parentMoved() = 0; // called when moved from hiding + // just update theme items that affect the size virtual void updateSizing() = 0; diff --git a/src/WorkspaceNameTool.hh b/src/WorkspaceNameTool.hh index 6017d4e..f12ca18 100644 --- a/src/WorkspaceNameTool.hh +++ b/src/WorkspaceNameTool.hh @@ -54,6 +54,8 @@ public: const FbTk::Button &button() const { return m_button; } void setOrientation(FbTk::Orientation orient); + void parentMoved() { m_button.parentMoved(); } + private: void renderTheme(unsigned char alpha); void reRender(); -- cgit v0.11.2