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

calendar visibility

parent 351e1929
......@@ -18,6 +18,7 @@ We go to the next version after each release on [GNOME Shell Extensions website]
### Added
- Events visibility in clock menu.
- Calendar visibility in clock menu.
- Dutch translation by [@Vistaus](https://gitlab.gnome.org/Vistaus).
## [19.0.0 Ancher] - 2022-03-02
......
......@@ -18,6 +18,7 @@ This extension allows you to do the following:
| App Menu Icon 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: |
| Clock Menu Position | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Clock Menu Visibility | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Dash Icon Size | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
......
......@@ -234,6 +234,10 @@ var Manager = class
this._applyWeather(false);
});
this._settings.connect('changed::calendar', () => {
this._applyCalendar(false);
});
this._settings.connect('changed::events-button', () => {
this._applyEventsButton(false);
});
......@@ -298,6 +302,7 @@ var Manager = class
this._applyWeather(false);
this._applyPanelIconSize(false);
this._applyEventsButton(false);
this._applyCalendar(false);
}
/**
......@@ -355,6 +360,7 @@ var Manager = class
this._applyWeather(true);
this._applyPanelIconSize(true);
this._applyEventsButton(true);
this._applyCalendar(true);
}
/**
......@@ -1181,6 +1187,24 @@ var Manager = class
}
}
/**
* apply calendar settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyCalendar(forceOriginal)
{
let status = this._settings.get_boolean('calendar');
if (forceOriginal || status) {
this._api.calendarShow();
} else {
this._api.calendarHide();
}
}
/**
* apply events button settings
*
......
......@@ -289,6 +289,18 @@ var PrefsKeys = class
}
);
this.setKey(
'visibility',
'calendar',
'GtkSwitch',
true,
{
default: true,
minimal: true,
superminimal: true,
}
);
this.setKey(
'visibility',
'events-button',
......
......@@ -328,6 +328,12 @@
<summary>Events Button Visibility in Clock Menu</summary>
<description>Events Button Visibility Status</description>
</key>
<key type="b" name="calendar">
<default>true</default>
<summary>Calendar Visibility in Clock Menu</summary>
<description>Calendar Visibility Status</description>
</key>
<key type="i" name="panel-icon-size">
<default>0</default>
......
......@@ -138,6 +138,19 @@
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="calendar_row">
<property name="title" translatable="yes">Calendar</property>
<property name="subtitle" translatable="yes">Calendar in clock menu</property>
<property name="activatable-widget">calendar_switch</property>
<child>
<object class="GtkSwitch" id="calendar_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="events_button_row">
......
......@@ -757,6 +757,83 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="calendar_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="calendar_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="calendar_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="calendar_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Calendar</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">Calendar 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="calendar_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="events_button_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