graphical dpi show improvements

master
vhaudiquet 12 months ago
parent 8c8df678c4
commit 7c4b41666b
  1. 2
      drivers/g-wolves/g-wolves.c
  2. 12
      src/ui/panels/mouse-panel.c
  3. 1
      ui/panel-mouse.ui

@ -162,7 +162,7 @@ int driver_mouse_dpi_get(void* handle, struct MOUSE_DPI_LEVELS* output)
// Format 'output' packet // Format 'output' packet
output->max_level_count = 5; output->max_level_count = 5;
output->level_count = report.level_count; output->level_count = report.level_count;
output->level_current = report.level_current; output->level_current = report.level_current - 1;
output->led_available = true; output->led_available = true;
output->xy_available = false; output->xy_available = false;
for(size_t i = 0; i < report.level_count; i++) for(size_t i = 0; i < report.level_count; i++)

@ -59,13 +59,19 @@ void mouse_panel_set_device(MousePanel* self, device_t* device)
AdwPreferencesRow* row = ADW_PREFERENCES_ROW(adw_preferences_row_new()); AdwPreferencesRow* row = ADW_PREFERENCES_ROW(adw_preferences_row_new());
// Convert dpi int to string // Convert dpi int to string
char dpi_str[10]; char dpi_str[15];
sprintf(dpi_str, "%u", dpi.level[i].dpi_x); sprintf(dpi_str, "%u DPI", dpi.level[i].dpi_x);
GtkLabel* label = GTK_LABEL(gtk_label_new(dpi_str)); GtkLabel* label = GTK_LABEL(gtk_label_new(dpi_str));
gtk_widget_add_css_class(GTK_WIDGET(label), "heading"); 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)); gtk_list_box_row_set_child(GTK_LIST_BOX_ROW(row), GTK_WIDGET(label));
if(dpi.level_current == i)
{
gtk_list_box_row_set_activatable(GTK_LIST_BOX_ROW(row), false);
}
adw_preferences_group_add(self->dpi_preference_group, GTK_WIDGET(row)); adw_preferences_group_add(self->dpi_preference_group, GTK_WIDGET(row));
} }
} }

@ -57,6 +57,7 @@
<property name="valign">start</property> <property name="valign">start</property>
<child> <child>
<object class="AdwPreferencesGroup" id="dpi_preference_group"> <object class="AdwPreferencesGroup" id="dpi_preference_group">
<property name="width-request">300</property>
<property name="title">DPI Stages</property> <property name="title">DPI Stages</property>
<property name="description">DPI Stages of the mouse</property> <property name="description">DPI Stages of the mouse</property>
</object> </object>

Loading…
Cancel
Save