Commit 84b64d82 authored by Javad Rahmatzadeh's avatar Javad Rahmatzadeh
Browse files

Add app menu label visibility

Closes #132
parent 666c61bc
......@@ -11,6 +11,10 @@ We go to the next version after each release on [GNOME Shell Extensions website]
- Dash app button visibility height.
- Looking glass recursion.
### Added
- App menu label visibility.
## [21.0.0 Reynolds] - 2022-08-06
### Changed
......
......@@ -19,6 +19,7 @@ This extension allows you to do the following:
| App Gesture | :black_circle: | :black_circle: | :white_circle: | :white_circle: | :white_circle: |
| Applications Button Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| App Menu Icon Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| App Menu Label Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| App Menu Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Background Menu Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Calendar Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
......
......@@ -138,6 +138,10 @@ var Manager = class
this._applyAppMenuIcon(false);
});
this._settings.connect('changed::app-menu-label', () => {
this._applyAppMenuLabel(false);
});
this._settings.connect('changed::clock-menu-position', () => {
this._applyClockMenuPosition(false);
});
......@@ -311,6 +315,7 @@ var Manager = class
this._applyPanelArrow(false);
this._applyPanelNotificationIcon(false);
this._applyAppMenuIcon(false);
this._applyAppMenuLabel(false);
this._applyClockMenuPosition(false);
this._applyShowAppsButton(false);
this._applyAnimation(false);
......@@ -376,6 +381,7 @@ var Manager = class
this._applyPanelArrow(true);
this._applyPanelNotificationIcon(true);
this._applyAppMenuIcon(true);
this._applyAppMenuLabel(true);
this._applyClockMenuPosition(true);
this._applyShowAppsButton(true);
this._applyAnimation(true);
......@@ -835,6 +841,22 @@ var Manager = class
}
}
/**
* apply app menu label settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyAppMenuLabel(forceOriginal)
{
if (forceOriginal || this._settings.get_boolean('app-menu-label')) {
this._api.appMenuLabelEnable();
} else {
this._api.appMenuLabelDisable();
}
}
/**
* apply clock menu position settings
*
......
......@@ -87,6 +87,18 @@ var PrefsKeys = class
}
);
this.setKey(
'visibility',
'app-menu-label',
'GtkSwitch',
true,
{
default: true,
minimal: true,
superminimal: true,
}
);
this.setKey(
'visibility',
'clock-menu',
......
......@@ -88,6 +88,12 @@
<description>App Menu Icon Visibility Status</description>
</key>
<key type="b" name="app-menu-label">
<default>true</default>
<summary>App Menu Label</summary>
<description>App Menu Label Visibility Status</description>
</key>
<key type="b" name="clock-menu">
<default>true</default>
<summary>Clock Menu</summary>
......
......@@ -61,6 +61,19 @@
</object>
</child>
<child>
<object class="AdwActionRow" id="app_menu_label_row">
<property name="title" translatable="yes">App Menu Label</property>
<property name="subtitle" translatable="yes">The text label in app menu button</property>
<property name="activatable-widget">app_menu_label_switch</property>
<child>
<object class="GtkSwitch" id="app_menu_label_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="clock_menu_row">
<property name="title" translatable="yes">Clock Menu</property>
......
......@@ -294,7 +294,84 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="app_menu_label_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="app_menu_label_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="app_menu_label_box2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">32</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="app_menu_label_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">App Menu Label</property>
<property name="xalign">0</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">The text label in app menu button</property>
<property name="xalign">0</property>
<property name="wrap">True</property>
<property name="width-chars">0</property>
<property name="margin-top">12</property>
<style>
<class name="dim-label"/>
</style>
<attributes>
<attribute name="scale" value="0.9"/>
</attributes>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSwitch" id="app_menu_label_switch">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="clock_menu_row">
<property name="visible">True</property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment