diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2010-09-05 08:49:05 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2010-09-05 08:49:05 (GMT) |
commit | 8feb0b8c83559e44bc6b2fc418c9cf7b6b46a03c (patch) | |
tree | f6a2ba871afcf5dd16ca9ea2754938cc66c1310a /src/FbTk/MenuItem.cc | |
parent | 83656fc0e817c2a00a315176e651881cdfc804eb (diff) | |
download | fluxbox-8feb0b8c83559e44bc6b2fc418c9cf7b6b46a03c.zip fluxbox-8feb0b8c83559e44bc6b2fc418c9cf7b6b46a03c.tar.bz2 |
avoid constructing new strings implicit
Diffstat (limited to 'src/FbTk/MenuItem.cc')
-rw-r--r-- | src/FbTk/MenuItem.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc index dcd7dd7..f995666 100644 --- a/src/FbTk/MenuItem.cc +++ b/src/FbTk/MenuItem.cc | |||
@@ -54,12 +54,12 @@ void MenuItem::drawLine(FbDrawable &draw, | |||
54 | int bottom = height - bevelW - 1; | 54 | int bottom = height - bevelW - 1; |
55 | 55 | ||
56 | text_y += bottom > underline_height ? underline_height : bottom; | 56 | text_y += bottom > underline_height ? underline_height : bottom; |
57 | int text_w = theme->frameFont().textWidth(m_label.c_str(), m_label.size()); | 57 | int text_w = theme->frameFont().textWidth(m_label, m_label.size()); |
58 | 58 | ||
59 | // width of the searchstring | 59 | // width of the searchstring |
60 | size = size > m_label.length() ? m_label.length() : size; | 60 | size = size > m_label.length() ? m_label.length() : size; |
61 | std::string search_string = m_label.substr(0,size); | 61 | std::string search_string = m_label.substr(0,size); |
62 | int search_string_w = theme->frameFont().textWidth(search_string.c_str(), size); | 62 | int search_string_w = theme->frameFont().textWidth(search_string, size); |
63 | 63 | ||
64 | // pay attention to the text justification | 64 | // pay attention to the text justification |
65 | switch(theme->frameFontJustify()) { | 65 | switch(theme->frameFontJustify()) { |
@@ -157,7 +157,7 @@ void MenuItem::draw(FbDrawable &draw, | |||
157 | // | 157 | // |
158 | int text_y = y, text_x = x; | 158 | int text_y = y, text_x = x; |
159 | 159 | ||
160 | int text_w = theme->frameFont().textWidth(label().c_str(), label().size()); | 160 | int text_w = theme->frameFont().textWidth(label(), label().size()); |
161 | 161 | ||
162 | int height_offset = theme->itemHeight() - (theme->frameFont().height() + 2*theme->bevelWidth()); | 162 | int height_offset = theme->itemHeight() - (theme->frameFont().height() + 2*theme->bevelWidth()); |
163 | text_y = y + theme->bevelWidth() + theme->frameFont().ascent() + height_offset/2; | 163 | text_y = y + theme->bevelWidth() + theme->frameFont().ascent() + height_offset/2; |