diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc index 40343130..60b283c8 100644 --- a/src/ToolFactory.cc +++ b/src/ToolFactory.cc @@ -139,18 +139,13 @@ void ToolFactory::updateThemes() { 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; } diff --git a/src/Toolbar.cc b/src/Toolbar.cc index c43a419c..43007901 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -953,10 +953,7 @@ void Toolbar::rearrangeItems() { 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 @@ void Toolbar::rearrangeItems() { 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;