slit theme, which falls back on toolbar theme if it does not exist
This commit is contained in:
parent
47d27a0bab
commit
7f6880bbac
3 changed files with 27 additions and 18 deletions
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Slit.cc,v 1.18 2002/07/23 17:11:59 fluxgen Exp $
|
||||
// $Id: Slit.cc,v 1.19 2002/07/23 18:38:31 fluxgen Exp $
|
||||
|
||||
//use GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -408,7 +408,7 @@ void Slit::reconfigure(void) {
|
|||
|
||||
Pixmap tmp = frame.pixmap;
|
||||
BImageControl *image_ctrl = screen->getImageControl();
|
||||
FbTk::Texture *texture = &(screen->getToolbarStyle()->toolbar);
|
||||
const FbTk::Texture *texture = &(screen->getTheme()->getSlitTexture());
|
||||
if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
|
||||
frame.pixmap = None;
|
||||
XSetWindowBackground(display, frame.window,
|
||||
|
|
16
src/Theme.cc
16
src/Theme.cc
|
@ -41,7 +41,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Theme.cc,v 1.23 2002/07/23 17:11:59 fluxgen Exp $
|
||||
// $Id: Theme.cc,v 1.24 2002/07/23 18:38:31 fluxgen Exp $
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -286,7 +286,7 @@ void Theme::load(const char *filename){
|
|||
m_database = XrmGetFileDatabase(DEFAULTSTYLE);
|
||||
|
||||
loadMenuStyle();
|
||||
loadToolbarStyle();
|
||||
loadToolbarStyle();
|
||||
loadWindowStyle();
|
||||
loadTabStyle();
|
||||
loadRootCommand();
|
||||
|
@ -665,7 +665,7 @@ void Theme::loadRootCommand() {
|
|||
|
||||
}
|
||||
|
||||
void Theme::loadMisc(void) {
|
||||
void Theme::loadMisc() {
|
||||
unsigned int screen_width_div2 = WidthOfScreen(ScreenOfDisplay(m_display, m_screennum)) / 2;
|
||||
XrmValue value;
|
||||
char *value_type=0;
|
||||
|
@ -705,6 +705,14 @@ void Theme::loadMisc(void) {
|
|||
|
||||
readDatabaseColor("borderColor", "BorderColor", &m_border_color,
|
||||
BlackPixel(m_display, m_screennum));
|
||||
|
||||
// load slit style, if it wasn't found fall back to toolbarstyle
|
||||
if (!readDatabaseTexture("slit", "Slit",
|
||||
&m_slit_texture,
|
||||
BlackPixel(m_display, m_screennum)) ) {
|
||||
m_slit_texture = m_toolbarstyle.toolbar;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -807,7 +815,7 @@ bool Theme::readDatabaseTexture(char *rname, char *rclass,
|
|||
}
|
||||
|
||||
if (!retval)
|
||||
fprintf(stderr, "Faild in readTexture\n");
|
||||
cerr<<"Failed to load texture for: "<<rname<<endl;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
25
src/Theme.hh
25
src/Theme.hh
|
@ -42,7 +42,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Theme.hh,v 1.11 2002/07/23 17:11:59 fluxgen Exp $
|
||||
// $Id: Theme.hh,v 1.12 2002/07/23 18:38:31 fluxgen Exp $
|
||||
|
||||
#ifndef THEME_HH
|
||||
#define THEME_HH
|
||||
|
@ -111,16 +111,17 @@ public:
|
|||
DrawUtil::Font font;
|
||||
|
||||
} ToolbarStyle;
|
||||
|
||||
inline WindowStyle &getWindowStyle(void) { return m_windowstyle; }
|
||||
inline MenuStyle &getMenuStyle(void) { return m_menustyle; }
|
||||
inline ToolbarStyle &getToolbarStyle(void) { return m_toolbarstyle; }
|
||||
inline unsigned int getBevelWidth(void) const { return m_bevel_width; }
|
||||
inline unsigned int getBorderWidth(void) const { return m_border_width; }
|
||||
inline unsigned int getHandleWidth(void) const { return m_handle_width; }
|
||||
inline unsigned int getFrameWidth(void) const { return m_frame_width; }
|
||||
inline const GC &getOpGC(void) const { return m_opgc; }
|
||||
inline const FbTk::Color &getBorderColor(void) const { return m_border_color; }
|
||||
|
||||
inline WindowStyle &getWindowStyle() { return m_windowstyle; }
|
||||
inline MenuStyle &getMenuStyle() { return m_menustyle; }
|
||||
inline ToolbarStyle &getToolbarStyle() { return m_toolbarstyle; }
|
||||
inline const FbTk::Texture &getSlitTexture() const { return m_slit_texture; }
|
||||
inline unsigned int getBevelWidth() const { return m_bevel_width; }
|
||||
inline unsigned int getBorderWidth() const { return m_border_width; }
|
||||
inline unsigned int getHandleWidth() const { return m_handle_width; }
|
||||
inline unsigned int getFrameWidth() const { return m_frame_width; }
|
||||
inline GC getOpGC() const { return m_opgc; }
|
||||
inline const FbTk::Color &getBorderColor() const { return m_border_color; }
|
||||
void load(const char *filename);
|
||||
void reconfigure();
|
||||
|
||||
|
@ -164,7 +165,7 @@ private:
|
|||
Colormap m_colormap;
|
||||
int m_screennum;
|
||||
std::string m_rootcommand;
|
||||
|
||||
FbTk::Texture m_slit_texture;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue