graphical dpi show improvements
This commit is contained in:
parent
8c8df678c4
commit
7c4b41666b
@ -162,7 +162,7 @@ int driver_mouse_dpi_get(void* handle, struct MOUSE_DPI_LEVELS* output)
|
||||
// Format 'output' packet
|
||||
output->max_level_count = 5;
|
||||
output->level_count = report.level_count;
|
||||
output->level_current = report.level_current;
|
||||
output->level_current = report.level_current - 1;
|
||||
output->led_available = true;
|
||||
output->xy_available = false;
|
||||
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());
|
||||
|
||||
// Convert dpi int to string
|
||||
char dpi_str[10];
|
||||
sprintf(dpi_str, "%u", dpi.level[i].dpi_x);
|
||||
char dpi_str[15];
|
||||
sprintf(dpi_str, "%u DPI", dpi.level[i].dpi_x);
|
||||
|
||||
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));
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@
|
||||
<property name="valign">start</property>
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="dpi_preference_group">
|
||||
<property name="width-request">300</property>
|
||||
<property name="title">DPI Stages</property>
|
||||
<property name="description">DPI Stages of the mouse</property>
|
||||
</object>
|
||||
|
Loading…
Reference in New Issue
Block a user