aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-02-27 08:50:29 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-02-27 08:50:29 (GMT)
commit52c374570ee5791a0b953f4ffc75082f216d1d1e (patch)
tree7a420c7be7bb641b2fa80a3f0b6239ae51f1b72e
parent0810d7db5e87d9541daabac98a4b8b2d0f431b69 (diff)
downloadfluxbox-52c374570ee5791a0b953f4ffc75082f216d1d1e.zip
fluxbox-52c374570ee5791a0b953f4ffc75082f216d1d1e.tar.bz2
minor code simplifications
-rw-r--r--src/ToolFactory.cc15
-rw-r--r--src/Toolbar.cc10
2 files changed, 7 insertions, 18 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index 4034313..60b283c 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -139,18 +139,13 @@ void ToolFactory::updateThemes() {
139 139
140 140
141int ToolFactory::maxFontHeight() { 141int ToolFactory::maxFontHeight() {
142 unsigned int max_height = 0;
143 if (max_height < m_clock_theme.font().height())
144 max_height = m_clock_theme.font().height();
145
146 if (max_height < m_focused_iconbar_theme.text().font().height())
147 max_height = m_focused_iconbar_theme.text().font().height();
148 142
149 if (max_height < m_unfocused_iconbar_theme.text().font().height()) 143 unsigned int max_height = 0;
150 max_height = m_unfocused_iconbar_theme.text().font().height();
151 144
152 if (max_height < m_workspace_theme->font().height()) 145 max_height = std::max(max_height, m_clock_theme.font().height());
153 max_height = m_workspace_theme->font().height(); 146 max_height = std::max(max_height, m_focused_iconbar_theme.text().font().height());
147 max_height = std::max(max_height, m_unfocused_iconbar_theme.text().font().height());
148 max_height = std::max(max_height, m_workspace_theme->font().height());
154 149
155 return max_height; 150 return max_height;
156} 151}
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index c43a419..4300790 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -953,10 +953,7 @@ void Toolbar::rearrangeItems() {
953 fixed_width += bevel_width + 2*borderW; 953 fixed_width += bevel_width + 2*borderW;
954 } else { 954 } else {
955 if (!first) { 955 if (!first) {
956 if (borderW > last_bw) 956 fixed_width += std::max(borderW, last_bw);
957 fixed_width += borderW;
958 else
959 fixed_width += last_bw;
960 } else { 957 } else {
961 first = false; 958 first = false;
962 } 959 }
@@ -1013,10 +1010,7 @@ void Toolbar::rearrangeItems() {
1013 if (bevel_width == 0) { 1010 if (bevel_width == 0) {
1014 offset = -borderW; 1011 offset = -borderW;
1015 size_offset = 0; 1012 size_offset = 0;
1016 if (borderW > last_bw) 1013 next_x += std::max(borderW, last_bw);
1017 next_x += borderW;
1018 else
1019 next_x += last_bw;
1020 } 1014 }
1021 last_bw = borderW; 1015 last_bw = borderW;
1022 1016