aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-23 01:00:02 (GMT)
committerfluxgen <fluxgen>2003-02-23 01:00:02 (GMT)
commitcd9634cf94dafeb64a240e7bfe3c0f2979d6ad56 (patch)
treeaf8c2788c8e43e86102fb6b1188bb7454cddadbc /src/FbTk
parentaa96020afa7295e95629157206738c01aa408096 (diff)
downloadfluxbox_paul-cd9634cf94dafeb64a240e7bfe3c0f2979d6ad56.zip
fluxbox_paul-cd9634cf94dafeb64a240e7bfe3c0f2979d6ad56.tar.bz2
fixed menu bullet and clearWindow
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 94561e3..e12b248 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.10 2003/02/16 15:03:22 fluxgen Exp $ 25// $Id: Menu.cc,v 1.11 2003/02/23 01:00:02 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -328,7 +328,6 @@ void Menu::update() {
328 if (tmp) 328 if (tmp)
329 m_image_ctrl.removeImage(tmp); 329 m_image_ctrl.removeImage(tmp);
330 330
331 menu.title.clear();
332 } 331 }
333 332
334 tmp = menu.frame_pixmap; 333 tmp = menu.frame_pixmap;
@@ -375,9 +374,7 @@ void Menu::update() {
375 374
376 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + menu.title.borderWidth()*2 : 0), 375 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + menu.title.borderWidth()*2 : 0),
377 menu.window.width(), menu.frame_h); 376 menu.window.width(), menu.frame_h);
378 menu.window.clear(); 377 clearWindow();
379 menu.title.clear();
380 menu.frame.clear();
381 378
382 if (title_vis && visible) 379 if (title_vis && visible)
383 redrawTitle(); 380 redrawTitle();
@@ -424,6 +421,11 @@ void Menu::hide() {
424 internal_hide(); 421 internal_hide();
425} 422}
426 423
424void Menu::clearWindow() {
425 menu.window.clear();
426 menu.title.clear();
427 menu.frame.clear();
428}
427 429
428void Menu::internal_hide() { 430void Menu::internal_hide() {
429 if (which_sub >= 0) { 431 if (which_sub >= 0) {
@@ -670,7 +672,8 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear,
670 if (dosel && item->isSelected() && 672 if (dosel && item->isSelected() &&
671 (menu.sel_pixmap != ParentRelative)) { 673 (menu.sel_pixmap != ParentRelative)) {
672 if (menu.sel_pixmap) { 674 if (menu.sel_pixmap) {
673 XCopyArea(m_display, highlight ? menu.frame_pixmap : menu.sel_pixmap, menu.frame.window(), 675 XCopyArea(m_display,
676 highlight ? menu.frame_pixmap : menu.sel_pixmap, menu.frame.window(),
674 m_theme.hiliteGC(), 0, 0, 677 m_theme.hiliteGC(), 0, 0,
675 half_w, half_w, sel_x, sel_y); 678 half_w, half_w, sel_x, sel_y);
676 } else { 679 } else {
@@ -692,11 +695,11 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear,
692 695
693 if (dosel && item->submenu()) { 696 if (dosel && item->submenu()) {
694 switch (m_theme.bullet()) { 697 switch (m_theme.bullet()) {
695 case SQUARE: 698 case MenuTheme::SQUARE:
696 XDrawRectangle(m_display, menu.frame.window(), gc, sel_x, sel_y, half_w, half_w); 699 XDrawRectangle(m_display, menu.frame.window(), gc, sel_x, sel_y, half_w, half_w);
697 break; 700 break;
698 701
699 case TRIANGLE: 702 case MenuTheme::TRIANGLE:
700 XPoint tri[3]; 703 XPoint tri[3];
701 704
702 if (m_theme.bulletPos() == FbTk::RIGHT) { 705 if (m_theme.bulletPos() == FbTk::RIGHT) {
@@ -719,7 +722,7 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear,
719 CoordModePrevious); 722 CoordModePrevious);
720 break; 723 break;
721 724
722 case DIAMOND: 725 case MenuTheme::DIAMOND:
723 XPoint dia[4]; 726 XPoint dia[4];
724 727
725 dia[0].x = sel_x + quarter_w - 3; 728 dia[0].x = sel_x + quarter_w - 3;
@@ -734,6 +737,8 @@ void Menu::drawItem(unsigned int index, bool highlight, bool clear,
734 XFillPolygon(m_display, menu.frame.window(), gc, dia, 4, Convex, 737 XFillPolygon(m_display, menu.frame.window(), gc, dia, 4, Convex,
735 CoordModePrevious); 738 CoordModePrevious);
736 break; 739 break;
740 default:
741 break;
737 } 742 }
738 } 743 }
739} 744}