tint2conf: Fix taskbar_sort_order, taskbar_name_padding

This commit is contained in:
o9000 2015-04-26 13:49:41 +02:00
parent 7794272f8e
commit 298f60f1b0
4 changed files with 24 additions and 6 deletions

View file

@ -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);

View file

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

View file

@ -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;

View file

@ -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));