mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Toggle notification counter badge
This commit is contained in:
45
Settings.ui
45
Settings.ui
@@ -5835,6 +5835,51 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow" id="show_notification_badge_row">
|
||||
<property name="width_request">100</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="show_notification_badge_grid">
|
||||
<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="row_spacing">6</property>
|
||||
<property name="column_spacing">32</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_notification_badge_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="show_notification_badge_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Show notification counter badge</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<layout>
|
||||
<property name="row">0</property>
|
||||
<property name="column">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
|
||||
8
panel.js
8
panel.js
@@ -1421,8 +1421,14 @@ var Panel = GObject.registerClass({
|
||||
}
|
||||
|
||||
_initProgressManager() {
|
||||
if(!this.progressManager && (Me.settings.get_boolean('progress-show-bar') || Me.settings.get_boolean('progress-show-count')))
|
||||
const progressVisible = Me.settings.get_boolean('progress-show-bar');
|
||||
const countVisible = Me.settings.get_boolean('progress-show-count');
|
||||
const pm = this.progressManager;
|
||||
|
||||
if(!pm && (progressVisible || countVisible))
|
||||
this.progressManager = new Progress.ProgressManager();
|
||||
else if (pm)
|
||||
Object.keys(pm._entriesByDBusName).forEach((k) => pm._entriesByDBusName[k].setCountVisible(countVisible));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
5
prefs.js
5
prefs.js
@@ -1592,6 +1592,11 @@ const Preferences = class {
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT | Gio.SettingsBindFlags.INVERT_BOOLEAN);
|
||||
|
||||
this._settings.bind('progress-show-count',
|
||||
this._builder.get_object('show_notification_badge_switch'),
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
this._builder.get_object('group_apps_label_font_color_colorbutton').connect('color-set', (button) => {
|
||||
let rgba = button.get_rgba();
|
||||
let css = rgba.to_string();
|
||||
|
||||
Reference in New Issue
Block a user