Add setting for changing app icon style to symbolic

This commit is contained in:
Maxim Shpak
2024-02-17 18:09:44 +03:00
parent 42eba9b119
commit cccbdcdaa2
6 changed files with 49 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ let LABEL_GAP = 5;
let MAX_INDICATORS = 4; let MAX_INDICATORS = 4;
export const DEFAULT_PADDING_SIZE = 4; export const DEFAULT_PADDING_SIZE = 4;
let APPICON_STYLE = {
NORMAL: "NORMAL",
SYMBOLIC: "SYMBOLIC"
}
let DOT_STYLE = { let DOT_STYLE = {
DOTS: "DOTS", DOTS: "DOTS",
SQUARES: "SQUARES", SQUARES: "SQUARES",
@@ -188,6 +193,7 @@ export const TaskbarAppIcon = GObject.registerClass({
this._onAnimateAppiconHoverChanged(); this._onAnimateAppiconHoverChanged();
this._setAppIconPadding(); this._setAppIconPadding();
this._setAppIconStyle();
this._showDots(); this._showDots();
this._focusWindowChangedId = global.display.connect('notify::focus-window', this._focusWindowChangedId = global.display.connect('notify::focus-window',
@@ -626,6 +632,15 @@ export const TaskbarAppIcon = GObject.registerClass({
this._iconContainer.set_style('padding: ' + padding + 'px;'); this._iconContainer.set_style('padding: ' + padding + 'px;');
} }
_setAppIconStyle() {
let symbolic_icon_style_name = 'symbolic-icon-style';
if (SETTINGS.get_string('appicon-style') === APPICON_STYLE.SYMBOLIC) {
this.add_style_class_name(symbolic_icon_style_name);
} else {
this.remove_style_class_name(symbolic_icon_style_name);
}
}
popupMenu() { popupMenu() {
this._removeMenuTimeout(); this._removeMenuTimeout();
this.fake_release(); this.fake_release();

View File

@@ -702,6 +702,12 @@ const Preferences = class {
panel_size_scale.set_inverted(true); panel_size_scale.set_inverted(true);
} }
// App icon style option
this._builder.get_object('appicon_style_combo').set_active_id(this._settings.get_string('appicon-style'));
this._builder.get_object('appicon_style_combo').connect('changed', (widget) => {
this._settings.set_string('appicon-style', widget.get_active_id());
});
// Dots Position option // Dots Position option
let dotPosition = this._settings.get_string('dot-position'); let dotPosition = this._settings.get_string('dot-position');

View File

@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="gnome-shell-extensions"> <schemalist gettext-domain="gnome-shell-extensions">
<enum id='org.gnome.shell.extensions.dash-to-panel.appiconStyle'>
<value value='0' nick='NORMAL'/>
<value value='1' nick='SYMBOLIC'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-panel.dotStyle'> <enum id='org.gnome.shell.extensions.dash-to-panel.dotStyle'>
<value value='0' nick='DOTS'/> <value value='0' nick='DOTS'/>
<value value='1' nick='SQUARES'/> <value value='1' nick='SQUARES'/>
@@ -119,6 +123,11 @@
<summary>Dot position</summary> <summary>Dot position</summary>
<description>Running indicators are shown on the Bottom or Top of the screen.</description> <description>Running indicators are shown on the Bottom or Top of the screen.</description>
</key> </key>
<key name="appicon-style" enum="org.gnome.shell.extensions.dash-to-panel.appiconStyle">
<default>'NORMAL'</default>
<summary>Style of Appicons</summary>
<description>Style of Appicons</description>
</key>
<key name="dot-style-focused" enum="org.gnome.shell.extensions.dash-to-panel.dotStyle"> <key name="dot-style-focused" enum="org.gnome.shell.extensions.dash-to-panel.dotStyle">
<default>'METRO'</default> <default>'METRO'</default>
<summary>Style of the running indicator (focused)</summary> <summary>Style of the running indicator (focused)</summary>

View File

@@ -154,3 +154,7 @@
-progress-bar-border: rgba(0.9, 0.9, 0.9, 1); -progress-bar-border: rgba(0.9, 0.9, 0.9, 1);
*/ */
} }
.symbolic-icon-style {
-st-icon-style: symbolic;
}

View File

@@ -378,6 +378,7 @@ export const Taskbar = class extends EventEmitter {
[ [
SETTINGS, SETTINGS,
[ [
'changed::appicon-style',
'changed::group-apps-use-launchers', 'changed::group-apps-use-launchers',
'changed::taskbar-locked' 'changed::taskbar-locked'
], ],

View File

@@ -104,6 +104,20 @@
</object> </object>
</child> </child>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Icon style</property>
<child>
<object class="GtkComboBoxText" id="appicon_style_combo">
<property name="valign">center</property>
<items>
<item id="NORMAL" translatable="yes">Normal</item>
<item id="SYMBOLIC" translatable="yes">Symbolic</item>
</items>
</object>
</child>
</object>
</child>
</object> </object>
</child> </child>