more fixing up of alpha zero-relatd problems - particularly fallback to

255, not zero for alpha items
This commit is contained in:
rathnor 2004-05-24 15:30:52 +00:00
parent ca307efe3e
commit 073065ac56
6 changed files with 30 additions and 12 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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