minor code simplifications
Mathias Gumz akira at fluxbox dot org
2 files changed,
7 insertions(+),
18 deletions(-)
M
src/ToolFactory.cc
→
src/ToolFactory.cc
@@ -139,18 +139,13 @@ }
int ToolFactory::maxFontHeight() { + unsigned int max_height = 0; - if (max_height < m_clock_theme.font().height()) - max_height = m_clock_theme.font().height(); - if (max_height < m_focused_iconbar_theme.text().font().height()) - max_height = m_focused_iconbar_theme.text().font().height(); - - if (max_height < m_unfocused_iconbar_theme.text().font().height()) - max_height = m_unfocused_iconbar_theme.text().font().height(); - - if (max_height < m_workspace_theme->font().height()) - max_height = m_workspace_theme->font().height(); + max_height = std::max(max_height, m_clock_theme.font().height()); + max_height = std::max(max_height, m_focused_iconbar_theme.text().font().height()); + max_height = std::max(max_height, m_unfocused_iconbar_theme.text().font().height()); + max_height = std::max(max_height, m_workspace_theme->font().height()); return max_height; }
M
src/Toolbar.cc
→
src/Toolbar.cc
@@ -953,10 +953,7 @@ // the bevel and border are fixed whether relative or not
fixed_width += bevel_width + 2*borderW; } else { if (!first) { - if (borderW > last_bw) - fixed_width += borderW; - else - fixed_width += last_bw; + fixed_width += std::max(borderW, last_bw); } else { first = false; }@@ -1013,10 +1010,7 @@
if (bevel_width == 0) { offset = -borderW; size_offset = 0; - if (borderW > last_bw) - next_x += borderW; - else - next_x += last_bw; + next_x += std::max(borderW, last_bw); } last_bw = borderW;