… | |
… | |
958 | { |
958 | { |
959 | ActiveMenu->win = XCreateSimpleWindow (display->display, TermWin.vt, |
959 | ActiveMenu->win = XCreateSimpleWindow (display->display, TermWin.vt, |
960 | x, ActiveMenu->y, |
960 | x, ActiveMenu->y, |
961 | ActiveMenu->w, ActiveMenu->h, |
961 | ActiveMenu->w, ActiveMenu->h, |
962 | 0, |
962 | 0, |
963 | PixColors[Color_fg], |
963 | pix_colors[Color_fg], |
964 | PixColors[Color_scroll]); |
964 | pix_colors[Color_scroll]); |
965 | ActiveMenu->drawable = new rxvt_drawable (display, ActiveMenu->win); |
965 | ActiveMenu->drawable = new rxvt_drawable (display, ActiveMenu->win); |
966 | XMapWindow (display->display, ActiveMenu->win); |
966 | XMapWindow (display->display, ActiveMenu->win); |
967 | } |
967 | } |
968 | |
968 | |
969 | rxvt_Draw_Shadow (display->display, ActiveMenu->win, |
969 | rxvt_Draw_Shadow (display->display, ActiveMenu->win, |
… | |
… | |
1035 | } |
1035 | } |
1036 | else if (item->name2 && !strcmp (name, item->name2)) |
1036 | else if (item->name2 && !strcmp (name, item->name2)) |
1037 | name = NULL; |
1037 | name = NULL; |
1038 | |
1038 | |
1039 | if (len && name) |
1039 | if (len && name) |
1040 | draw_string (*ActiveMenu->drawable, gc, TermWin.fontset, |
1040 | draw_string (*ActiveMenu->drawable, gc, TermWin.fontset[0], |
1041 | xoff, 2 * SHADOW + y, name, len); |
1041 | xoff, 2 * SHADOW + y, name, len); |
1042 | |
1042 | |
1043 | len = item->len2; |
1043 | len = item->len2; |
1044 | name = item->name2; |
1044 | name = item->name2; |
1045 | |
1045 | |
1046 | if (len && name) |
1046 | if (len && name) |
1047 | draw_string (*ActiveMenu->drawable, gc, TermWin.fontset, |
1047 | draw_string (*ActiveMenu->drawable, gc, TermWin.fontset[0], |
1048 | ActiveMenu->w - (xoff + Width2Pixel (xright)), 2 * SHADOW + y, name, len); |
1048 | ActiveMenu->w - (xoff + Width2Pixel (xright)), 2 * SHADOW + y, name, len); |
1049 | |
1049 | |
1050 | h = HEIGHT_TEXT + 2 * SHADOW; |
1050 | h = HEIGHT_TEXT + 2 * SHADOW; |
1051 | } |
1051 | } |
1052 | y += h; |
1052 | y += h; |
… | |
… | |
2034 | if (menubarGC == None) |
2034 | if (menubarGC == None) |
2035 | { |
2035 | { |
2036 | /* Create the graphics context */ |
2036 | /* Create the graphics context */ |
2037 | XGCValues gcvalue; |
2037 | XGCValues gcvalue; |
2038 | |
2038 | |
2039 | gcvalue.foreground = (display->depth <= 2 ? PixColors[Color_fg] |
2039 | gcvalue.foreground = (display->depth <= 2 ? pix_colors[Color_fg] |
2040 | : PixColors[Color_Black]); |
2040 | : pix_colors[Color_Black]); |
2041 | menubarGC = XCreateGC (display->display, menuBar.win, |
2041 | menubarGC = XCreateGC (display->display, menuBar.win, |
2042 | GCForeground, &gcvalue); |
2042 | GCForeground, &gcvalue); |
2043 | |
2043 | |
2044 | } |
2044 | } |
2045 | /* make sure the font is correct */ |
2045 | /* make sure the font is correct */ |
… | |
… | |
2062 | |
2062 | |
2063 | if (x >= TermWin.ncol) |
2063 | if (x >= TermWin.ncol) |
2064 | len = (TermWin.ncol - (menu->x + HSPACE)); |
2064 | len = (TermWin.ncol - (menu->x + HSPACE)); |
2065 | |
2065 | |
2066 | drawbox_menubar (menu->x, len, +1); |
2066 | drawbox_menubar (menu->x, len, +1); |
2067 | draw_string (*menuBar.drawable, menubarGC, TermWin.fontset, |
2067 | draw_string (*menuBar.drawable, menubarGC, TermWin.fontset[0], |
2068 | (Width2Pixel (menu->x) + Width2Pixel (HSPACE) / 2), |
2068 | (Width2Pixel (menu->x) + Width2Pixel (HSPACE) / 2), |
2069 | SHADOW, menu->name, len); |
2069 | SHADOW, menu->name, len); |
2070 | |
2070 | |
2071 | if (x >= TermWin.ncol) |
2071 | if (x >= TermWin.ncol) |
2072 | break; |
2072 | break; |
… | |
… | |
2125 | } |
2125 | } |
2126 | title[len] = '\0'; |
2126 | title[len] = '\0'; |
2127 | |
2127 | |
2128 | ncol -= (x + len + HSPACE); |
2128 | ncol -= (x + len + HSPACE); |
2129 | if (len > 0 && ncol >= 0) |
2129 | if (len > 0 && ncol >= 0) |
2130 | draw_string (*menuBar.drawable, menubarGC, TermWin.fontset, |
2130 | draw_string (*menuBar.drawable, menubarGC, TermWin.fontset[0], |
2131 | Width2Pixel (x) + Width2Pixel (ncol + HSPACE) / 2, |
2131 | Width2Pixel (x) + Width2Pixel (ncol + HSPACE) / 2, |
2132 | SHADOW, title, len); |
2132 | SHADOW, title, len); |
2133 | } |
2133 | } |
2134 | } |
2134 | } |
2135 | |
2135 | |