From 073065ac56b388db1169108d44f37d32f1d19c67 Mon Sep 17 00:00:00 2001 From: rathnor Date: Mon, 24 May 2004 15:30:52 +0000 Subject: more fixing up of alpha zero-relatd problems - particularly fallback to 255, not zero for alpha items --- ChangeLog | 4 +++- src/FbWinFrameTheme.cc | 6 ++++-- src/IconbarTheme.cc | 7 +++++-- src/ToolTheme.cc | 10 ++++++---- src/ToolbarTheme.cc | 11 +++++++++-- src/ToolbarTheme.hh | 4 +++- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67a8fce..3b0eef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,9 @@ Changes for 0.9.10: *04/05/24: * Fix handling alpha value of zero (Simon) - FbWindow.cc + - also fix up defaulting of missing alpha theme items to 255 + FbWindow.cc ToolbarTheme.hh/cc IconbarTheme.cc ToolTheme.cc + FbWinFrameTheme.cc *04/05/21: * fluxbox-generate_menu: Updated polish locales from: Łukasz Wrzosek (unl at poczta dot fm) diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc index ce26a49..e2e89fc 100644 --- a/src/FbWinFrameTheme.cc +++ b/src/FbWinFrameTheme.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrameTheme.cc,v 1.17 2004/01/11 16:13:09 fluxgen Exp $ +// $Id: FbWinFrameTheme.cc,v 1.18 2004/05/24 15:30:52 rathnor Exp $ #include "FbWinFrameTheme.hh" #include "App.hh" @@ -105,8 +105,10 @@ bool FbWinFrameTheme::fallback(FbTk::ThemeItem_base &item) { } else if (item.name() == "window.label.active.textColor") { return FbTk::ThemeManager::instance().loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); + } else if (item.name() == "window.alpha") { + *m_alpha = 255; + return true; } - return false; } diff --git a/src/IconbarTheme.cc b/src/IconbarTheme.cc index 9710dfc..ec46840 100644 --- a/src/IconbarTheme.cc +++ b/src/IconbarTheme.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTheme.cc,v 1.9 2004/04/26 15:04:36 rathnor Exp $ +// $Id: IconbarTheme.cc,v 1.10 2004/05/24 15:30:52 rathnor Exp $ #include "IconbarTheme.hh" #include "FbTk/App.hh" @@ -99,7 +99,10 @@ bool IconbarTheme::fallback(FbTk::ThemeItem_base &item) { } else if (item.name() == m_name + ".unfocused.textColor") { return tm.loadItem(item, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"); } else if (item.name() == m_name + ".alpha") { - return tm.loadItem(item, "toolbar.alpha", "Toolbar.Alpha"); + if (!tm.loadItem(item, "toolbar.alpha", "Toolbar.Alpha")) { + *m_alpha = 255; + } + return true; } return false; diff --git a/src/ToolTheme.cc b/src/ToolTheme.cc index f7dd118..fdcb592 100644 --- a/src/ToolTheme.cc +++ b/src/ToolTheme.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolTheme.cc,v 1.5 2004/01/13 14:41:32 rathnor Exp $ +// $Id: ToolTheme.cc,v 1.6 2004/05/24 15:30:52 rathnor Exp $ #include "ToolTheme.hh" @@ -48,9 +48,11 @@ bool ToolTheme::fallback(FbTk::ThemeItem_base &item) { "toolbar.justify", "Toolbar.Justify"); } else if (item.name().find(".alpha") != std::string::npos) { - return FbTk::ThemeManager::instance().loadItem(item, - "toolbar.alpha", - "Toolbar.Alpha"); + if (!FbTk::ThemeManager::instance().loadItem(item, + "toolbar.alpha", + "Toolbar.Alpha")) + *m_alpha = 255; + return true; } return false; diff --git a/src/ToolbarTheme.cc b/src/ToolbarTheme.cc index 999b142..6b6013f 100644 --- a/src/ToolbarTheme.cc +++ b/src/ToolbarTheme.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarTheme.cc,v 1.14 2004/04/26 15:04:37 rathnor Exp $ +// $Id: ToolbarTheme.cc,v 1.15 2004/05/24 15:30:52 rathnor Exp $ #include "ToolbarTheme.hh" @@ -55,7 +55,6 @@ ToolbarTheme::ToolbarTheme(int screen_num): m_button_size(*this, "toolbar.button.size", "Toolbar.Button.Size") { // set default value *m_bevel_width = 0; - *m_alpha = 255; *m_shape = false; *m_height = 0; *m_button_size = -1; @@ -65,6 +64,14 @@ ToolbarTheme::~ToolbarTheme() { } +bool ToolbarTheme::fallback(FbTk::ThemeItem_base &item) { + if (item.name() == "toolbar.alpha") { + *m_alpha = 255; + return true; + } + return false; +} + void ToolbarTheme::reconfigTheme() { if (*m_alpha > 255) *m_alpha = 255; diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh index c33dbe8..aa654c8 100644 --- a/src/ToolbarTheme.hh +++ b/src/ToolbarTheme.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarTheme.hh,v 1.10 2003/10/13 23:47:38 fluxgen Exp $ +// $Id: ToolbarTheme.hh,v 1.11 2004/05/24 15:30:52 rathnor Exp $ #ifndef TOOLBARTHEME_HH #define TOOLBARTHEME_HH @@ -42,6 +42,8 @@ public: inline const BorderTheme &border() const { return m_border; } inline const FbTk::Texture &toolbar() const { return *m_toolbar; } + bool fallback(FbTk::ThemeItem_base &item); + inline int bevelWidth() const { return *m_bevel_width; } inline bool shape() const { return *m_shape; } inline unsigned char alpha() const { return *m_alpha; } -- cgit v0.11.2