aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
AgeCommit message (Collapse)AuthorFilesLines
2016-07-01ignore font for empty title height calculationThomas Lübking1-5/+5
and align calculation on init and reconfigure As a result, if a menu has no label, the title height is determined only by menu.titleHeight (and the border sizes), not by the unused font.
2016-04-25Fix menus over a single column wideJuan Gonzalez Lopez1-3/+4
Fixes menus more than 1 column wide (such as the Placement menus for the Toolbar/Slit/Tabs) which stopped working with commit 3e4570b.
2015-05-01Make sure render new styles into full menuLajos Koszti1-0/+2
Different styles makes the menu width different. When the original menu width is bigger than the newly selected style's width, the rendering produces pretty strange effects: The old style's frame not cleared, so it was rendered and visible next to the new style edge. With this change, the menu width will be as wide as the widest menu item. Style switching still not perfect, because the height of a menu item is from the "first" selected menu, also font color are not updated.
2015-02-07MinorMathias Gumz1-2/+2
2015-02-07Fix cleaning exposed menu itemsMathias Gumz1-30/+24
2015-02-07Avoid signed/unsigned woes; minor cleanupMathias Gumz1-80/+64
2015-02-06Add uncommited #include "MenuSearch.hh"Mathias Gumz1-0/+1
Note to myself: less gitting at late hours.
2015-02-05Feature: different MenuSearch modesMathias Gumz1-133/+1
Fluxbox now supports three MenuSearch modes: * NoWhere - essentially "disabling" the menu search. * Somewhere - the search string matches somewhere. * ItemStart - the search string matches at the start of a menu item. The default value is "ItemStart", just in the good old times. As long as this feature is not configurable via the menu it would irritate users with distinct muscle memory who type without thinking OR checking the visual feedback: they would trigger items they did not intent to trigger after years of the old behavior. Once this feature get's an entry in the config menu the default value might change.
2015-01-28Compiler boyscouting: init orderMathias Gumz1-4/+4
2015-01-28Fix correctness of string searchMathias Gumz1-1/+1
The lookup for the skip value needs to be based upon the lowercase version of the current byte.
2015-01-28Feature: typeahead in menu matches text anywhereMathias Gumz1-185/+319
This commit implements a tweak to the typeahead feature already existent in fluxbox: If the user opens up a menu and starts typing, fluxbox tries to detect matching menu items and makes them available for quick selection. The typed pattern is now search also in the middle of the text. I opted to strip down the code quite a bit and remove complexity by throwing out FbTk::TypeAhead and FbTk::SearchResult because I do not see the need for a general solution when the only use case for such a feature is in fluxbox' menus. FbTk::ITypeAheadable shrunk down to 2 functions; the whole file might be combined with the code that implements FbTk::Menu::TypeSearch. FbTk::Menu::setIndex() and related code is also gone: the position of each menu item is defined by it's position in the items container. This reduces the mount of book keeping fluxbox has to do. Fewer moving parts is a good thing. It's possible that users start to complaint because they expect their typed pattern to match only at the beginning of the text OR that some demand other tweaks. We will see. This commit also fixes a regression introduced by 8387742c. The bug made the menu vanish.
2015-01-21Refactor: bundle related members togetherMathias Gumz1-183/+168
Also: try to avoid unsigned/signed problems in drawing code.
2015-01-16Fix uncommited change (see 8387742c8...)Mathias Gumz1-1/+1
2015-01-16Reduce number of allocations for menu creationMathias Gumz1-4/+18
Every time either the Slit menu or the Toolbar menu were added to the root menu, the whole root menu was (re)created from scratch. Now we create and remove only the menus needed. Side effect: the position of these menus is now at the end of the root menu and not somewhere in between. If users complaint, I' ll think about it.
2015-01-15Refactor menu code: be more explicit and compactMathias Gumz1-105/+107
This commit is a preparation step for some menu cleanup ahead. To make it easier to understand which types of MenuItems are added where and when, I converted the overloaded FbTk::Menu::insert() functions into explicit ones (Menu::insertSubmenu(), Menu::insertItem(), etc. ). This makes it possible to just grep for 'insertSubmenu()'. Side effect this commit: it trims down the very verbose creation of menu items in regards to how the labels are created. Minor: FbTk::Menu::shown and FbTk::Menu::s_focused are moved out of the class.
2013-05-26build-sys: use AC_USE_SYSTEM_EXTENSIONSSami Kerola1-5/+0
The earlier _GNU_SOURCE definitions possibly did not take effect everywhere where it was intended.
2013-05-26build-sys: include config.h to all files using automakeSami Kerola1-4/+0
Do not try to be too smart which compilations need config.h, as most of them will simply because of the config.h has information about system capabilities.
2012-08-28changed timing functions to use a monotonic increasing clockMathias Gumz1-2/+2
gettimeofday() is subject to be changed on daylight-saving or to ntp-related (think leap-seconds). even worse, it is subject to be changed BACK in time. this is hard to fix correctly (see commit 45726d3016e and bug #3560509). it is irrelevant for timers to know the nano-seconds since the epoch anyways.
2012-01-04Check .empty() instead of .size() == 0Ryan Pavlik1-2/+2
Found with cppcheck.
2012-01-04Pre-increment non-primitive types.Ryan Pavlik1-1/+1
Found with cppcheck: "Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code."
2011-05-10Remove the Observer dependency from FbTk::MenuPavel Labath1-1/+1
2011-05-10Convert FbTk::Theme::reconfigSig and friends to the new Signal systemPavel Labath1-2/+2
I removed the const versions of reconfigSig() in the process since FbTk::Signal has no const methods anyway.
2011-04-11Menu.cc: send debug output to cerr, make the output more sensiblePavel Labath1-9/+15
2011-02-25bugfix: submenus didn't hide if a delay was setMathias Gumz1-2/+2
use the FbTk::Timer API correctly, bug(s) introduced by 1f0adef4daa2da5b08ed7f41e7a0ce1e3f71e46f e68511794130388ab9668fdef0dcf48dbbf002fd
2011-01-18bug fix: make fluxbox work under nxserver, closes #2813828Mathias Gumz1-0/+50
nxserver-3.x creates a XExposeEvent for the unmapped FbTk::Menu(), which is not configured completely yet (hence unmapped). this causes a call to FbTk::Menu::clearItem() which then uses a value of 0 for m_rows_per_column to divide the current index which triggers a SIGFPE. it is still unclear, why nxserver-3.x creates the XExposeEvent for the unmapped (menu) window. doing nothing if the menu is unmapped 'fixes' the problem for now. many thanks to Lars Engels (bsd-geek.de) to assist me in debugging this issue.
2011-01-15removed useless include statementsMathias Gumz1-4/+0
'typeinfo' was needed for RTTI in isItemSelectable() (see last commit) 'algorithm' is already included some lines above
2011-01-15better use of API, no need for 'timeval' in MenuMathias Gumz1-4/+1
2011-01-15MenuItem::isEnabled() is sufficient to decide Menu::isItemSelectable()Mathias Gumz1-3/+1
MenuSeparator is never enabled since it returns always 'false' in its implementation of isEnabled(). no need to use RTTI imho.
2011-01-15small refactoring of FbTk/Menu codeMathias Gumz1-208/+214
* removed useless struct _menu * code deduplication via renderMenuPixmap() * improved documentation: - 'sublevel' actually means 'column' - 'persub' means 'row_per_column'
2010-09-09bugfix: initialize the Shape of a menu AFTER we created the window for the menuMathias Gumz1-1/+4
on startup a lot of 'Fluxbox: X Error: BadDrawable (invalid Pixmap ...)' occured. this was caused by using an empty 'Window' to create the shape.
2010-09-08introduced FbTk::BidiStringMathias Gumz1-9/+4
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
2009-09-23bugfix: 'HideMenus' command did not work if the user 'opened' an empty submenu.Mathias Gumz1-1/+1
'openeing' such an empty submenu lead to an already hidden menu referenced by the 'shown' pointer
2009-08-08allow navigating multi-column menus with left and right arrowsMark Tiefenbruck1-4/+21
2008-10-13merge menuDelay and menuDelayClose optionsMark Tiefenbruck1-2/+2
2008-10-05remove menu modesMark Tiefenbruck1-1/+1
2008-09-22fix active menu item when inserting or removing other itemsMark Tiefenbruck1-2/+7
2008-09-14Fixed a pixmap resource leak with selected pixmap in menus.Henrik Kinnunen1-3/+15
menu.hilite.selected.pixmap and menu.selected.pixmap was not deleted while switching between non-pixmap styles and pixmap styles.
2008-09-01highlight the nearest menu item when the current one is disabled, and add ↵Mark Tiefenbruck1-0/+15
separators to focus model menu
2008-08-19shift+enter wasn't sending right click if the menu item had a submenuMark Tiefenbruck1-3/+3
2008-08-16some cleanupMark Tiefenbruck1-1/+1
2008-05-30reset typeahead when adding/removing items in the menuMark Tiefenbruck1-0/+3
2008-04-21some fixes for gcc 3.4Thomas Orgis1-1/+1
2008-02-09fix highlighted menu item on mouse outMark Tiefenbruck1-2/+13
2008-01-11make FbTk::Command a template class, split parsing information out of ↵Mark Tiefenbruck1-3/+3
ObjectRegistry
2008-01-05update code to use ThemeProxyMark Tiefenbruck1-62/+62
2008-01-04remove old svn $Id$ tagsMark Tiefenbruck1-2/+0
2007-12-30remove some (hopefully) unneeded header includesMark Tiefenbruck1-0/+1
2007-12-28move shape handling from FbMenu to FbTk::MenuMark Tiefenbruck1-0/+4
2007-12-18fix torn menusMark Tiefenbruck1-11/+16
2007-12-18holding control will now keep the menu openMark Tiefenbruck1-2/+2