summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
AgeCommit message (Collapse)Author
2024-12-10Fix Fl_Menu_Item::measure width calculation (#1164)Matthias Melcher
Fl_Menu_Item::measure did not take the gap between a possible checkbox and the label text into consideration.
2024-12-09Fix inconsistencies with Tab/Backspace handling in menus (#1157)dannye
2024-12-09Fixes triggering callback for inactive menu items (#1159)Matthias Melcher
The old code would trigger a callback when hovering the mouse of an inactive item and pressing Return.
2024-12-09 Fix: Hang/Infinite loop on submenu with all inactive/invisible items (#1158)ManoloFLTK
2024-12-09Fix: Mouse hover+Enter key selects inactive menu items (#1159)ManoloFLTK
2024-10-06Submenus with no callback enter their submenu instead of closing the whole ↵dannye
menu (#1043) Thanks for those nice changes.
2024-09-04Fixes menu scrolling for secondary screens (#1060)Matthias Melcher
- huge menus would scroll down when the mouse pointer hit position 0, but for some secondary screens, the top edge is not at y==0, so now we check for a range a the top border of the working space of the screen showing the menu.
2024-09-04Fixes menubar glitch when mouse is at y==0 (#1060)Matthias Melcher
2024-08-27Adding horiizonatl and vertical label marginMatthias Melcher
- sizeof(Fl_Widget) not increased - label positions can be adjusted - try it out in test/label app - full support in FLUD
2024-08-14Adding Fl_Widget::label_image_spacing() (#1039)Matthias Melcher
- May need a better method name. - This makes the gap between the image in a label and the label text user settable. - Can be tested using test/label app
2024-08-04Fix testing of multi-label alt shortcuts (#974)dannye
* find_shortcut(): fix testing of multi-label alt shortcuts * Use static function instead of macro
2024-06-27Navigation in menubar: wrap around when using arrow past end or start of ↵ManoloFLTK
menubar. Slight behavior change of Fl_Menu_Bar relatively to 1.3: left and right arrow keys when pressed in the first (resp. last) (sub)menu of a menubar wrap to the menu at the other end of the bar. Also, left and right arrow keys open the previous (resp. next) menu of the bar when pressed in a submenu. Rationale: macOS, gnome and Windows apps equipped with a menubar do that.
2024-06-25Navigation in menubar: wrap around when using arrow past end or start of ↵ManoloFLTK
menubar. Fix some border cases.
2024-06-24Navigation in menubar: wrap around when using arrow past end or start of ↵ManoloFLTK
menubar. See "Menu navigation in FLTK is different from Ubuntu X11 navigation" in fltk.general. Menubar wrapping is what macOS and gnome applications do.
2024-05-24Control screen used by Fl_Menu_Bar::play_menu() - cont'dManoloFLTK
2024-05-23Control screen used by Fl_Menu_Bar::play_menu()ManoloFLTK
2024-05-09Remove unused variables, fix compiler warningsAlbrecht Schlosser
2024-05-09Optimize "arrow" drawing and centeringAlbrecht Schlosser
- center (sub)menu arrow as good as possible - adjust arrow sizes in Fl_Counter widget - refactor "oxy" arrow drawing and centering in widgets
2024-05-08Have menu items drawn with same colors in all platforms (#969)ManoloFLTK
Also, remove this text from the doc of Fl_Menu_::down_box() "If this is FL_NO_BOX then it acts like FL_THIN_UP_BOX and selection_color() acts like FL_WHITE, for back compatibility." that was true only for the Windows platform and that required selection_color to be replaced by white for menu items which is not what FLTK 1.4 expects. The new state of menu item drawings is as follows : - all platforms draw menu items with the same symbolic colors - selected items and menu titles are drawn with the selection color as background color - menu items are drawn by default with no box but can be given one by Fl_Menu_::down_box(Fl_Boxtype) - the text of selected items is drawn with the menu's color unless fl_contrast() finds it does not make enough contrast with the background (selection color) and substitutes it with a more adapted color - the Windows platform uses a visibly different hue for its default selection color from what other platforms use
2024-05-07Limit (sub)menu arrow size as discussed in fltk.generalAlbrecht Schlosser
... in thread: "FLTK 1.4 Menu Bar Style", started on May 6, 2024 This is about the little triangle (or similar) pointing right when a submenu exists in a menu. The arrow form differs per scheme.
2024-02-05Fl_Window_Driver::set_popup_window(), ↵ManoloFLTK
Fl_Screen_Driver::screen_boundaries_known() Fl_Window_Driver::set_popup_window() is to be used to declare a window should be positioned relatively to a previously mapped other window. This allows a platform to process such windows differently from other windows if needed. Menu and tooltip windows are so declared. A call to Fl_Window_Driver::set_popup_window() also allows to distinguish a real menu or tooltip window from a window marked by Fl_Window::set_menu_window() or by Fl_Window::set_tooltip_window() but that's not a real menu or tooltip. New member function bool Fl_Screen_Driver::screen_boundaries_known() returns true by default. A platform where the position of windows inside a screen is hidden (e.g., Wayland) returns false. This allows FLTK to refrain from trying to make sure a computed position is inside a screen.
2024-01-22Fixes mouse pointer visibility for popups (#890)Matthias Melcher
2024-01-22Add popup_window() virtual member functions to Fl_Window_DriverManoloFLTK
2024-01-21Fix "Wayland: crash with set_menu_window()" - cont'd (#892)ManoloFLTK
2024-01-21Fix "Wayland: crash with set_menu_window()" (#892)ManoloFLTK
Fixes also a similar crash occuring after use of set_tooltip_window(). Two bool member variables are added to class Fl_Window_Driver to indicate true FLTK menu windows (i.e., created by Fl_Menu_Item::pulldown()) and true FLTK tooltip windows (i.e., Fl_Tooltip).
2023-12-02Improve contrast of check marks and radio buttons (#443)Albrecht Schlosser
- add fl_draw_radio(...) to standardize radio button drawing - src/Fl_Light_Button.cxx: use fl_contrast() to determine color of radio button and check (light) button check marks, and use new fl_draw_radio() method - src/Fl_Menu.cxx: same as src/Fl_Light_Button.cxx and use fl_draw_check() instead of "manually" drawing the check mark (forgotten in an earlier update)
2023-10-13#748: Adds option to choose menu window boxtypeMatthias Melcher
...independently from the menu button or menu bar boxtype
2023-10-11Synchronize all arrow colors and inactive drawing (#791)Matthias Melcher
2023-05-15Fix handling of tall menu windows with the KDE Wayland compositorManoloFLTK
Unfortunately (sigh), the KDE Wayland compositor does not seem to support correctly, that is, as described by the Wayland protocol, popup windows that are taller than the display : there is no means to make it draw such popup so that part of it is above the screen top, whereas the 3 other tested compositors (Mutter, Weston, Sway) don't have this problem. This commit implements a new approach to draw tall menu windows, and uses it only with the KDE compositor : instead of asking the compositor to slide the menu window up, the menu window remains at a fixed position and the graphics inside the window is slided up. This requires to add a member variable, int offset_y, to class menuwindow, that gets used only for the Wayland platform and that contains the vertical offset by which graphics to the menu window is moved, expressed in FLTK units. An accessor to the address of this member variable is added to class Fl_Window_Driver.
2023-05-02 Wayland: problem with menus on secondary monitor - cont'd (#724)ManoloFLTK
2023-02-10Don't for a box type for pulldowns (#675)Matthias Melcher
2023-01-20STR 3461: fix menu linespacingMatthias Melcher
2023-01-12Remove repeated code in classes menuwindow and menutitleManoloFLTK
2023-01-12Simpler implementation of Fl_Window_Driver::scroll_to_selected_item()ManoloFLTK
2023-01-12Wayland menus: remove useless Fl_Window_Driver::extra_menutitle()ManoloFLTK
2023-01-11Wayland: Further improved implementation of menu windowsManoloFLTK
Tall menus now work also as single popup window and show the correct selected item. Groups of popups with a menutitle, an associated menuwindow, and possibly submenus are constructed around the menuwindow, the menutitle being a child popup of the menuwindow. This positions these popup groups better than before.
2023-01-08Wayland: Improved implementation of menu windowsManoloFLTK
2023-01-05Refactor drawing small circles: add fl_draw_circle()Albrecht Schlosser
This method can be used to draw small circles as part of the GUI. It is independent of the current scheme. Very small circles are approximated by drawing several rectangles.
2022-12-30Use `FL_OVERRIDE` for all overridden virtual methods (#611)Matthias Melcher
FL_OVERRIDE is defined as `override` for C++11 and higher FL_OVERRIDE is defined as `override` for VisualC 2015 and newer Don't interfere with Fl_Widget::override()
2022-12-27Wayland: Dropdown menu moves when navigated (#613) - cont'dManoloFLTK
Menu windows containing sub-menus are now processed differently.
2022-11-25Add "Oxy" scheme (STR 2675, STR 3477)Albrecht Schlosser
This commit is similar to the patch given in STR 3477, oxy_v5.diff: https://www.fltk.org/strfiles/3477/oxy_v5.diff ... with modifications, and updated to current FLTK code.
2022-11-23Update remaining "arrow drawing" in menusAlbrecht Schlosser
Use the new standard arrow drawing methods (whose style depends on the active scheme) for "arrows" used in Fl_Menu and Fl_Menu_Button. To do: maybe we need some "fine tuning" of arrow sizes in some of the modified widgets using the new "arrow drawing" methods.
2022-11-23Keep indicator that menubar is still active (#551)Matthias Melcher
2022-11-22Refactor and simplify "arrow drawing" in widgetsAlbrecht Schlosser
"Arrows" in widgets are those GUI elements mostly represented by triangles pointing in a particular direction as in scrollbars, choice widgets, some menus, valuators and Fl_Counter widgets. The code has been simplified and standardized such that all these GUI elements are drawn identically per FLTK scheme. Widget authors no longer need to write code to calculate arrow sizes and draw polygons etc. Different schemes can and do implement different drawing functions. Todo: see comments "FIXME_ARROW" in src/Fl_Menu_Button.cxx and src/Fl_Menu.cxx
2022-11-07Create class Fl_Unix_Screen_Driver used by X11 and Wayland platformsManoloFLTK
2022-09-27Use PR #507 by @ggarra13 to fix issue #85.ManoloFLTK
2022-03-08Fix doxygen warningAlbrecht Schlosser
2022-03-05Fix MSVC compiler warningAlbrecht Schlosser
warning C4099: 'Fl_Menu_Item': type name first seen using 'struct' now seen using 'class'
2022-03-04Add the Wayland platform to FLTK 1.4ManoloFLTK
2022-01-26Fix for #381, `backward` function crashMatthias Melcher
when no menu item is selected.