Commit d3fac61d authored by Javad Rahmatzadeh's avatar Javad Rahmatzadeh
Browse files

add events button visibility feature

parent ae34c1a1
......@@ -16,6 +16,7 @@ We go to the next version after each release on [GNOME Shell Extensions website]
### Added
- Events visibility in clock menu.
- Dutch translation by [@Vistaus](https://gitlab.gnome.org/Vistaus).
## [19.0.0 Ancher] - 2022-03-02
......
......@@ -24,6 +24,7 @@ This extension allows you to do the following:
| Dash Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Disable Type to Search | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Double Super Key to App Grid | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: |
| Events in Clock Menu Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| GNOME Shell Theme Override | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Hot Corner | :black_circle: | :black_circle: | :black_circle: | :white_circle: | :white_circle: |
| Keyboard Layout Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
......
......@@ -234,6 +234,10 @@ var Manager = class
this._applyWeather(false);
});
this._settings.connect('changed::events-button', () => {
this._applyEventsButton(false);
});
this._settings.connect('changed::panel-icon-size', () => {
this._applyPanelIconSize(false);
});
......@@ -293,6 +297,7 @@ var Manager = class
this._applyWorldClock(false);
this._applyWeather(false);
this._applyPanelIconSize(false);
this._applyEventsButton(false);
}
/**
......@@ -349,6 +354,7 @@ var Manager = class
this._applyWorldClock(true);
this._applyWeather(true);
this._applyPanelIconSize(true);
this._applyEventsButton(true);
}
/**
......@@ -1175,6 +1181,24 @@ var Manager = class
}
}
/**
* apply events button settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyEventsButton(forceOriginal)
{
let status = this._settings.get_boolean('events-button');
if (forceOriginal || status) {
this._api.eventsButtonShow();
} else {
this._api.eventsButtonHide();
}
}
/**
* apply panel icon size settings
*
......
......@@ -289,6 +289,18 @@ var PrefsKeys = class
}
);
this.setKey(
'visibility',
'events-button',
'GtkSwitch',
true,
{
default: true,
minimal: true,
superminimal: true,
}
);
this.setKey(
'icons',
'app-menu-icon',
......
......@@ -322,6 +322,12 @@
<summary>Weather Visibility in Clock Menu</summary>
<description>Weather Visibility Status</description>
</key>
<key type="b" name="events-button">
<default>true</default>
<summary>Events Button Visibility in Clock Menu</summary>
<description>Events Button Visibility Status</description>
</key>
<key type="i" name="panel-icon-size">
<default>0</default>
......
......@@ -139,6 +139,19 @@
</object>
</child>
<child>
<object class="AdwActionRow" id="events_button_row">
<property name="title" translatable="yes">Events</property>
<property name="subtitle" translatable="yes">Events button in clock menu</property>
<property name="activatable-widget">events_button_switch</property>
<child>
<object class="GtkSwitch" id="events_button_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="search_row">
<property name="title" translatable="yes">Search</property>
......
......@@ -757,6 +757,83 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="events_button_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="events_button_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="events_button_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="events_button_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Events</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">Events button in clock menu</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="events_button_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="search_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