Merge pull request #2034 from max-dw-i/add-symbolic-icon-style

Add setting for changing app icon style to symbolic
This commit is contained in:
Charles Gagnon
2024-04-02 11:13:20 -04:00
committed by GitHub
6 changed files with 49 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ let LABEL_GAP = 5;
let MAX_INDICATORS = 4;
export const DEFAULT_PADDING_SIZE = 4;
let APPICON_STYLE = {
NORMAL: "NORMAL",
SYMBOLIC: "SYMBOLIC"
}
let DOT_STYLE = {
DOTS: "DOTS",
SQUARES: "SQUARES",
@@ -188,6 +193,7 @@ export const TaskbarAppIcon = GObject.registerClass({
this._onAnimateAppiconHoverChanged();
this._setAppIconPadding();
this._setAppIconStyle();
this._showDots();
this._focusWindowChangedId = global.display.connect('notify::focus-window',
@@ -626,6 +632,15 @@ export const TaskbarAppIcon = GObject.registerClass({
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() {
this._removeMenuTimeout();
this.fake_release();

View File

@@ -702,6 +702,12 @@ const Preferences = class {
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
let dotPosition = this._settings.get_string('dot-position');

View File

@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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'>
<value value='0' nick='DOTS'/>
<value value='1' nick='SQUARES'/>
@@ -119,6 +123,11 @@
<summary>Dot position</summary>
<description>Running indicators are shown on the Bottom or Top of the screen.</description>
</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">
<default>'METRO'</default>
<summary>Style of the running indicator (focused)</summary>

View File

@@ -143,3 +143,7 @@
-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,
[
'changed::appicon-style',
'changed::group-apps-use-launchers',
'changed::taskbar-locked'
],

View File

@@ -104,6 +104,20 @@
</object>
</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>
</child>