STR #2896

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | Post Text | Post File | Prev | Next ]

STR #2896

Application:FLTK Library
Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Better looking menu dividers
Version:1.3-feature
Created By:ajapted
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
 
#1 ajapted
03:13 Dec 04, 2012
better_menu.png
18k
 
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
 
#1 ajapted
03:13 Dec 04, 2012
The following patch supports making nicer looking menu
dividers, as shown by the attached image.

It does not affect the API or ABI of FLTK, and is unlikely
to affect existing programs (or if it does, harmlessly).
The patch merely vertically centers the dividing line in a menu
when the text is an empty string ("") and FL_MENU_INACTIVE is set.

Cheers,
-- Andrew


=== modified file 'src/Fl_Menu.cxx'
--- src/Fl_Menu.cxx 2012-12-04 10:41:23 +0000
+++ src/Fl_Menu.cxx 2012-12-04 10:49:26 +0000
@@ -467,10 +467,14 @@
   }
 
   if (m->flags & FL_MENU_DIVIDER) {
+    int ofs = hh;
+    // center the dividing line if inactive and text == ""
+    if ((m->flags & FL_MENU_INACTIVE) && m->text && !m->text[0])
+      ofs = hh/2;
     fl_color(FL_DARK3);
-    fl_xyline(BW-1, yy+hh+(LEADING-2)/2, W-2*BW+2);
+    fl_xyline(BW-1, yy+ofs+(LEADING-2)/2, W-2*BW+2);
     fl_color(FL_LIGHT3);
-    fl_xyline(BW-1, yy+hh+((LEADING-2)/2+1), W-2*BW+2);
+    fl_xyline(BW-1, yy+ofs+((LEADING-2)/2+1), W-2*BW+2);
   }
 }
 
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.