From f1ce9c3f34b9354ff920dabdc3df534323d995f0 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 14 Jun 2004 16:09:48 +0000 Subject: minor fix for toggle item --- src/FbTk/Menu.cc | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 7869376..dad6159 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.67 2004/06/14 12:24:23 fluxgen Exp $ +// $Id: Menu.cc,v 1.68 2004/06/14 16:09:48 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -915,46 +915,52 @@ int Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_t } - + + if (render_trans) { + renderTransp(item_x, item_y, + width(), theme().itemHeight()); + } + //!! + //!! TODO: Move this out to MenuItem + //!! current problem: menu.sel_pixmap needs a image control instance + //!! to be generated :( + //!! if (item->isToggleItem() && item->isSelected()) { + Display *disp = FbTk::App::instance()->display(); if (theme().selectedPixmap().pixmap().drawable()) { + // enable clip mask - XSetClipMask(FbTk::App::instance()->display(), + XSetClipMask(disp, gc, theme().selectedPixmap().mask().drawable()); - XSetClipOrigin(FbTk::App::instance()->display(), + XSetClipOrigin(disp, gc, sel_x, item_y); // copy bullet pixmap to frame - m_frame_pm.copyArea(theme().selectedPixmap().pixmap().drawable(), - gc, - 0, 0, - sel_x, item_y, - theme().selectedPixmap().width(), - theme().selectedPixmap().height()); + m_real_frame_pm.copyArea(theme().selectedPixmap().pixmap().drawable(), + gc, + 0, 0, + sel_x, item_y, + theme().selectedPixmap().width(), + theme().selectedPixmap().height()); // disable clip mask - XSetClipMask(FbTk::App::instance()->display(), + XSetClipMask(disp, gc, None); } else { if (menu.sel_pixmap) { - m_frame_pm.copyArea(highlight ? menu.frame_pixmap : menu.sel_pixmap, - theme().hiliteGC().gc(), - 0, 0, - sel_x, sel_y, - half_w, half_w); + m_real_frame_pm.copyArea(highlight ? menu.frame_pixmap : menu.sel_pixmap, + theme().hiliteGC().gc(), + 0, 0, + sel_x, sel_y, + half_w, half_w); } else { - m_frame_pm.fillRectangle(theme().hiliteGC().gc(), - sel_x, sel_y, half_w, half_w); + m_real_frame_pm.fillRectangle(theme().hiliteGC().gc(), + sel_x, sel_y, half_w, half_w); } } } - if (render_trans) { - renderTransp(item_x, item_y, - width(), theme().itemHeight()); - } - item->draw(m_real_frame_pm, theme(), highlight, item_x, item_y, menu.item_w, theme().itemHeight()); -- cgit v0.11.2