From 0fbb0bfe8be781001a8e8ab50523dc923f6af665 Mon Sep 17 00:00:00 2001 From: akir Date: Wed, 1 Sep 2004 08:00:24 +0000 Subject: cosmetic --- src/FbTk/MenuItem.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc index 137facd..ee997bb 100644 --- a/src/FbTk/MenuItem.cc +++ b/src/FbTk/MenuItem.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuItem.cc,v 1.7 2004/09/01 07:53:45 akir Exp $ +// $Id: MenuItem.cc,v 1.8 2004/09/01 08:00:24 akir Exp $ #include "MenuItem.hh" #include "Command.hh" @@ -243,12 +243,11 @@ unsigned int MenuItem::height(const MenuTheme &theme) const { unsigned int MenuItem::width(const MenuTheme &theme) const { // textwidth + bevel width on each side of the text - int normal = theme.frameFont().textWidth(label().c_str(), label().size()) + 2*(theme.bevelWidth() + height(theme)); - if (m_icon.get() == 0) - return normal; - else - return normal + height(theme); + const unsigned int icon_width = height(theme); + const unsigned int normal = theme.frameFont().textWidth(label().c_str(), label().size()) + + 2 * (theme.bevelWidth() + icon_width); + return m_icon.get() == 0 ? normal : normal + icon_width; } void MenuItem::updateTheme(const MenuTheme &theme) { -- cgit v0.11.2