| [ Return to Bugs & Features | Post Text | Post File | SVN ⇄ GIT | 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.5-feature |
Created By: | ajapted |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
|
#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); } } | |
|
#2 | matt 06:17 Jan 20, 2023 |
| I have put hours into this, and it does not work that easily. The menu code relies on every menu entry to have the same height, n matter if it has a divider or not. I proposed a solution that would also adapt to menu font height, but that was rejected from a few core devs. I know that this entry is a decade old and fell to the wayside, but at least it's nice to see that I am not the only one who dislikes the menu layout ;-) | |
|
#3 | AlbrechtS 09:42 Apr 16, 2024 |
| We're considering to create a new menu system, maybe based on FLTK widgets, or whatever, but this will be in the next minor release after 1.4.x.
Therefore I'm bumping this STR to "1.5-feature" so it will be considered when the new menu system will be designed. Hopefully. | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |