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.cc52
1 files 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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.67 2004/06/14 12:24:23 fluxgen Exp $ 25// $Id: Menu.cc,v 1.68 2004/06/14 16:09:48 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -915,46 +915,52 @@ int Menu::drawItem(unsigned int index, bool highlight, bool clear, bool render_t
915 915
916 } 916 }
917 917
918 918
919 if (render_trans) {
920 renderTransp(item_x, item_y,
921 width(), theme().itemHeight());
922 }
923 //!!
924 //!! TODO: Move this out to MenuItem
925 //!! current problem: menu.sel_pixmap needs a image control instance
926 //!! to be generated :(
927 //!!
919 if (item->isToggleItem() && item->isSelected()) { 928 if (item->isToggleItem() && item->isSelected()) {
929 Display *disp = FbTk::App::instance()->display();
920 if (theme().selectedPixmap().pixmap().drawable()) { 930 if (theme().selectedPixmap().pixmap().drawable()) {
931
921 // enable clip mask 932 // enable clip mask
922 XSetClipMask(FbTk::App::instance()->display(), 933 XSetClipMask(disp,
923 gc, 934 gc,
924 theme().selectedPixmap().mask().drawable()); 935 theme().selectedPixmap().mask().drawable());
925 XSetClipOrigin(FbTk::App::instance()->display(), 936 XSetClipOrigin(disp,
926 gc, sel_x, item_y); 937 gc, sel_x, item_y);
927 // copy bullet pixmap to frame 938 // copy bullet pixmap to frame
928 m_frame_pm.copyArea(theme().selectedPixmap().pixmap().drawable(), 939 m_real_frame_pm.copyArea(theme().selectedPixmap().pixmap().drawable(),
929 gc, 940 gc,
930 0, 0, 941 0, 0,
931 sel_x, item_y, 942 sel_x, item_y,
932 theme().selectedPixmap().width(), 943 theme().selectedPixmap().width(),
933 theme().selectedPixmap().height()); 944 theme().selectedPixmap().height());
934 // disable clip mask 945 // disable clip mask
935 XSetClipMask(FbTk::App::instance()->display(), 946 XSetClipMask(disp,
936 gc, 947 gc,
937 None); 948 None);
938 } else { 949 } else {
939 if (menu.sel_pixmap) { 950 if (menu.sel_pixmap) {
940 m_frame_pm.copyArea(highlight ? menu.frame_pixmap : menu.sel_pixmap, 951 m_real_frame_pm.copyArea(highlight ? menu.frame_pixmap : menu.sel_pixmap,
941 theme().hiliteGC().gc(), 952 theme().hiliteGC().gc(),
942 0, 0, 953 0, 0,
943 sel_x, sel_y, 954 sel_x, sel_y,
944 half_w, half_w); 955 half_w, half_w);
945 } else { 956 } else {
946 m_frame_pm.fillRectangle(theme().hiliteGC().gc(), 957 m_real_frame_pm.fillRectangle(theme().hiliteGC().gc(),
947 sel_x, sel_y, half_w, half_w); 958 sel_x, sel_y, half_w, half_w);
948 } 959 }
949 } 960 }
950 961
951 } 962 }
952 963
953 if (render_trans) {
954 renderTransp(item_x, item_y,
955 width(), theme().itemHeight());
956 }
957
958 item->draw(m_real_frame_pm, theme(), highlight, 964 item->draw(m_real_frame_pm, theme(), highlight,
959 item_x, item_y, 965 item_x, item_y,
960 menu.item_w, theme().itemHeight()); 966 menu.item_w, theme().itemHeight());