aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2025-07-21 08:45:00 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2026-06-10 22:22:59 +0200
commit03b9e52c2aea3aae3fc884238a2ce4ba3a8046ba (patch)
tree263e31139c0ca83400dedd9d9bca73881dac192a /src
parentaa4f9c31d6fc5316b363f0f91e39d1468f33fbdb (diff)
downloadayatana-indicator-keyboard-03b9e52c2aea3aae3fc884238a2ce4ba3a8046ba.tar.gz
ayatana-indicator-keyboard-03b9e52c2aea3aae3fc884238a2ce4ba3a8046ba.tar.bz2
ayatana-indicator-keyboard-03b9e52c2aea3aae3fc884238a2ce4ba3a8046ba.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/service.c45
1 files changed, 11 insertions, 34 deletions
diff --git a/src/service.c b/src/service.c
index 123308c9..59ed68ba 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
@@ -242,6 +241,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)
{
@@ -262,6 +262,7 @@ static GMenuModel* createSettingsSection(IndicatorKeyboardService *self, gboolea
if (bHardwareKeyboard)
{
sAction = "indicator.settings";
+ bDisplay = TRUE;
}
}
else if (bOSK)
@@ -272,8 +273,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);
@@ -282,29 +288,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);
@@ -333,22 +316,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));
}
@@ -376,7 +354,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);