summaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/MenuItem.cc11
1 files 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 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: MenuItem.cc,v 1.7 2004/09/01 07:53:45 akir Exp $ 22// $Id: MenuItem.cc,v 1.8 2004/09/01 08:00:24 akir Exp $
23 23
24#include "MenuItem.hh" 24#include "MenuItem.hh"
25#include "Command.hh" 25#include "Command.hh"
@@ -243,12 +243,11 @@ unsigned int MenuItem::height(const MenuTheme &theme) const {
243 243
244unsigned int MenuItem::width(const MenuTheme &theme) const { 244unsigned int MenuItem::width(const MenuTheme &theme) const {
245 // textwidth + bevel width on each side of the text 245 // textwidth + bevel width on each side of the text
246 int normal = theme.frameFont().textWidth(label().c_str(), label().size()) + 2*(theme.bevelWidth() + height(theme)); 246 const unsigned int icon_width = height(theme);
247 if (m_icon.get() == 0) 247 const unsigned int normal = theme.frameFont().textWidth(label().c_str(), label().size()) +
248 return normal; 248 2 * (theme.bevelWidth() + icon_width);
249 else
250 return normal + height(theme);
251 249
250 return m_icon.get() == 0 ? normal : normal + icon_width;
252} 251}
253 252
254void MenuItem::updateTheme(const MenuTheme &theme) { 253void MenuItem::updateTheme(const MenuTheme &theme) {