aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrameTheme.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-09 13:31:54 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-09 13:31:54 (GMT)
commit77f39235cf3ad79c5ff7d2b0f4717660476f3cf4 (patch)
tree45cc07526285fc74af54f340782eb11a9d7bc55c /src/FbWinFrameTheme.cc
parent1657374940998176c7b63eb3296265fe6fbb5458 (diff)
downloadfluxbox-77f39235cf3ad79c5ff7d2b0f4717660476f3cf4.zip
fluxbox-77f39235cf3ad79c5ff7d2b0f4717660476f3cf4.tar.bz2
added FbTk::Util::clamp() and simplified related code
Diffstat (limited to 'src/FbWinFrameTheme.cc')
-rw-r--r--src/FbWinFrameTheme.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc
index 92cb134..f01c546 100644
--- a/src/FbWinFrameTheme.cc
+++ b/src/FbWinFrameTheme.cc
@@ -21,6 +21,7 @@
21 21
22#include "FbWinFrameTheme.hh" 22#include "FbWinFrameTheme.hh"
23#include "FbTk/App.hh" 23#include "FbTk/App.hh"
24#include "FbTk/Util.hh"
24 25
25#include "IconbarTheme.hh" 26#include "IconbarTheme.hh"
26 27
@@ -88,16 +89,10 @@ bool FbWinFrameTheme::fallback(FbTk::ThemeItem_base &item) {
88} 89}
89 90
90void FbWinFrameTheme::reconfigTheme() { 91void FbWinFrameTheme::reconfigTheme() {
91 if (*m_bevel_width > 20) 92 *m_bevel_width = FbTk::Util::clamp(*m_bevel_width, 0, 20);
92 *m_bevel_width = 20; 93 if (*m_handle_width < 0)
93 else if (*m_bevel_width < 0)
94 *m_bevel_width = 0;
95
96 if (*m_handle_width > 200)
97 *m_handle_width = 200;
98 else if (*m_handle_width < 0)
99 *m_handle_width = 1; 94 *m_handle_width = 1;
100 95 *m_handle_width = FbTk::Util::clamp(*m_handle_width, 0, 200);
101 m_button_pic_gc.setForeground(*m_button_color); 96 m_button_pic_gc.setForeground(*m_button_color);
102 m_iconbar_theme.reconfigTheme(); 97 m_iconbar_theme.reconfigTheme();
103} 98}