tint2 & tint2conf: Use spacing in task_padding

This commit is contained in:
o9000
2015-04-26 15:16:24 +02:00
parent afd4a806a6
commit 95fa0bbf83
5 changed files with 28 additions and 16 deletions

View File

@@ -52,7 +52,7 @@ GtkWidget *taskbar_distribute_size, *taskbar_sort_order;
// task
GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
GtkWidget *task_show_icon, *task_show_text, *task_align_center, *font_shadow;
GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_font;
GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing, *task_font;
GtkWidget *task_default_color, *task_default_color_set,
*task_default_icon_opacity, *task_default_icon_osb_set,
*task_default_icon_saturation,
@@ -2849,6 +2849,19 @@ void create_task(GtkWidget *parent)
gtk_tooltips_set_tip(tooltips, task_padding_y, "Specifies the vertical padding of the task buttons. "
"This is the space between the border and the content inside.", NULL);
row++, col = 2;
label = gtk_label_new(_("Spacing"));
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++;
task_spacing = gtk_spin_button_new_with_range(0, 9000, 1);
gtk_widget_show(task_spacing);
gtk_table_attach(GTK_TABLE(table), task_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
gtk_tooltips_set_tip(tooltips, task_spacing, "Specifies the spacing between the icon and the text.", NULL);
row++, col = 2;
label = gtk_label_new(_("Font"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

View File

@@ -56,7 +56,7 @@ extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order;
// task
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
extern GtkWidget *task_show_icon, *task_show_text, *task_align_center, *font_shadow;
extern GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_font;
extern GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing, *task_font;
extern GtkWidget *task_default_color, *task_default_color_set,
*task_default_icon_opacity, *task_default_icon_osb_set,
*task_default_icon_saturation,

View File

@@ -325,9 +325,10 @@ void config_write_task(FILE *fp)
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_maximum_width)),
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_maximum_height)));
fprintf(fp,
"task_padding = %d %d\n",
"task_padding = %d %d %d\n",
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_padding_x)),
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_padding_y)));
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_padding_y)),
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(task_spacing)));
fprintf(fp, "task_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(task_font)));
fprintf(fp, "task_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tooltip_task_show)) ? 1 : 0);
@@ -1088,7 +1089,9 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "task_padding") == 0) {
extract_values(value, &value1, &value2, &value3);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_x), atoi(value1));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_spacing), atoi(value1));
if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_padding_y), atoi(value2));
if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_spacing), atoi(value3));
}
else if (strcmp(key, "task_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(task_font), value);