1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
From 891c2ebcb8f1b001e8bd366d8fc6df70ad4e463a Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Mon, 21 Jul 2025 08:45:00 +0200
Subject: [PATCH 6/7] src/service.c: Move 'Show Current Layout' menuitem closer
HWK settings (i.e. drop one menu separator).
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
src/service.c | 45 +++++++++++----------------------------------
1 file changed, 11 insertions(+), 34 deletions(-)
diff --git a/src/service.c b/src/service.c
index ee37ef96..54d2327f 100644
--- a/src/service.c
+++ b/src/service.c
@@ -43,8 +43,7 @@ enum
{
SECTION_HEADER = (1 << 0),
SECTION_LAYOUTS = (1 << 1),
- SECTION_DISPLAY = (1 << 2),
- SECTION_SETTINGS = (1 << 3)
+ SECTION_SETTINGS = (1 << 2)
};
enum
@@ -239,6 +238,7 @@ static GMenuModel* createSettingsSection(IndicatorKeyboardService *self, gboolea
{
GMenu * pMenu = g_menu_new();
gboolean bUbuntuTouch = ayatana_common_utils_is_ubuntutouch ();
+ gboolean bDisplay = FALSE;
if (self->pPrivate->bLomiri && bOSK && !bUbuntuTouch)
{
@@ -259,6 +259,7 @@ static GMenuModel* createSettingsSection(IndicatorKeyboardService *self, gboolea
if (bHardwareKeyboard)
{
sAction = "indicator.settings";
+ bDisplay = TRUE;
}
}
else if (bOSK)
@@ -274,8 +275,13 @@ static GMenuModel* createSettingsSection(IndicatorKeyboardService *self, gboolea
else if (!bOSK)
{
sAction = "indicator.settings";
+ bDisplay = TRUE;
}
+ if (bDisplay)
+ {
+ g_menu_append (pMenu, _("Show Current Layout"), "indicator.display");
+ }
if (sAction)
{
g_menu_append(pMenu, _("Keyboard Settingsā¦"), sAction);
@@ -284,29 +290,6 @@ static GMenuModel* createSettingsSection(IndicatorKeyboardService *self, gboolea
return G_MENU_MODEL(pMenu);
}
-static GMenuModel* createDisplaySection (IndicatorKeyboardService *self)
-{
- GMenu * pMenu = g_menu_new ();
- gboolean bDisplay = TRUE;
-
- if (self->pPrivate->bLomiri)
- {
- gboolean bHardwareKeyboard = m_fnKeyboardHasHardwareKeyboard (self->pPrivate->pKeyboard);
-
- if (!bHardwareKeyboard)
- {
- bDisplay = FALSE;
- }
- }
-
- if (bDisplay)
- {
- g_menu_append (pMenu, _("Show Current Layout"), "indicator.display");
- }
-
- return G_MENU_MODEL (pMenu);
-}
-
static void rebuildSection(GMenu *pMenu, int nPos, GMenuModel *pModel)
{
g_menu_remove(pMenu, nPos);
@@ -335,22 +318,17 @@ static void rebuildNow(IndicatorKeyboardService *self, guint nSections)
if (nSections & SECTION_LAYOUTS)
{
rebuildSection(pInfoDesktop->pSubmenu, 0, createLayoutSection(self, HWKBD));
- rebuildSection(pInfoDesktop->pSubmenu, 3, createLayoutSection(self, OSK));
+ rebuildSection(pInfoDesktop->pSubmenu, 2, createLayoutSection(self, OSK));
rebuildSection(pInfoPhone->pSubmenu, 0, createLayoutSection(self, HWKBD));
rebuildSection(pInfoPhone->pSubmenu, 2, createLayoutSection(self, OSK));
rebuildSection(pInfoGreeter->pSubmenu, 0, createLayoutSection(self, HWKBD));
rebuildSection(pInfoGreeter->pSubmenu, 1, createLayoutSection(self, OSK));
}
- if (nSections & SECTION_DISPLAY)
- {
- rebuildSection (pInfoDesktop->pSubmenu, 1, createDisplaySection (self));
- }
-
if (nSections & SECTION_SETTINGS)
{
- rebuildSection(pInfoDesktop->pSubmenu, 2, createSettingsSection(self, HWKBD));
- rebuildSection(pInfoDesktop->pSubmenu, 4, createSettingsSection(self, OSK));
+ rebuildSection(pInfoDesktop->pSubmenu, 1, createSettingsSection(self, HWKBD));
+ rebuildSection(pInfoDesktop->pSubmenu, 3, createSettingsSection(self, OSK));
rebuildSection(pInfoPhone->pSubmenu, 1, createSettingsSection(self, HWKBD));
rebuildSection(pInfoPhone->pSubmenu, 3, createSettingsSection(self, OSK));
}
@@ -378,7 +356,6 @@ static void createMenu(IndicatorKeyboardService *self, int nProfile)
else if (nProfile == PROFILE_DESKTOP)
{
lSections[nSection++] = createLayoutSection(self, HWKBD);
- lSections[nSection++] = createDisplaySection(self);
lSections[nSection++] = createSettingsSection(self, HWKBD);
lSections[nSection++] = createLayoutSection(self, OSK);
lSections[nSection++] = createSettingsSection(self, OSK);
--
2.47.2
|