[gnome-shell-sass] renameFolderMenu: Use a custom menu item inheriting from PopupBaseMenuItem



commit 34d65e70d8523aa250c5020c75e7fc95234b3c0c
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Sat Sep 14 03:03:15 2019 +0200

    renameFolderMenu: Use a custom menu item inheriting from PopupBaseMenuItem
    
    The RenameFolderMenu uses the internal box as a menu item, while PopupMenu
    expects to have PopupBaseMenuItem based children with a delegate set.
    
    Instead of using a custom menu with a customized box acting as menu
    item,just add a RenameFolderMenuItem that inherits from the parent,
    adjusting the features as we need them. In fact, the rename folder menu item
    doesn't need any label, padding or default styling so we can reuse
    PopupMenuBaseItem after we use our styling properties and we set the
    Ornament to HIDDEN.
    
    To get the proper style in place, define rename-folder-popup and
    rename-folder-popup-item to override the default popup-menu-item rule
    padding instead of using margins.
    
    Pass the menu item as menu's focusActor as this will key-focus it on pop-up,
    by overriding the key_focus_in() vfunc we can then delegate the focus
    handling to the entry's clutter-text.
    
    Also override the map() vfunc in order to update the entry's content before
    mapping the entry.
    
    Finally, use the item's activate method in order to tell the parent menu
    we're done with it and that the menu can be closed.
    
    As consequence we can also remove the menu's popup() method, and just use
    the default open().
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/720

 _common.scss | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/_common.scss b/_common.scss
index 852b505..9724a8f 100644
--- a/_common.scss
+++ b/_common.scss
@@ -610,13 +610,12 @@ StScrollBar {
     border-bottom-style: solid;
   }
 
-
 // Rename popup
-
-.rename-folder-popup-box {
-  spacing: 6px;
-  margin-left: 12px;
-  margin-right: 12px;
+.rename-folder-popup {
+  .rename-folder-popup-item {
+    spacing: 6px;
+    &:ltr, &:rtl { padding: 0, 12px; }
+  }
 }
 
 // Background menu


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]