From d948abb81b104dd1562015c4dfa0d080480b6ce2 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 11 Mar 2007 19:07:42 +0000 Subject: fixed parentrelative menu highlight bug --- ChangeLog | 3 +++ src/FbTk/Menu.cc | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6125eb..720d148 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*07/03/11: + * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet) + FbTk/Menu.cc *07/03/10: * Autogrouped windows weren't getting added to the workspace menu (Mark) Screen.cc diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index a2326c4..1162b53 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -1214,19 +1214,19 @@ void Menu::highlightItem(int index) { FbPixmap buffer = FbPixmap(menu.frame, item_w, item_h, menu.frame.depth()); - if (menu.hilite_pixmap != ParentRelative) { - if (menu.hilite_pixmap) { - buffer.copyArea(menu.hilite_pixmap, - theme().hiliteGC().gc(), 0, 0, - 0, 0, - item_w, item_h); - } else { - buffer.fillRectangle(theme().hiliteGC().gc(), - 0, 0, item_w, item_h); - } - menu.frame.updateTransparent(item_x, item_y, item_w, item_h, buffer.drawable(), true); + bool parent_rel = menu.hilite_pixmap == ParentRelative; + Pixmap pixmap = parent_rel ? menu.frame_pixmap : menu.hilite_pixmap; + int pixmap_x = parent_rel ? item_x : 0, pixmap_y = parent_rel ? item_y : 0; + if (pixmap) { + buffer.copyArea(pixmap, + theme().hiliteGC().gc(), pixmap_x, pixmap_y, + 0, 0, + item_w, item_h); + } else { + buffer.fillRectangle(theme().hiliteGC().gc(), + 0, 0, item_w, item_h); } - + menu.frame.updateTransparent(item_x, item_y, item_w, item_h, buffer.drawable(), true); drawItem(buffer, index, true, true); -- cgit v0.11.2