Tooth/src/Dialogs/Preferences.vala

27 lines
633 B
Vala
Raw Normal View History

2018-05-20 12:43:42 +00:00
using Gtk;
2020-05-31 18:55:40 +00:00
[GtkTemplate (ui = "/com/github/bleakgrey/tootle/ui/dialogs/preferences.ui")]
public class Tootle.Dialogs.Preferences : Hdy.PreferencesWindow {
2018-05-20 12:43:42 +00:00
2020-05-31 18:55:40 +00:00
[GtkChild]
Hdy.ComboRow default_post_visibility;
2018-05-20 12:43:42 +00:00
2020-05-31 18:55:40 +00:00
construct {
2018-10-23 10:05:24 +00:00
transient_for = window;
2019-03-11 14:14:37 +00:00
2020-05-31 18:55:40 +00:00
default_post_visibility.set_for_enum (typeof (API.Visibility), e => {
var i = e.get_value ();
var vis = API.Visibility.all ()[i];
default_post_visibility.subtitle = vis.get_desc ();
return vis.get_name ();
2018-05-20 12:43:42 +00:00
});
2019-03-11 14:14:37 +00:00
2020-05-31 18:55:40 +00:00
show ();
2018-05-20 12:43:42 +00:00
}
public static void open () {
2020-05-31 18:55:40 +00:00
new Preferences ();
2018-05-20 12:43:42 +00:00
}
}