From 7f6880bbac9ffec3b6221eb04e0977b9a9c669b7 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 23 Jul 2002 18:38:31 +0000 Subject: slit theme, which falls back on toolbar theme if it does not exist --- src/Slit.cc | 4 ++-- src/Theme.cc | 16 ++++++++++++---- src/Theme.hh | 25 +++++++++++++------------ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/Slit.cc b/src/Slit.cc index 0dded4f..6eea94b 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -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, diff --git a/src/Theme.cc b/src/Theme.cc index 552cf8c..89db396 100644 --- a/src/Theme.cc +++ b/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: "<