feat: background mode (#29)
This commit is contained in:
parent
7654dc3656
commit
bb8219bcca
|
@ -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>
|
||||
|
|
|
@ -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 ();
|
||||
|
|
Loading…
Reference in New Issue