Skip to content

Commit

Permalink
Remove application parameter from win/dialog constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmexican committed Apr 22, 2024
1 parent d41bbf6 commit cc5dcff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Mingle {

private void on_preferences_action () {
message ("app.preferences action activated");
var prefs = new Mingle.PrefsDialog (this);
var prefs = new Mingle.PrefsDialog ();
prefs.present (this.active_window);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/prefs.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ namespace Mingle {
public class PrefsDialog : Adw.PreferencesDialog {
[GtkChild] private unowned Adw.ComboRow headerbar_row;
[GtkChild] private unowned Adw.ComboRow transition_row;
private GLib.Settings settings;
private GLib.Settings settings = new GLib.Settings ("io.github.halfmexican.Mingle");

public PrefsDialog (Mingle.Application app) {
this.settings = app.settings;
public PrefsDialog () {
headerbar_row.notify["selected"].connect (update_headerbar_style);
headerbar_row.set_selected (this.settings.get_int ("headerbar-style"));
transition_row.notify["selected"].connect (update_revealer_transition);
Expand Down
3 changes: 1 addition & 2 deletions src/window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Mingle {
[GtkChild] private unowned Adw.Breakpoint breakpoint;
private bool breakpoint_applied;
private EmojiDataManager emoji_manager = new EmojiDataManager ();
private GLib.Settings settings;
private GLib.Settings settings = new GLib.Settings ("io.github.halfmexican.Mingle");

// Codepoints
private string curr_left_emoji;
Expand All @@ -59,7 +59,6 @@ namespace Mingle {

public Window (Mingle.Application app) {
GLib.Object (application: app);
this.settings = app.settings;
this.settings.changed.connect (handle_pref_change);
this.bind_property ("is-loading", left_emojis_flow_box, "sensitive", BindingFlags.INVERT_BOOLEAN);
this.combined_scrolled_window.edge_overshot.connect (on_edge_overshot); // Handles loading more emojis on scroll
Expand Down

0 comments on commit cc5dcff

Please sign in to comment.