fix transparency updates for the toolbar when autohide is on

This commit is contained in:
simonb 2006-04-17 15:19:07 +00:00
parent 11cba508e6
commit 3e6def97d1
11 changed files with 36 additions and 1 deletions

View file

@ -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)

View file

@ -65,6 +65,8 @@ public:
void setOrientation(FbTk::Orientation orient);
void parentMoved() { m_button.parentMoved(); }
private:
void updateTime();
void update(FbTk::Subject *subj);

View file

@ -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();

View file

@ -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; }

View file

@ -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();
}

View file

@ -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; }

View file

@ -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;

View file

@ -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);

View file

@ -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();
}
}
}

View file

@ -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;

View file

@ -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();