aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-07-23 18:38:31 (GMT)
committerfluxgen <fluxgen>2002-07-23 18:38:31 (GMT)
commit7f6880bbac9ffec3b6221eb04e0977b9a9c669b7 (patch)
tree78b170c869d5aa21df2751b1a5d49fb987cbd444 /src
parent47d27a0bab8d6585d3031b7945c7ee6718f8d228 (diff)
downloadfluxbox_paul-7f6880bbac9ffec3b6221eb04e0977b9a9c669b7.zip
fluxbox_paul-7f6880bbac9ffec3b6221eb04e0977b9a9c669b7.tar.bz2
slit theme, which falls back on toolbar theme if it does not exist
Diffstat (limited to 'src')
-rw-r--r--src/Slit.cc4
-rw-r--r--src/Theme.cc16
-rw-r--r--src/Theme.hh25
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 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Slit.cc,v 1.18 2002/07/23 17:11:59 fluxgen Exp $ 22// $Id: Slit.cc,v 1.19 2002/07/23 18:38:31 fluxgen Exp $
23 23
24//use GNU extensions 24//use GNU extensions
25#ifndef _GNU_SOURCE 25#ifndef _GNU_SOURCE
@@ -408,7 +408,7 @@ void Slit::reconfigure(void) {
408 408
409 Pixmap tmp = frame.pixmap; 409 Pixmap tmp = frame.pixmap;
410 BImageControl *image_ctrl = screen->getImageControl(); 410 BImageControl *image_ctrl = screen->getImageControl();
411 FbTk::Texture *texture = &(screen->getToolbarStyle()->toolbar); 411 const FbTk::Texture *texture = &(screen->getTheme()->getSlitTexture());
412 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 412 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
413 frame.pixmap = None; 413 frame.pixmap = None;
414 XSetWindowBackground(display, frame.window, 414 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 @@
41// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 41// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42// DEALINGS IN THE SOFTWARE. 42// DEALINGS IN THE SOFTWARE.
43 43
44// $Id: Theme.cc,v 1.23 2002/07/23 17:11:59 fluxgen Exp $ 44// $Id: Theme.cc,v 1.24 2002/07/23 18:38:31 fluxgen Exp $
45 45
46#ifndef _GNU_SOURCE 46#ifndef _GNU_SOURCE
47#define _GNU_SOURCE 47#define _GNU_SOURCE
@@ -286,7 +286,7 @@ void Theme::load(const char *filename){
286 m_database = XrmGetFileDatabase(DEFAULTSTYLE); 286 m_database = XrmGetFileDatabase(DEFAULTSTYLE);
287 287
288 loadMenuStyle(); 288 loadMenuStyle();
289 loadToolbarStyle(); 289 loadToolbarStyle();
290 loadWindowStyle(); 290 loadWindowStyle();
291 loadTabStyle(); 291 loadTabStyle();
292 loadRootCommand(); 292 loadRootCommand();
@@ -665,7 +665,7 @@ void Theme::loadRootCommand() {
665 665
666} 666}
667 667
668void Theme::loadMisc(void) { 668void Theme::loadMisc() {
669 unsigned int screen_width_div2 = WidthOfScreen(ScreenOfDisplay(m_display, m_screennum)) / 2; 669 unsigned int screen_width_div2 = WidthOfScreen(ScreenOfDisplay(m_display, m_screennum)) / 2;
670 XrmValue value; 670 XrmValue value;
671 char *value_type=0; 671 char *value_type=0;
@@ -705,6 +705,14 @@ void Theme::loadMisc(void) {
705 705
706 readDatabaseColor("borderColor", "BorderColor", &m_border_color, 706 readDatabaseColor("borderColor", "BorderColor", &m_border_color,
707 BlackPixel(m_display, m_screennum)); 707 BlackPixel(m_display, m_screennum));
708
709 // load slit style, if it wasn't found fall back to toolbarstyle
710 if (!readDatabaseTexture("slit", "Slit",
711 &m_slit_texture,
712 BlackPixel(m_display, m_screennum)) ) {
713 m_slit_texture = m_toolbarstyle.toolbar;
714 }
715
708} 716}
709 717
710 718
@@ -807,7 +815,7 @@ bool Theme::readDatabaseTexture(char *rname, char *rclass,
807 } 815 }
808 816
809 if (!retval) 817 if (!retval)
810 fprintf(stderr, "Faild in readTexture\n"); 818 cerr<<"Failed to load texture for: "<<rname<<endl;
811 819
812 return retval; 820 return retval;
813} 821}
diff --git a/src/Theme.hh b/src/Theme.hh
index b892647..97fe9cd 100644
--- a/src/Theme.hh
+++ b/src/Theme.hh
@@ -42,7 +42,7 @@
42// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 42// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
43// DEALINGS IN THE SOFTWARE. 43// DEALINGS IN THE SOFTWARE.
44 44
45// $Id: Theme.hh,v 1.11 2002/07/23 17:11:59 fluxgen Exp $ 45// $Id: Theme.hh,v 1.12 2002/07/23 18:38:31 fluxgen Exp $
46 46
47#ifndef THEME_HH 47#ifndef THEME_HH
48#define THEME_HH 48#define THEME_HH
@@ -111,16 +111,17 @@ public:
111 DrawUtil::Font font; 111 DrawUtil::Font font;
112 112
113 } ToolbarStyle; 113 } ToolbarStyle;
114 114
115 inline WindowStyle &getWindowStyle(void) { return m_windowstyle; } 115 inline WindowStyle &getWindowStyle() { return m_windowstyle; }
116 inline MenuStyle &getMenuStyle(void) { return m_menustyle; } 116 inline MenuStyle &getMenuStyle() { return m_menustyle; }
117 inline ToolbarStyle &getToolbarStyle(void) { return m_toolbarstyle; } 117 inline ToolbarStyle &getToolbarStyle() { return m_toolbarstyle; }
118 inline unsigned int getBevelWidth(void) const { return m_bevel_width; } 118 inline const FbTk::Texture &getSlitTexture() const { return m_slit_texture; }
119 inline unsigned int getBorderWidth(void) const { return m_border_width; } 119 inline unsigned int getBevelWidth() const { return m_bevel_width; }
120 inline unsigned int getHandleWidth(void) const { return m_handle_width; } 120 inline unsigned int getBorderWidth() const { return m_border_width; }
121 inline unsigned int getFrameWidth(void) const { return m_frame_width; } 121 inline unsigned int getHandleWidth() const { return m_handle_width; }
122 inline const GC &getOpGC(void) const { return m_opgc; } 122 inline unsigned int getFrameWidth() const { return m_frame_width; }
123 inline const FbTk::Color &getBorderColor(void) const { return m_border_color; } 123 inline GC getOpGC() const { return m_opgc; }
124 inline const FbTk::Color &getBorderColor() const { return m_border_color; }
124 void load(const char *filename); 125 void load(const char *filename);
125 void reconfigure(); 126 void reconfigure();
126 127
@@ -164,7 +165,7 @@ private:
164 Colormap m_colormap; 165 Colormap m_colormap;
165 int m_screennum; 166 int m_screennum;
166 std::string m_rootcommand; 167 std::string m_rootcommand;
167 168 FbTk::Texture m_slit_texture;
168}; 169};
169 170
170 171