tint2conf: GUI changes

git-svn-id: http://tint2.googlecode.com/svn/trunk@763 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000 2015-04-18 11:55:02 +00:00 committed by mrovi9000@gmail.com
parent b9f8bf30f7
commit 167bb31084
3 changed files with 980 additions and 468 deletions

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@
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, *panel_autohide_size;
extern GtkWidget *panel_combo_strut_policy, *panel_combo_layer, *panel_combo_width_type, *panel_combo_height_type, *panel_combo_monitor;
extern GtkWidget *panel_window_name, *disable_transparency;
enum {
itemsColName = 0,
@ -50,6 +51,7 @@ 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_active_background, *taskbar_inactive_background;
extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
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;
@ -96,7 +98,7 @@ extern GtkWidget *battery_background;
// systray
extern GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing;
extern GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *systray_icon_brightness;
extern GtkWidget *systray_background;
extern GtkWidget *systray_background, *systray_monitor;
// tooltip
extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_color;
@ -123,6 +125,7 @@ extern GtkWidget *margin_x, *margin_y;
extern GtkWidget *launcher_background;
extern GtkWidget *startup_notifications;
extern IconThemeWrapper *icon_theme;
extern GtkWidget *launcher_tooltip;
void load_desktop_file(const char *file, gboolean selected);
void set_current_icon_theme(const char *theme);

View file

@ -170,6 +170,9 @@ void config_write_panel(FILE *fp)
}
fprintf(fp, "\n");
fprintf(fp, "panel_window_name = %s\n", gtk_entry_get_text(GTK_ENTRY(panel_window_name)));
fprintf(fp, "disable_transparency = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_transparency)) ? 1 : 0);
fprintf(fp, "\n");
}
@ -213,6 +216,18 @@ void config_write_taskbar(FILE *fp)
color,
gtk_color_button_get_alpha(GTK_COLOR_BUTTON(taskbar_name_active_color)) * 100 / 0xffff);
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) {
fprintf(fp, "none");
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_sort_order)) == 1) {
fprintf(fp, "title");
} else {
fprintf(fp, "center");
}
fprintf(fp, "\n");
fprintf(fp, "\n");
}
@ -372,6 +387,10 @@ void config_write_systray(FILE *fp)
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_saturation)),
(int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(systray_icon_brightness)));
fprintf(fp, "systray_monitor = ");
fprintf(fp, "%d", gtk_combo_box_get_active(GTK_COMBO_BOX(systray_monitor)));
fprintf(fp, "\n");
fprintf(fp, "\n");
}
@ -394,6 +413,7 @@ void config_write_launcher(FILE *fp)
icon_theme = NULL;
}
fprintf(fp, "startup_notifications = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(startup_notifications)) ? 1 : 0);
fprintf(fp, "launcher_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_tooltip)) ? 1 : 0);
int index;
for (index = 0; ; index++) {
@ -695,6 +715,12 @@ void add_entry(char *key, char *value)
int id = background_index_safe(atoi(value));
gtk_combo_box_set_active(GTK_COMBO_BOX(panel_background), id);
}
else if (strcmp(key, "panel_window_name") == 0) {
gtk_entry_set_text(GTK_ENTRY(panel_window_name), value);
}
else if (strcmp(key, "disable_transparency") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(disable_transparency), atoi(value));
}
else if (strcmp(key, "wm_menu") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_wm_menu), atoi(value));
}
@ -853,6 +879,19 @@ void add_entry(char *key, char *value)
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 0);
}
else if (strcmp(key, "taskbar_distribute_size") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_distribute_size), atoi(value));
}
else if (strcmp(key, "taskbar_sort_order") == 0) {
if (strcmp(value, "none") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
else if (strcmp(value, "title") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 1);
else if (strcmp(value, "center") == 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));
@ -1078,6 +1117,22 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "systray_icon_size") == 0) {
gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_size), atoi(value));
}
else if (strcmp(key, "systray_monitor") == 0) {
if (strcmp(value, "0") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 1);
else if (strcmp(value, "1") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 2);
else if (strcmp(value, "2") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 3);
else if (strcmp(value, "3") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 4);
else if (strcmp(value, "4") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 5);
else if (strcmp(value, "5") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 6);
else if (strcmp(value, "6") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(systray_monitor), 7);
}
else if (strcmp(key, "systray_icon_asb") == 0) {
extract_values(value, &value1, &value2, &value3);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(systray_icon_opacity), atoi(value1));
@ -1119,6 +1174,9 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "launcher_icon_theme") == 0) {
set_current_icon_theme(value);
}
else if (strcmp(key, "launcher_tooltip") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_tooltip), atoi(value));
}
else if (strcmp(key, "startup_notifications") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(startup_notifications), atoi(value));
}