diff --git a/data/interface.ui b/data/interface.ui index 046a33532334f4c695f3f9e59e61b2b2b9fbb75d..62a510369e3608bcc63008cb7e73b5ac797021ae 100644 --- a/data/interface.ui +++ b/data/interface.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.2 --> +<!-- Generated with glade 3.22.1 --> <interface> <requires lib="gtk+" version="3.16"/> <object class="GtkAdjustment" id="adjustment1"> @@ -7,32 +7,8 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkAdjustment" id="adjustment2"> - <property name="upper">20</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="adjustment3"> - <property name="upper">20</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> <template class="RugbyAppWindow" parent="GtkApplicationWindow"> <property name="can_focus">False</property> - <child> - <object class="GtkScrolledWindow"> - <property name="height_request">400</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="shadow_type">in</property> - <child> - <object class="GtkListBox" id="listbox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - </child> - </object> - </child> <child type="titlebar"> <object class="GtkHeaderBar"> <property name="visible">True</property> @@ -69,100 +45,16 @@ <property name="position">1</property> </packing> </child> - <child> - <object class="GtkGrid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="column_spacing">6</property> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">Kick filter:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">Try filter:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkSwitch" id="tryfilter"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkSwitch" id="kickfilter"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkScale" id="tryscale"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="adjustment">adjustment2</property> - <property name="round_digits">1</property> - <property name="digits">0</property> - <signal name="value-changed" handler="scale_value_changed_cb" swapped="no"/> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkScale" id="kickscale"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="hexpand">True</property> - <property name="adjustment">adjustment3</property> - <property name="round_digits">1</property> - <property name="digits">0</property> - <signal name="value-changed" handler="scale_value_changed_cb" swapped="no"/> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> </object> </child> </object> </child> + <child> + <object class="GtkListBox" id="listbox"> + <property name="height_request">400</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> </template> </interface> diff --git a/src/rugby-app-window.c b/src/rugby-app-window.c index fe88f838602b74453e2af7e6ca32443bf875eba6..523a31081d731dd6ec29570c1c8d24179346caf7 100644 --- a/src/rugby-app-window.c +++ b/src/rugby-app-window.c @@ -32,10 +32,6 @@ struct _RugbyAppWindow RugbyListStore *store; - GtkWidget *tryfilter; - GtkWidget *kickfilter; - GtkWidget *tryscale; - GtkWidget *kickscale; GtkWidget *listbox; }; @@ -60,19 +56,6 @@ scorespin_value_changed_cb (GtkSpinButton *spin, gint score = gtk_spin_button_get_value_as_int (spin); rugby_list_store_set_score (self->store, score); - - gint max_tries = MAX (get_max_tries (score), 1.0); - gtk_range_set_range (GTK_RANGE (self->tryscale), 0.0, max_tries); - - gint max_kicks = MAX (get_max_kicks (score), 1.0); - gtk_range_set_range (GTK_RANGE (self->kickscale), 0.0, max_kicks); -} - -static void -scale_value_changed_cb (GtkRange *range, - RugbyAppWindow *self) -{ - // pass } static GtkWidget * @@ -95,13 +78,6 @@ rugby_app_window_init (RugbyAppWindow *self) listbox_widget_func, NULL, NULL); - - g_object_bind_property (self->tryfilter, "active", - self->tryscale, "sensitive", - G_BINDING_DEFAULT); - g_object_bind_property (self->kickfilter, "active", - self->kickscale, "sensitive", - G_BINDING_DEFAULT); } static void @@ -124,14 +100,9 @@ rugby_app_window_class_init (RugbyAppWindowClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/uk/me/bcowan/rugby/interface.ui"); - gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, tryfilter); - gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, kickfilter); - gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, tryscale); - gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, kickscale); gtk_widget_class_bind_template_child (widget_class, RugbyAppWindow, listbox); gtk_widget_class_bind_template_callback (widget_class, scorespin_value_changed_cb); - gtk_widget_class_bind_template_callback (widget_class, scale_value_changed_cb); } RugbyAppWindow *