aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index ded5dab..811964c 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -375,8 +375,7 @@ void Menu::enableTitle() {
375 375
376void Menu::updateMenu() { 376void Menu::updateMenu() {
377 if (m_title_vis) { 377 if (m_title_vis) {
378 menu.item_w = theme()->titleFont().textWidth(menu.label, 378 menu.item_w = theme()->titleFont().textWidth(menu.label);
379 menu.label.size());
380 menu.item_w += (theme()->bevelWidth() * 2); 379 menu.item_w += (theme()->bevelWidth() * 2);
381 } else 380 } else
382 menu.item_w = 1; 381 menu.item_w = 1;
@@ -669,8 +668,7 @@ void Menu::redrawTitle(FbDrawable &drawable) {
669 668
670 const FbTk::Font &font = theme()->titleFont(); 669 const FbTk::Font &font = theme()->titleFont();
671 int dx = theme()->bevelWidth(); 670 int dx = theme()->bevelWidth();
672 size_t len = menu.label.size(); 671 unsigned int l = font.textWidth(menu.label) + theme()->bevelWidth()*2;
673 unsigned int l = font.textWidth(menu.label, len) + theme()->bevelWidth()*2;
674 672
675 switch (theme()->titleFontJustify()) { 673 switch (theme()->titleFontJustify()) {
676 case FbTk::RIGHT: 674 case FbTk::RIGHT:
@@ -686,10 +684,7 @@ void Menu::redrawTitle(FbDrawable &drawable) {
686 684
687 // difference between height based on font, and style-set height 685 // difference between height based on font, and style-set height
688 int height_offset = theme()->titleHeight() - (font.height() + 2*theme()->bevelWidth()); 686 int height_offset = theme()->titleHeight() - (font.height() + 2*theme()->bevelWidth());
689 font.drawText(drawable, // drawable 687 font.drawText(drawable, screenNumber(), theme()->titleTextGC().gc(), menu.label,
690 screenNumber(),
691 theme()->titleTextGC().gc(), // graphic context
692 menu.label, len, // text string with length
693 dx, font.ascent() + theme()->bevelWidth() + height_offset/2); // position 688 dx, font.ascent() + theme()->bevelWidth() + height_offset/2); // position
694} 689}
695 690
@@ -795,7 +790,7 @@ int Menu::drawItem(FbDrawable &drawable, unsigned int index,
795 return item_y; 790 return item_y;
796} 791}
797 792
798void Menu::setLabel(const FbString &labelstr) { 793void Menu::setLabel(const FbTk::BiDiString &labelstr) {
799 //make sure we don't send 0 to std::string 794 //make sure we don't send 0 to std::string
800 menu.label = labelstr; 795 menu.label = labelstr;
801 reconfigure(); 796 reconfigure();