Merge taskbar_alignment from branch

This commit is contained in:
o9000
2015-06-12 00:52:10 +02:00
parent 18b0ef2d1b
commit df1f2d4e4b
13 changed files with 409 additions and 276 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -47,7 +47,7 @@ GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor;
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;
GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
// task
GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
@@ -2317,6 +2317,24 @@ void create_taskbar(GtkWidget *parent)
"'By title' means that tasks are sorted by their window titles. \n"
"'By center' means that tasks are sorted geometrically by their window centers."), NULL);
row++;
col = 2;
label = gtk_label_new(_("Task alignment"));
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_alignment = gtk_combo_box_new_text();
gtk_widget_show(taskbar_alignment);
gtk_table_attach(GTK_TABLE(table), taskbar_alignment, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Left"));
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Center"));
gtk_combo_box_append_text(GTK_COMBO_BOX(taskbar_alignment), _("Right"));
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_alignment), 0);
gtk_tooltips_set_tip(tooltips, taskbar_alignment, _("Specifies how tasks should be positioned on the taskbar."), NULL);
change_paragraph(parent);
label = gtk_label_new(_("<b>Appearance</b>"));

View File

@@ -51,7 +51,7 @@ extern GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor;
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;
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
// task
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;

View File

@@ -272,6 +272,16 @@ void config_write_taskbar(FILE *fp)
}
fprintf(fp, "\n");
fprintf(fp, "task_align = ");
if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) <= 0) {
fprintf(fp, "left");
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) == 1) {
fprintf(fp, "center");
} else {
fprintf(fp, "right");
}
fprintf(fp, "\n");
fprintf(fp, "\n");
}
@@ -998,6 +1008,16 @@ void add_entry(char *key, char *value)
else
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
}
else if (strcmp(key, "task_align") == 0) {
if (strcmp(value, "left") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
else if (strcmp(value, "center") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 1);
else if (strcmp(value, "right") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 2);
else
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
}
else if (strcmp(key, "taskbar_padding") == 0) {
extract_values(value, &value1, &value2, &value3);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_x), atoi(value1));