Skip to content

Commit

Permalink
changed checkbuttons to switches at settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgarmehmetali committed Apr 1, 2017
1 parent 8745fa6 commit bc8628a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/BudgiePixelSaverApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ public class AppletSettings : Gtk.Grid
private Gtk.ComboBox? combobox_visibility;

[GtkChild]
private Gtk.CheckButton? checkbutton_csd;
private Gtk.Switch? switch_csd;

[GtkChild]
private Gtk.CheckButton? checkbutton_maximized;
private Gtk.Switch? switch_unmaximized;

public AppletSettings(Settings? settings)
{
this.settings = settings;

this.settings.bind("size", spinbutton_length, "value", SettingsBindFlags.DEFAULT);
this.settings.bind("visibility", combobox_visibility, "active", SettingsBindFlags.DEFAULT);
this.settings.bind("hide-for-csd", checkbutton_csd, "active", SettingsBindFlags.DEFAULT);
this.settings.bind("hide-for-unmaximized", checkbutton_maximized, "active", SettingsBindFlags.DEFAULT);
this.settings.bind("hide-for-csd", switch_csd, "active", SettingsBindFlags.DEFAULT);
this.settings.bind("hide-for-unmaximized", switch_unmaximized, "active", SettingsBindFlags.DEFAULT);
}
}

Expand Down
22 changes: 8 additions & 14 deletions src/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="adjustment">adjustment1</property>
<property name="climb_rate">1</property>
</object>
Expand All @@ -108,6 +109,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="model">liststore1</property>
<property name="active">0</property>
<property name="id_column">0</property>
Expand All @@ -124,35 +126,27 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_csd">
<object class="GtkSwitch" id="switch_unmaximized">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">end</property>
<property name="draw_indicator">True</property>
<child>
<placeholder/>
</child>
<property name="valign">start</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_maximized">
<object class="GtkSwitch" id="switch_csd">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">end</property>
<property name="draw_indicator">True</property>
<child>
<placeholder/>
</child>
<property name="valign">start</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
</template>
Expand Down

0 comments on commit bc8628a

Please sign in to comment.