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

add dash separator visibility

parent 7968ffbf
......@@ -15,6 +15,10 @@ We go to the next version after each release on [GNOME Shell Extensions website]
- Prefs window size for scaled displays.
- Prefs window size for small displays in GNOME Shell 42.
### Added
- Dash separator visibility.
### Removed
- Gesture API for GNOME Shell 40 and higher.
......
......@@ -22,6 +22,7 @@ This extension allows you to do the following:
| 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: |
| Dash Separator Visibility | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: |
| 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: |
......
......@@ -3017,6 +3017,10 @@ var API = class
*/
dashSeparatorShow()
{
if (this._shellVersion < 40) {
return;
}
this.UIStyleClassRemove(this._getAPIClassname('no-dash-separator'));
}
......@@ -3027,6 +3031,10 @@ var API = class
*/
dashSeparatorHide()
{
if (this._shellVersion < 40) {
return;
}
this.UIStyleClassAdd(this._getAPIClassname('no-dash-separator'));
}
}
......
......@@ -245,6 +245,10 @@ var Manager = class
this._settings.connect('changed::panel-icon-size', () => {
this._applyPanelIconSize(false);
});
this._settings.connect('changed::dash-separator', () => {
this._applyDashSeparator(false);
});
}
/**
......@@ -303,6 +307,7 @@ var Manager = class
this._applyPanelIconSize(false);
this._applyEventsButton(false);
this._applyCalendar(false);
this._applyDashSeparator(false);
}
/**
......@@ -361,6 +366,7 @@ var Manager = class
this._applyPanelIconSize(true);
this._applyEventsButton(true);
this._applyCalendar(true);
this._applyDashSeparator(true);
}
/**
......@@ -1240,5 +1246,23 @@ var Manager = class
this._api.panelIconSetSize(size);
}
}
/**
* apply dash separator settings
*
* @param {boolean} forceOriginal force original shell setting
*
* @returns {void}
*/
_applyDashSeparator(forceOriginal)
{
let status = this._settings.get_boolean('dash-separator');
if (forceOriginal || status) {
this._api.dashSeparatorShow();
} else {
this._api.dashSeparatorHide();
}
}
}
......@@ -159,6 +159,18 @@ var PrefsKeys = class
}
);
this.setKey(
'visibility',
'dash-separator',
'GtkSwitch',
this._shellVersion >= 40,
{
default: true,
minimal: true,
superminimal: true,
}
);
this.setKey(
'visibility',
'osd',
......
......@@ -342,6 +342,12 @@
<description>Panel Icon Size</description>
</key>
<key type="b" name="dash-separator">
<default>true</default>
<summary>Dash Separator Visibility</summary>
<description>Dash Separator Visibility Status</description>
</key>
</schema>
</schemalist>
......
......@@ -191,6 +191,19 @@
</object>
</child>
<child>
<object class="AdwActionRow" id="dash_separator_row">
<property name="title" translatable="yes">Dash Separator</property>
<property name="subtitle" translatable="yes">Dash separator line that separates pin apps from unpin apps</property>
<property name="activatable-widget">dash_separator_switch</property>
<child>
<object class="GtkSwitch" id="dash_separator_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="show_apps_button_row">
<property name="title" translatable="yes">Show Applications Button</property>
......
......@@ -1064,6 +1064,84 @@
</object>
</child>
<child>
<object class="GtkListBoxRow" id="dash_separator_row">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox" id="dash_separator_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="dash_separator_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="dash_separator_txt">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Dash Separator</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">Dash separator line that separates pin apps from unpin apps</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="dash_separator_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="show_apps_button_row">
......
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