tint2conf: leave font setting to default if not set

This commit is contained in:
o9000 2016-01-10 14:01:08 +01:00
parent abbf44bab7
commit 6ae4c0a9a8
4 changed files with 124 additions and 31 deletions

View file

@ -1,4 +1,4 @@
#---- Generated by tint2conf 5d6f ----
#---- Generated by tint2conf e7db ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for
# full documentation of the configuration options.
#-------------------------------------
@ -88,7 +88,7 @@ taskbar_name = 1
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_name_padding = 4 2
taskbar_name_background_id = -1
taskbar_name_background_id = 0
taskbar_name_active_background_id = 0
taskbar_name_font_color = #e3e3e3 100
taskbar_name_active_font_color = #ffffff 100
@ -129,7 +129,7 @@ systray_monitor = 1
# Launcher
launcher_padding = 2 4 2
launcher_background_id = 0
launcher_icon_background_id = -1
launcher_icon_background_id = 0
launcher_icon_size = 24
launcher_icon_asb = 100 0 0
launcher_icon_theme_override = 0

View file

@ -51,7 +51,8 @@ GtkWidget *notebook;
// 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_padding_y, *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;
GtkWidget *taskbar_name_font, *taskbar_name_font_set;
GtkWidget *taskbar_active_background, *taskbar_inactive_background;
GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
@ -59,7 +60,8 @@ 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;
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_spacing, *task_font;
GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing;
GtkWidget *task_font, *task_font_set;
GtkWidget *task_default_color, *task_default_color_set,
*task_default_icon_opacity, *task_default_icon_osb_set,
*task_default_icon_saturation,
@ -91,12 +93,14 @@ GtkWidget *task_iconified_color, *task_iconified_color_set,
GtkWidget *clock_format_line1, *clock_format_line2, *clock_tmz_line1, *clock_tmz_line2;
GtkWidget *clock_left_command, *clock_right_command;
GtkWidget *clock_mclick_command, *clock_rclick_command, *clock_uwheel_command, *clock_dwheel_command;
GtkWidget *clock_padding_x, *clock_padding_y, *clock_font_line1, *clock_font_line2, *clock_font_color;
GtkWidget *clock_padding_x, *clock_padding_y;
GtkWidget *clock_font_line1, *clock_font_line1_set, *clock_font_line2, *clock_font_line2_set, *clock_font_color;
GtkWidget *clock_background;
// battery
GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd;
GtkWidget *battery_padding_x, *battery_padding_y, *battery_font_line1, *battery_font_line2, *battery_font_color;
GtkWidget *battery_padding_x, *battery_padding_y;
GtkWidget *battery_font_line1, *battery_font_line1_set, *battery_font_line2, *battery_font_line2_set, *battery_font_color;
GtkWidget *battery_background;
GtkWidget *battery_tooltip;
GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command;
@ -108,7 +112,7 @@ GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *
GtkWidget *systray_background, *systray_monitor;
// tooltip
GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_color;
GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color;
GtkWidget *tooltip_task_show, *tooltip_show_after, *tooltip_hide_after;
GtkWidget *clock_format_tooltip, *clock_tmz_tooltip;
GtkWidget *tooltip_background;
@ -229,6 +233,11 @@ void okClicked(GtkWidget *widget, gpointer data)
cancelClicked(widget, data);
}
void font_set_callback(GtkWidget *widget, gpointer data)
{
gtk_widget_set_sensitive(data, GTK_TOGGLE_BUTTON(widget)->active);
}
GtkWidget *create_properties()
{
GtkWidget *view, *dialog_vbox3, *button;
@ -3119,8 +3128,14 @@ void create_taskbar(GtkWidget *parent)
col++;
gtk_tooltips_set_tip(tooltips, taskbar_name_inactive_color, _("Specifies the font color used to display the name of inactive desktops."), NULL);
col = 2;
col = 1;
row++;
taskbar_name_font_set = gtk_check_button_new();
gtk_widget_show(taskbar_name_font_set);
gtk_table_attach(GTK_TABLE(table), taskbar_name_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, taskbar_name_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -3136,6 +3151,8 @@ void create_taskbar(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(taskbar_name_font), TRUE);
gtk_tooltips_set_tip(tooltips, taskbar_name_font, _("Specifies the font used to display the desktop name."), NULL);
gtk_signal_connect(GTK_OBJECT(taskbar_name_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), taskbar_name_font);
font_set_callback(taskbar_name_font_set, taskbar_name_font);
col = 2;
row++;
@ -3501,7 +3518,13 @@ void create_task(GtkWidget *parent)
col++;
gtk_tooltips_set_tip(tooltips, task_spacing, _("Specifies the spacing between the icon and the text."), NULL);
row++, col = 2;
row++, col = 1;
task_font_set = gtk_check_button_new();
gtk_widget_show(task_font_set);
gtk_table_attach(GTK_TABLE(table), task_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, task_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -3514,6 +3537,8 @@ void create_task(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(task_font), TRUE);
gtk_tooltips_set_tip(tooltips, task_font, _("Specifies the font used to display the task button text."), NULL);
gtk_signal_connect(GTK_OBJECT(task_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), task_font);
font_set_callback(task_font_set, task_font);
change_paragraph(parent);
@ -3992,7 +4017,13 @@ void create_clock(GtkWidget *parent)
gtk_tooltips_set_tip(tooltips, clock_padding_y, _("Specifies the vertical padding of the clock. "
"This is the space between the border and the content inside."), NULL);
row++, col = 2;
row++, col = 1;
clock_font_line1_set = gtk_check_button_new();
gtk_widget_show(clock_font_line1_set);
gtk_table_attach(GTK_TABLE(table), clock_font_line1_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, clock_font_line1_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font first line"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -4009,8 +4040,16 @@ void create_clock(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(clock_font_line1), TRUE);
gtk_tooltips_set_tip(tooltips, clock_font_line1, _("Specifies the font used to display the first line of the clock."), NULL);
gtk_signal_connect(GTK_OBJECT(clock_font_line1_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), clock_font_line1);
font_set_callback(clock_font_line1_set, clock_font_line1);
row++, col = 1;
clock_font_line2_set = gtk_check_button_new();
gtk_widget_show(clock_font_line2_set);
gtk_table_attach(GTK_TABLE(table), clock_font_line2_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, clock_font_line2_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
row++, col = 2;
label = gtk_label_new(_("Font second line"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -4026,6 +4065,8 @@ void create_clock(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(clock_font_line2), TRUE);
gtk_tooltips_set_tip(tooltips, clock_font_line2, _("Specifies the font used to display the second line of the clock."), NULL);
gtk_signal_connect(GTK_OBJECT(clock_font_line2_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), clock_font_line2);
font_set_callback(clock_font_line2_set, clock_font_line2);
row++, col = 2;
label = gtk_label_new(_("Font color"));
@ -4361,7 +4402,13 @@ void create_execp(GtkWidget *notebook, int i)
gtk_tooltips_set_tip(tooltips, executor->execp_padding_y, _("Specifies the vertical padding of the executor. "
"This is the space between the border and the content inside."), NULL);
row++, col = 2;
row++, col = 1;
executor->execp_font_set = gtk_check_button_new();
gtk_widget_show(executor->execp_font_set);
gtk_table_attach(GTK_TABLE(table), executor->execp_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, executor->execp_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -4373,6 +4420,8 @@ void create_execp(GtkWidget *notebook, int i)
gtk_table_attach(GTK_TABLE(table), executor->execp_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(executor->execp_font), TRUE);
gtk_signal_connect(GTK_OBJECT(executor->execp_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), executor->execp_font);
font_set_callback(executor->execp_font_set, executor->execp_font);
row++, col = 2;
label = gtk_label_new(_("Font color"));
@ -4997,7 +5046,13 @@ void create_battery(GtkWidget *parent)
gtk_tooltips_set_tip(tooltips, battery_padding_y, _("Specifies the vertical padding of the battery. "
"This is the space between the border and the content inside."), NULL);
row++, col = 2;
row++, col = 1;
battery_font_line1_set = gtk_check_button_new();
gtk_widget_show(battery_font_line1_set);
gtk_table_attach(GTK_TABLE(table), battery_font_line1_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, battery_font_line1_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font first line"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -5013,8 +5068,16 @@ void create_battery(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(battery_font_line1), TRUE);
gtk_tooltips_set_tip(tooltips, battery_font_line1, _("Specifies the font used to display the first line of the battery text."), NULL);
gtk_signal_connect(GTK_OBJECT(battery_font_line1_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), battery_font_line1);
font_set_callback(battery_font_line1_set, battery_font_line1);
row++, col = 1;
battery_font_line2_set = gtk_check_button_new();
gtk_widget_show(battery_font_line2_set);
gtk_table_attach(GTK_TABLE(table), battery_font_line2_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, battery_font_line2_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
row++, col = 2;
label = gtk_label_new(_("Font second line"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -5030,6 +5093,8 @@ void create_battery(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(battery_font_line2), TRUE);
gtk_tooltips_set_tip(tooltips, battery_font_line2, _("Specifies the font used to display the second line of the battery text."), NULL);
gtk_signal_connect(GTK_OBJECT(battery_font_line2_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), battery_font_line2);
font_set_callback(battery_font_line2_set, battery_font_line2);
row++, col = 2;
label = gtk_label_new(_("Font color"));
@ -5161,7 +5226,13 @@ void create_tooltip(GtkWidget *parent)
gtk_tooltips_set_tip(tooltips, tooltip_padding_y, _("Specifies the vertical padding of the tooltip. "
"This is the space between the border and the content inside."), NULL);
row++, col = 2;
row++, col = 1;
tooltip_font_set = gtk_check_button_new();
gtk_widget_show(tooltip_font_set);
gtk_table_attach(GTK_TABLE(table), tooltip_font_set, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
gtk_tooltips_set_tip(tooltips, tooltip_font_set, _("If not checked, the desktop theme font is used. If checked, the custom font specified here is used."), NULL);
col++;
label = gtk_label_new(_("Font"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
gtk_widget_show(label);
@ -5174,6 +5245,8 @@ void create_tooltip(GtkWidget *parent)
col++;
gtk_font_button_set_show_style(GTK_FONT_BUTTON(tooltip_font), TRUE);
gtk_tooltips_set_tip(tooltips, tooltip_font, _("Specifies the font used to display the text of the tooltip."), NULL);
gtk_signal_connect(GTK_OBJECT(tooltip_font_set), "toggled", GTK_SIGNAL_FUNC(font_set_callback), tooltip_font);
font_set_callback(tooltip_font_set, tooltip_font);
row++, col = 2;
label = gtk_label_new(_("Font color"));

View file

@ -52,7 +52,8 @@ 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_padding_y, *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;
extern GtkWidget *taskbar_name_font, *taskbar_name_font_set;
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, *taskbar_alignment;
@ -60,7 +61,8 @@ extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignme
// 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_spacing, *task_font;
extern GtkWidget *task_maximum_width, *task_maximum_height, *task_padding_x, *task_padding_y, *task_spacing;
extern GtkWidget *task_font, *task_font_set;
extern GtkWidget *task_default_color, *task_default_color_set,
*task_default_icon_opacity, *task_default_icon_osb_set,
*task_default_icon_saturation,
@ -92,12 +94,14 @@ extern GtkWidget *task_iconified_color, *task_iconified_color_set,
extern GtkWidget *clock_format_line1, *clock_format_line2, *clock_tmz_line1, *clock_tmz_line2;
extern GtkWidget *clock_left_command, *clock_right_command;
extern GtkWidget *clock_mclick_command, *clock_rclick_command, *clock_uwheel_command, *clock_dwheel_command;
extern GtkWidget *clock_padding_x, *clock_padding_y, *clock_font_line1, *clock_font_line2, *clock_font_color;
extern GtkWidget *clock_padding_x, *clock_padding_y;
extern GtkWidget *clock_font_line1, *clock_font_line1_set, *clock_font_line2, *clock_font_line2_set, *clock_font_color;
extern GtkWidget *clock_background;
// battery
extern GtkWidget *battery_hide_if_higher, *battery_alert_if_lower, *battery_alert_cmd;
extern GtkWidget *battery_padding_x, *battery_padding_y, *battery_font_line1, *battery_font_line2, *battery_font_color;
extern GtkWidget *battery_padding_x, *battery_padding_y;
extern GtkWidget *battery_font_line1, *battery_font_line1_set, *battery_font_line2, *battery_font_line2_set, *battery_font_color;
extern GtkWidget *battery_background;
extern GtkWidget *battery_tooltip;
extern GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command;
@ -109,7 +113,7 @@ extern GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_satura
extern GtkWidget *systray_background, *systray_monitor;
// tooltip
extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_color;
extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color;
extern GtkWidget *tooltip_task_show, *tooltip_show_after, *tooltip_hide_after;
extern GtkWidget *clock_format_tooltip, *clock_tmz_tooltip;
extern GtkWidget *tooltip_background;
@ -124,8 +128,8 @@ typedef struct Executor {
GtkWidget *execp_continuous, *execp_markup, *execp_tooltip;
GtkWidget *execp_left_command, *execp_right_command;
GtkWidget *execp_mclick_command, *execp_rclick_command, *execp_uwheel_command, *execp_dwheel_command;
GtkWidget *execp_font, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered, *execp_background;
GtkWidget *execp_icon_w, *execp_icon_h;
GtkWidget *execp_font, *execp_font_set, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered;
GtkWidget *execp_background, *execp_icon_w, *execp_icon_h;
} Executor;
extern GArray *executors;

View file

@ -290,7 +290,8 @@ void config_write_taskbar(FILE *fp)
(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)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_name_font_set)))
fprintf(fp, "taskbar_name_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(taskbar_name_font)));
GdkColor color;
gtk_color_button_get_color(GTK_COLOR_BUTTON(taskbar_name_inactive_color), &color);
@ -389,7 +390,8 @@ void config_write_task(FILE *fp)
(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_spacing)));
fprintf(fp, "task_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(task_font)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(task_font_set)))
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);
// same for: "" _normal _active _urgent _iconified
@ -579,10 +581,12 @@ void config_write_clock(FILE *fp)
fprintf(fp, "time1_format = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_format_line1)));
fprintf(fp, "time2_format = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_format_line2)));
fprintf(fp, "time1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line1)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(clock_font_line1_set)))
fprintf(fp, "time1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line1)));
fprintf(fp, "time1_timezone = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_tmz_line1)));
fprintf(fp, "time2_timezone = %s\n", gtk_entry_get_text(GTK_ENTRY(clock_tmz_line2)));
fprintf(fp, "time2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line2)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(clock_font_line2_set)))
fprintf(fp, "time2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(clock_font_line2)));
GdkColor color;
gtk_color_button_get_color(GTK_COLOR_BUTTON(clock_font_color), &color);
@ -615,8 +619,10 @@ void config_write_battery(FILE *fp)
fprintf(fp, "battery_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_tooltip)) ? 1 : 0);
fprintf(fp, "battery_low_status = %g\n", gtk_spin_button_get_value(GTK_SPIN_BUTTON(battery_alert_if_lower)));
fprintf(fp, "battery_low_cmd = %s\n", gtk_entry_get_text(GTK_ENTRY(battery_alert_cmd)));
fprintf(fp, "bat1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line1)));
fprintf(fp, "bat2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line2)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_font_line1_set)))
fprintf(fp, "bat1_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line1)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(battery_font_line2_set)))
fprintf(fp, "bat2_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(battery_font_line2)));
GdkColor color;
gtk_color_button_get_color(GTK_COLOR_BUTTON(battery_font_color), &color);
config_write_color(fp,
@ -670,7 +676,8 @@ void config_write_execp(FILE *fp)
fprintf(fp, "execp_uwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_uwheel_command)));
fprintf(fp, "execp_dwheel_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_dwheel_command)));
fprintf(fp, "execp_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(executor->execp_font)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_font_set)))
fprintf(fp, "execp_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(executor->execp_font)));
GdkColor color;
gtk_color_button_get_color(GTK_COLOR_BUTTON(executor->execp_font_color), &color);
config_write_color(fp,
@ -710,7 +717,8 @@ void config_write_tooltip(FILE *fp)
color,
gtk_color_button_get_alpha(GTK_COLOR_BUTTON(tooltip_font_color)) * 100 / 0xffff);
fprintf(fp, "tooltip_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(tooltip_font)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tooltip_font_set)))
fprintf(fp, "tooltip_font = %s\n", gtk_font_button_get_font_name(GTK_FONT_BUTTON(tooltip_font)));
fprintf(fp, "\n");
}
@ -1120,9 +1128,11 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "bat1_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(battery_font_line1), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_font_line1_set), TRUE);
}
else if (strcmp(key, "bat2_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(battery_font_line2), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_font_line2_set), TRUE);
}
else if (strcmp(key, "battery_font_color") == 0) {
extract_values(value, &value1, &value2, &value3);
@ -1182,6 +1192,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "time1_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(clock_font_line1), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(clock_font_line1_set), TRUE);
}
else if (strcmp(key, "time1_timezone") == 0) {
gtk_entry_set_text(GTK_ENTRY(clock_tmz_line1), value);
@ -1191,6 +1202,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "time2_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(clock_font_line2), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(clock_font_line2_set), TRUE);
}
else if (strcmp(key, "clock_font_color") == 0) {
extract_values(value, &value1, &value2, &value3);
@ -1310,6 +1322,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "taskbar_name_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(taskbar_name_font), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_name_font_set), TRUE);
}
else if (strcmp(key, "taskbar_name_font_color") == 0) {
extract_values(value, &value1, &value2, &value3);
@ -1366,6 +1379,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "task_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(task_font), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(task_font_set), TRUE);
}
else if (g_regex_match_simple("task.*_font_color", key, 0, 0)) {
gchar** split = g_regex_split_simple("_", key, 0, 0);
@ -1602,6 +1616,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "tooltip_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(tooltip_font), value);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tooltip_font_set), TRUE);
}
/* Mouse actions */
@ -1664,6 +1679,7 @@ void add_entry(char *key, char *value)
}
else if (strcmp(key, "execp_font") == 0) {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(execp_get_last()->execp_font), value);
gtk_font_button_set_font_name(GTK_FONT_BUTTON(execp_get_last()->execp_font_set), value);
}
else if (strcmp(key, "execp_font_color") == 0) {
extract_values(value, &value1, &value2, &value3);