feat: background mode (#29)

This commit is contained in:
Behzad 2022-12-13 20:58:17 +03:30 committed by GitHub
parent 7654dc3656
commit bb8219bcca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -67,12 +67,12 @@
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Behavior</property>
<property name="sensitive">0</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Autostart</property>
<property name="activatable_widget">autostart</property>
<property name="subtitle" translatable="yes">Start minimized at boot</property>
<property name="sensitive">0</property>
<child>
<object class="GtkSwitch" id="autostart">
<property name="can_focus">0</property>

View File

@ -154,14 +154,18 @@ namespace Tooth {
}
main_window.present ();
}
main_window.close_request.connect(on_window_closed);
}
// TODO: Background mode
// public bool on_window_closed () {
// if (!settings.work_in_background || accounts.saved.is_empty)
// app.remove_window (window_dummy);
// return false;
// }
public bool on_window_closed () {
if (!settings.work_in_background || accounts.saved.is_empty) {
main_window.hide_on_close = false;
} else {
main_window.hide_on_close = true;
}
return false;
}
void compose_activated () {
new Dialogs.Compose ();