cleaning
This commit is contained in:
parent
bdae051554
commit
62adec2f25
2 changed files with 13 additions and 64 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: ToolbarTheme.cc,v 1.7 2003/08/13 09:53:46 fluxgen Exp $
|
// $Id: ToolbarTheme.cc,v 1.8 2003/08/13 15:12:39 fluxgen Exp $
|
||||||
|
|
||||||
#include "ToolbarTheme.hh"
|
#include "ToolbarTheme.hh"
|
||||||
|
|
||||||
|
@ -45,36 +45,20 @@ void FbTk::ThemeItem<bool>::setFromString(char const *strval) {
|
||||||
|
|
||||||
ToolbarTheme::ToolbarTheme(int screen_num):
|
ToolbarTheme::ToolbarTheme(int screen_num):
|
||||||
FbTk::Theme(screen_num),
|
FbTk::Theme(screen_num),
|
||||||
m_button_color(*this,
|
|
||||||
"toolbar.button.picColor", "Toolbar.Button.PicColor"),
|
|
||||||
m_border_color(*this,
|
|
||||||
"toolbar.borderColor", "Toolbar.BorderColor"),
|
|
||||||
m_toolbar(*this, "toolbar", "Toolbar"),
|
m_toolbar(*this, "toolbar", "Toolbar"),
|
||||||
m_button(*this, "toolbar.button", "Toolbar.Button"),
|
m_border(*this, "toolbar", "Toolbar"),
|
||||||
m_pressed_button(*this,
|
|
||||||
"toolbar.button.pressed", "Toolbar.Button.Pressed"),
|
|
||||||
m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"),
|
|
||||||
m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"),
|
m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"),
|
||||||
m_button_border_width(*this, "toolbar.button.borderWidth", "Toolbar.Button.BorderWidth"),
|
|
||||||
m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"),
|
m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"),
|
||||||
m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"),
|
m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"),
|
||||||
m_display(FbTk::App::instance()->display()) {
|
m_display(FbTk::App::instance()->display()) {
|
||||||
|
|
||||||
Window rootwindow = RootWindow(m_display, screen_num);
|
*m_bevel_width = 0;
|
||||||
|
*m_alpha = 255;
|
||||||
XGCValues gcv;
|
|
||||||
unsigned long gc_value_mask = GCForeground;
|
|
||||||
|
|
||||||
|
|
||||||
gcv.foreground = m_button_color->pixel();
|
|
||||||
m_button_pic_gc =
|
|
||||||
XCreateGC(m_display, rootwindow,
|
|
||||||
gc_value_mask, &gcv);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolbarTheme::~ToolbarTheme() {
|
ToolbarTheme::~ToolbarTheme() {
|
||||||
XFreeGC(m_display, m_button_pic_gc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolbarTheme::reconfigTheme() {
|
void ToolbarTheme::reconfigTheme() {
|
||||||
|
@ -82,12 +66,4 @@ void ToolbarTheme::reconfigTheme() {
|
||||||
*m_alpha = 255;
|
*m_alpha = 255;
|
||||||
else if (*m_alpha < 0)
|
else if (*m_alpha < 0)
|
||||||
*m_alpha = 0;
|
*m_alpha = 0;
|
||||||
|
|
||||||
XGCValues gcv;
|
|
||||||
unsigned long gc_value_mask = GCForeground;
|
|
||||||
|
|
||||||
gcv.foreground = m_button_color->pixel();
|
|
||||||
XChangeGC(m_display, m_button_pic_gc,
|
|
||||||
gc_value_mask, &gcv);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,16 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: ToolbarTheme.hh,v 1.7 2003/08/13 09:53:35 fluxgen Exp $
|
// $Id: ToolbarTheme.hh,v 1.8 2003/08/13 15:12:39 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef TOOLBARTHEME_HH
|
#ifndef TOOLBARTHEME_HH
|
||||||
#define TOOLBARTHEME_HH
|
#define TOOLBARTHEME_HH
|
||||||
|
|
||||||
#include "FbTk/Theme.hh"
|
#include "FbTk/Theme.hh"
|
||||||
#include "Font.hh"
|
|
||||||
#include "Texture.hh"
|
#include "Texture.hh"
|
||||||
#include "Color.hh"
|
#include "Color.hh"
|
||||||
#include "Text.hh"
|
|
||||||
#include "Subject.hh"
|
#include "BorderTheme.hh"
|
||||||
|
|
||||||
/// toolbar theme class container
|
/// toolbar theme class container
|
||||||
class ToolbarTheme: public FbTk::Theme {
|
class ToolbarTheme: public FbTk::Theme {
|
||||||
|
@ -39,48 +38,22 @@ public:
|
||||||
|
|
||||||
void reconfigTheme();
|
void reconfigTheme();
|
||||||
|
|
||||||
/**
|
|
||||||
@name colors
|
|
||||||
*/
|
|
||||||
///@{
|
|
||||||
const FbTk::Color &buttonColor() const { return *m_button_color; }
|
|
||||||
const FbTk::Color &borderColor() const { return *m_border_color; }
|
|
||||||
///@}
|
|
||||||
/**
|
|
||||||
@name textures
|
|
||||||
*/
|
|
||||||
///@{
|
|
||||||
const FbTk::Texture &toolbar() const { return *m_toolbar; }
|
|
||||||
const FbTk::Texture &button() const { return *m_button; }
|
|
||||||
const FbTk::Texture &pressedButton() const { return *m_pressed_button; }
|
|
||||||
///@}
|
|
||||||
|
|
||||||
/**
|
inline const BorderTheme &border() const { return m_border; }
|
||||||
@name graphic context
|
inline const FbTk::Texture &toolbar() const { return *m_toolbar; }
|
||||||
*/
|
|
||||||
///@{
|
|
||||||
GC buttonPicGC() const { return m_button_pic_gc; }
|
|
||||||
///@}
|
|
||||||
|
|
||||||
inline int borderWidth() const { return *m_border_width; }
|
|
||||||
inline int bevelWidth() const { return *m_bevel_width; }
|
inline int bevelWidth() const { return *m_bevel_width; }
|
||||||
inline int buttonBorderWidth() const { return *m_button_border_width; }
|
|
||||||
inline bool shape() const { return *m_shape; }
|
inline bool shape() const { return *m_shape; }
|
||||||
inline unsigned char alpha() const { return *m_alpha; }
|
inline unsigned char alpha() const { return *m_alpha; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// text colors
|
FbTk::ThemeItem<FbTk::Texture> m_toolbar;
|
||||||
FbTk::ThemeItem<FbTk::Color> m_button_color, m_border_color;
|
BorderTheme m_border;
|
||||||
// textures
|
|
||||||
FbTk::ThemeItem<FbTk::Texture> m_toolbar, m_button, m_pressed_button;
|
|
||||||
|
|
||||||
FbTk::ThemeItem<int> m_border_width, m_bevel_width, m_button_border_width;
|
FbTk::ThemeItem<int> m_bevel_width;
|
||||||
FbTk::ThemeItem<bool> m_shape;
|
FbTk::ThemeItem<bool> m_shape;
|
||||||
FbTk::ThemeItem<int> m_alpha;
|
FbTk::ThemeItem<int> m_alpha;
|
||||||
|
|
||||||
// graphic context
|
|
||||||
GC m_button_pic_gc;
|
|
||||||
|
|
||||||
Display *m_display;
|
Display *m_display;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue