all repos — fluxbox @ 0fbb0bfe8be781001a8e8ab50523dc923f6af665

custom fork of the fluxbox windowmanager

cosmetic
akir akir
commit

0fbb0bfe8be781001a8e8ab50523dc923f6af665

parent

b12ce691bc59fcb491e63f43040804d471d712c9

1 files changed, 5 insertions(+), 6 deletions(-)

jump to
M src/FbTk/MenuItem.ccsrc/FbTk/MenuItem.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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::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) {