From 298f60f1b033b0e4547062e45532de0b85ded55e Mon Sep 17 00:00:00 2001 From: o9000 Date: Sun, 26 Apr 2015 13:49:41 +0200 Subject: [PATCH] tint2conf: Fix taskbar_sort_order, taskbar_name_padding --- src/config.c | 1 + src/tint2conf/properties.c | 17 ++++++++++++++++- src/tint2conf/properties.h | 2 +- src/tint2conf/properties_rw.c | 10 ++++++---- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/config.c b/src/config.c index 397f13e..22ebcb8 100644 --- a/src/config.c +++ b/src/config.c @@ -474,6 +474,7 @@ void add_entry (char *key, char *value) else if (strcmp (key, "taskbar_name_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config.g_taskbar.area_name.paddingxlr = panel_config.g_taskbar.area_name.paddingx = atoi (value1); + if (value2) panel_config.g_taskbar.area_name.paddingy = atoi (value2); } else if (strcmp (key, "taskbar_name_background_id") == 0) { int id = atoi (value); diff --git a/src/tint2conf/properties.c b/src/tint2conf/properties.c index c3be699..3f77b8f 100644 --- a/src/tint2conf/properties.c +++ b/src/tint2conf/properties.c @@ -44,7 +44,7 @@ GtkWidget *panel_background; // taskbar GtkWidget *taskbar_show_desktop, *taskbar_show_name, *taskbar_padding_x, *taskbar_padding_y, *taskbar_spacing; GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor; -GtkWidget *taskbar_name_padding_x, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font; +GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font; GtkWidget *taskbar_active_background, *taskbar_inactive_background; GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; GtkWidget *taskbar_distribute_size, *taskbar_sort_order; @@ -2381,6 +2381,21 @@ void create_taskbar(GtkWidget *parent) gtk_tooltips_set_tip(tooltips, taskbar_name_padding_x, "Specifies the horizontal padding of the desktop name. " "This is the space between the border and the text inside.", NULL); + col = 2; + row++; + label = gtk_label_new(_("Vertical padding")); + 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++; + + taskbar_name_padding_y = gtk_spin_button_new_with_range(0, 500, 1); + gtk_widget_show(taskbar_name_padding_y); + gtk_table_attach(GTK_TABLE(table), taskbar_name_padding_y, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + gtk_tooltips_set_tip(tooltips, taskbar_name_padding_y, "Specifies the vertical padding of the desktop name. " + "This is the space between the border and the text inside.", NULL); + col = 2; row++; label = gtk_label_new(_("Active font color")); diff --git a/src/tint2conf/properties.h b/src/tint2conf/properties.h index bb035c8..fe9fb38 100644 --- a/src/tint2conf/properties.h +++ b/src/tint2conf/properties.h @@ -48,7 +48,7 @@ extern GtkWidget *panel_background; // taskbar extern GtkWidget *taskbar_show_desktop, *taskbar_show_name, *taskbar_padding_x, *taskbar_padding_y, *taskbar_spacing; extern GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor; -extern GtkWidget *taskbar_name_padding_x, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font; +extern GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font; extern GtkWidget *taskbar_active_background, *taskbar_inactive_background; extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order; diff --git a/src/tint2conf/properties_rw.c b/src/tint2conf/properties_rw.c index a22726f..d159340 100644 --- a/src/tint2conf/properties_rw.c +++ b/src/tint2conf/properties_rw.c @@ -183,7 +183,7 @@ void config_write_panel(FILE *fp) if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_layer)) == 0) { fprintf(fp, "top"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(panel_combo_layer)) == 1) { - fprintf(fp, "center"); + fprintf(fp, "normal"); } else { fprintf(fp, "bottom"); } @@ -240,8 +240,9 @@ void config_write_taskbar(FILE *fp) fprintf(fp, "taskbar_hide_inactive_tasks = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_inactive_tasks)) ? 1 : 0); fprintf(fp, "taskbar_hide_different_monitor = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_diff_monitor)) ? 1 : 0); fprintf(fp, - "taskbar_name_padding = %d\n", - (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_x))); + "taskbar_name_padding = %d %d\n", + (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_x)), + (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_name_padding_y))); fprintf(fp, "taskbar_name_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_name_inactive_background))); fprintf(fp, "taskbar_name_active_background_id = %d\n", gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_name_active_background))); fprintf(fp, "taskbar_name_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(taskbar_name_font))); @@ -262,7 +263,7 @@ void config_write_taskbar(FILE *fp) fprintf(fp, "taskbar_distribute_size = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_distribute_size)) ? 1 : 0); fprintf(fp, "taskbar_sort_order = "); - if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 0) { + if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) <= 0) { fprintf(fp, "none"); } else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 1) { fprintf(fp, "title"); @@ -1010,6 +1011,7 @@ void add_entry(char *key, char *value) else if (strcmp(key, "taskbar_name_padding") == 0) { extract_values(value, &value1, &value2, &value3); gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_name_padding_x), atoi(value1)); + if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_name_padding_y), atoi(value2)); } else if (strcmp(key, "taskbar_name_background_id") == 0) { int id = background_index_safe(atoi(value));