diff --git a/src/ui/panels/mouse-panel.c b/src/ui/panels/mouse-panel.c index 201940c..430ed4b 100644 --- a/src/ui/panels/mouse-panel.c +++ b/src/ui/panels/mouse-panel.c @@ -66,25 +66,32 @@ void mouse_panel_set_device(MousePanel* self, device_t* device) sprintf(dpi_used_max, "%u/%u", dpi.level_count, dpi.max_level_count); adw_button_content_set_label(self->dpi_stage_add_button, dpi_used_max); + GtkCheckButton* group = 0; // Set dpi list for(size_t i = 0; i < dpi.level_count; i++) { - AdwPreferencesRow* row = ADW_PREFERENCES_ROW(adw_preferences_row_new()); + AdwActionRow* row = ADW_ACTION_ROW(adw_action_row_new()); - // Convert dpi int to string - char dpi_str[15]; - sprintf(dpi_str, "%u DPI", dpi.level[i].dpi_x); + // Add radiobutton + if(dpi.level_count > 1) + { + GtkCheckButton* radio_button = GTK_CHECK_BUTTON(gtk_check_button_new()); + if(!group) group = radio_button; + else gtk_check_button_set_group(radio_button, group); - GtkLabel* label = GTK_LABEL(gtk_label_new(dpi_str)); - gtk_widget_set_margin_top(GTK_WIDGET(label), 10); - gtk_widget_set_margin_bottom(GTK_WIDGET(label), 10); - gtk_list_box_row_set_child(GTK_LIST_BOX_ROW(row), GTK_WIDGET(label)); + if(dpi.level_current == i) + gtk_check_button_set_active(radio_button, true); - if(dpi.level_current == i) - { - gtk_list_box_row_set_activatable(GTK_LIST_BOX_ROW(row), false); + adw_action_row_add_prefix(row, GTK_WIDGET(radio_button)); } + // Convert dpi int to string, and set it as title + char dpi_str[15]; + sprintf(dpi_str, "%u DPI", dpi.level[i].dpi_x); + adw_preferences_row_set_title(ADW_PREFERENCES_ROW(row), dpi_str); + + //gtk_list_box_row_set_activatable(GTK_LIST_BOX_ROW(row), false); + adw_preferences_group_add(self->dpi_preference_group, GTK_WIDGET(row)); } } diff --git a/ui/panel-mouse.ui b/ui/panel-mouse.ui index b71e227..f964f21 100644 --- a/ui/panel-mouse.ui +++ b/ui/panel-mouse.ui @@ -5,87 +5,118 @@ - start - 10 + center start + false + vertical - + start - vertical - 10 - - - start - 250 - 30 - start - 300 - - - - - - center - center - - - - - - - - start - 30 - vertical start + false - + start - Basic settings - start - + vertical + + + start + 250 + 30 + start + 300 + + + + + + center + center + + + - + start 30 + vertical start + false - - - - - - list-add-symbolic - 1/1 - True + + start + 30 + start + + + 200 + + + + + list-add-symbolic + 1/1 + True + + + 350 + DPI Stages + DPI Stages of the mouse - - 300 - DPI Stages - DPI Stages of the mouse + + + + + + + + + + + center + 25 + + + false + 200 + false + true + Motion sync + Motion sync makes the mouse send sensor data at +the rate of the computer update requests + + + + + false + 200 + false + true + Angle snap + Angle snap detects when you try to draw a straight +line and locks the mouse on that line +