graphical dpi show improvements

This commit is contained in:
2023-09-28 18:10:08 +02:00
parent 8c8df678c4
commit 7c4b41666b
3 changed files with 11 additions and 4 deletions
+9 -3
View File
@@ -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));
}
}