Tags: AntumDeluge/cinnamon
Tags
Menu applet: Various improvements (linuxmint#8314) * menu applet: button actor optimizations This replaces most usage of PopupBaseMenuItem with a greatly simplified new class SimpleMenuItem that doesn't do any custom allocation, doesn't have signals, and contains commonly used code on the base prototype. Getting rid of the custom allocate speeds up relayouts significantly, and consolidating commonly used code helps make the inheriting classes simpler and reduces code duplication. Also various cleanups including: - all buttons in the ApplicationsBox now have a name and description property so the enter and leave events can be simpler. - misleading "appsMenuButton" properties renamed to "applet" as they point to the CinnamonMenuApplet() object. Some of these cleanups should help a lot with getting rid of the excess amount of duplicated enter and leave handlers, and classes for buttons that only differ by icon and name. * menu applet: remove NoRecentDocsButton class With how little this class actually does, we can make it a basic button instead. * menu applet: more code reduction Remove more code that can be done on the base class through the constructor, remove RecentClearButton class. * menu applet: combine all enter and leave events Instead of connecting and having these around everywhere, just have buttons that are reactive connect their own events and call the generic handler on the applet. In addition, when we generate "fake" events, we now just call the handler directly instead of using a signal at all. * menu applet: use a single context menu item instead of creating one per application button. This reduces the number of actors in the applicationsBox from 250 to 140 at startup on my system. * menu applet: a lot of fixing and cleanups fixes for previous commits: -fix recent clear button not being added -fix no recent docs button not being added -fix refreshing apps breaking places/recent categories -fix uninstall and run on nvidia gpu menu items -fix adding panel launcher item -fix vectorBox width/height values new changes: -universally apply MAX_BUTTON_WIDTH to menu items instead of just labels. this works around weird max-widths like 10px on 'menu-application-button' currently in linux mint theme. -continues rework of applications box context menus: adds context menu handling into the base menu item class, and the applet will pass a menu to button.populateMenu() if button.withMenu is true. -remove 1px offset from vectorbox. this seems to have the opposite effect now that the actors have been reworked, so remove it again. * menu applet: more fixes/cleanups Thanks to @Odyseus for pointing these out. * menu applet: simplify scrollToButton() for first item if we're scrolling to the first item we can avoid looking up the first button and then having this align it by just resetting the scroll to zero when no button is passed. * menu applet: restore context menu behavior when the menu is already open and is initiated for a different source. This looks glitchier than forcing a close animation and second click before opening on a different source, but is faster.
Menu applet: Various improvements (linuxmint#8314) * menu applet: button actor optimizations This replaces most usage of PopupBaseMenuItem with a greatly simplified new class SimpleMenuItem that doesn't do any custom allocation, doesn't have signals, and contains commonly used code on the base prototype. Getting rid of the custom allocate speeds up relayouts significantly, and consolidating commonly used code helps make the inheriting classes simpler and reduces code duplication. Also various cleanups including: - all buttons in the ApplicationsBox now have a name and description property so the enter and leave events can be simpler. - misleading "appsMenuButton" properties renamed to "applet" as they point to the CinnamonMenuApplet() object. Some of these cleanups should help a lot with getting rid of the excess amount of duplicated enter and leave handlers, and classes for buttons that only differ by icon and name. * menu applet: remove NoRecentDocsButton class With how little this class actually does, we can make it a basic button instead. * menu applet: more code reduction Remove more code that can be done on the base class through the constructor, remove RecentClearButton class. * menu applet: combine all enter and leave events Instead of connecting and having these around everywhere, just have buttons that are reactive connect their own events and call the generic handler on the applet. In addition, when we generate "fake" events, we now just call the handler directly instead of using a signal at all. * menu applet: use a single context menu item instead of creating one per application button. This reduces the number of actors in the applicationsBox from 250 to 140 at startup on my system. * menu applet: a lot of fixing and cleanups fixes for previous commits: -fix recent clear button not being added -fix no recent docs button not being added -fix refreshing apps breaking places/recent categories -fix uninstall and run on nvidia gpu menu items -fix adding panel launcher item -fix vectorBox width/height values new changes: -universally apply MAX_BUTTON_WIDTH to menu items instead of just labels. this works around weird max-widths like 10px on 'menu-application-button' currently in linux mint theme. -continues rework of applications box context menus: adds context menu handling into the base menu item class, and the applet will pass a menu to button.populateMenu() if button.withMenu is true. -remove 1px offset from vectorbox. this seems to have the opposite effect now that the actors have been reworked, so remove it again. * menu applet: more fixes/cleanups Thanks to @Odyseus for pointing these out. * menu applet: simplify scrollToButton() for first item if we're scrolling to the first item we can avoid looking up the first button and then having this align it by just resetting the scroll to zero when no button is passed. * menu applet: restore context menu behavior when the menu is already open and is initiated for a different source. This looks glitchier than forcing a close animation and second click before opening on a different source, but is faster.
PreviousNext