all repos — tint2 @ b3f98343133c162d9aac3a2011153edae478e986

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Scaling support in tint2conf (issue #656)
o9000 mrovi9000@gmail.com
commit

b3f98343133c162d9aac3a2011153edae478e986

parent

c7b23ee94aca22a6a4cf2d4f7cbb2de3fc9bb69d

3 files changed, 23 insertions(+), 1 deletions(-)

jump to
M src/tint2conf/properties.csrc/tint2conf/properties.c

@@ -22,6 +22,7 @@ #include "background_gui.h"

#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,

@@ -599,6 +600,19 @@ "For top-aligned panels, the space is created on the bottom of the panel; "

"for bottom-aligned panels, it is created on the top; " "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);
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -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,
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -378,6 +378,10 @@ (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(mouse_pressed_icon_opacity)),

(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 @@ {

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"))