From 52c374570ee5791a0b953f4ffc75082f216d1d1e Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 27 Feb 2013 09:50:29 +0100 Subject: minor code simplifications --- src/ToolFactory.cc | 15 +++++---------- src/Toolbar.cc | 10 ++-------- 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() { 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(); + unsigned int max_height = 0; - 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 c43a419..4300790 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; -- cgit v0.11.2