[gnome-shell/wip/carlosg/osk-lang-menu-dots] keyboard: Set ornament on selected item in OSK languages popup menu




commit df5804e9a5953526a9bd78d4bc393a7b18661bf2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jun 27 13:55:34 2022 +0200

    keyboard: Set ornament on selected item in OSK languages popup menu
    
    There is no hint about the currently selected language, but this exists
    in the mockups. Add a dot ornament on the language that is currently
    selected at the time of showing the OSK languages popup.
    
    Since this popup is created from scratch every time it is shown, and
    the popup is torn down with the OSK during replacement. This also
    works for further times the languages popup is shown.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5598

 js/ui/keyboard.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 499bc28a90..c819265eb2 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -244,6 +244,9 @@ var LanguageSelectionPopup = class extends PopupMenu.PopupMenu {
                 inputSourceManager.activateInputSource(is, true);
             });
             item.can_focus = false;
+            item.setOrnament(is === inputSourceManager.currentSource
+                ? PopupMenu.Ornament.DOT
+                : PopupMenu.Ornament.NONE);
         }
 
         this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());


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