Skip to content

Commit

Permalink
Move below initialization of radio buttons (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
justchen1369 authored Aug 30, 2023
1 parent a8df672 commit 980b72e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/panel/applets/status/PowerIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ public class PowerProfilesSelector : Gtk.Box {
// need at least two options for it to be meaningful
if (profiles.length < 2) return;

// initialize state
on_active_profile_changed(profiles_proxy.active_profile);

((DBusProxy) profiles_proxy).g_properties_changed.connect(() => {
on_active_profile_changed(profiles_proxy.active_profile);
});

var sep = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
pack_start(sep, false, false, 1);

Expand Down Expand Up @@ -225,6 +218,14 @@ public class PowerProfilesSelector : Gtk.Box {
}

pack_start(power_profiles_radio_box);

// initialize state
on_active_profile_changed(profiles_proxy.active_profile);

((DBusProxy) profiles_proxy).g_properties_changed.connect(() => {
on_active_profile_changed(profiles_proxy.active_profile);
});

}

void on_active_profile_changed(string active_profile) {
Expand Down

0 comments on commit 980b72e

Please sign in to comment.