Skip to content

Commit

Permalink
Hides the dndQuickToggle instead of removing it
Browse files Browse the repository at this point in the history
  • Loading branch information
andia89 committed Nov 27, 2022
1 parent 0f90ea4 commit 46ffc02
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions features/dndQuickToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const featureReloader = Me.imports.libs.featureReloader
const { QuickSettings } = Me.imports.libs.gnome
const { Indicator } = Me.imports.libs.dndQuickToogleHandler
const { DateMenu } = Me.imports.libs.gnome
const { Gio, GObject } = imports.gi;


var dndQuickToggleFeature = class {
Expand All @@ -24,15 +25,23 @@ var dndQuickToggleFeature = class {

//remove DND button from datemenu
this.datemenu_dnd = DateMenu.last_child.last_child
DateMenu.last_child.remove_actor(this.datemenu_dnd);
this.datemenu_dnd.hide()
this.datemenu_dnd_connection = this.datemenu_dnd.connect("show", () => { this.datemenu_dnd.hide() })

}

unload() {
// disable feature reloader
featureReloader.disable(this)
//put back the button to the datemenu
DateMenu.last_child.add_child(this.datemenu_dnd);
this.datemenu_dnd.disconnect(this.datemenu_dnd_connection)
this.datemenu_dnd_connection = null;
const _settings = new Gio.Settings({
schema_id: 'org.gnome.desktop.notifications',
});
if (!_settings.get_boolean('show-banners')){
this.datemenu_dnd.show();
}
// Remove DND Quick Toggle
if (this.dndToggle) {
const dndQSItems = this.dndToggle.quickSettingsItems[0]
Expand Down

0 comments on commit 46ffc02

Please sign in to comment.