Scaling support in tint2conf (issue #656)

This commit is contained in:
o9000 2018-01-17 05:27:56 +00:00
parent c7b23ee94a
commit b3f9834313
3 changed files with 23 additions and 1 deletions

View file

@ -22,6 +22,7 @@
#include "gradient_gui.h"
#include "strlcat.h"
GtkWidget *scale_relative_to_dpi;
GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y,
*panel_spacing;
GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time,
@ -600,6 +601,19 @@ void create_panel(GtkWidget *parent)
"for centered panels, it is evenly distributed on both sides of the panel."),
NULL);
row++;
col = 2;
label = gtk_label_new(_("Scale relative to DPI"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
col++;
scale_relative_to_dpi = gtk_spin_button_new_with_range(0, 9000, 1);
gtk_widget_show(scale_relative_to_dpi);
gtk_table_attach(GTK_TABLE(table), scale_relative_to_dpi, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
col++;
change_paragraph(parent);
label = gtk_label_new(_("<b>Appearance</b>"));

View file

@ -9,6 +9,7 @@
#include "../launcher/icon-theme-common.h"
// panel
extern GtkWidget *scale_relative_to_dpi;
extern GtkWidget *panel_width, *panel_height, *panel_margin_x, *panel_margin_y, *panel_padding_x, *panel_padding_y,
*panel_spacing;
extern GtkWidget *panel_wm_menu, *panel_dock, *panel_autohide, *panel_autohide_show_time, *panel_autohide_hide_time,

View file

@ -378,6 +378,10 @@ void config_write_panel(FILE *fp)
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_saturation)),
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_brightness)));
fprintf(fp,
"scale_relative_to_dpi = %d\n",
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(scale_relative_to_dpi)));
fprintf(fp, "\n");
}
@ -1108,7 +1112,10 @@ void add_entry(char *key, char *value)
char *value1 = 0, *value2 = 0, *value3 = 0;
/* Gradients */
if (strcmp(key, "gradient") == 0) {
if (strcmp(key, "scale_relative_to_dpi") == 0) {
extract_values(value, &value1, &value2, &value3);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(scale_relative_to_dpi), atoi(value1));
} else if (strcmp(key, "gradient") == 0) {
finalize_gradient();
GradientConfigType t;
if (g_str_equal(value, "horizontal"))