minor code simplifications

This commit is contained in:
Mathias Gumz 2013-02-27 09:50:29 +01:00
parent 0810d7db5e
commit 52c374570e
2 changed files with 7 additions and 18 deletions

View file

@ -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;
}

View file

@ -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;