all repos — tint2 @ 6ae4c0a9a8add160d7108b41e65e181301897261

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

tint2conf: leave font setting to default if not set
o9000 mrovi9000@gmail.com
commit

6ae4c0a9a8add160d7108b41e65e181301897261

parent

abbf44bab7192b9f08bbb7bf20a191007415888f

4 files changed, 124 insertions(+), 31 deletions(-)

jump to
M sample/tint2rcsample/tint2rc

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

# 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
M src/tint2conf/properties.csrc/tint2conf/properties.c

@@ -51,7 +51,8 @@

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

// 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 @@ // clock

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, *systray_icon_brightness;

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;

@@ -227,6 +231,11 @@ void okClicked(GtkWidget *widget, gpointer data)

{ applyClicked(widget, 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()

@@ -3119,8 +3128,14 @@ gtk_table_attach(GTK_TABLE(table), taskbar_name_inactive_color, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);

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 @@ gtk_table_attach(GTK_TABLE(table), taskbar_name_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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 @@ gtk_table_attach(GTK_TABLE(table), task_spacing, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);

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 @@ gtk_table_attach(GTK_TABLE(table), task_font, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);

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

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 @@ gtk_table_attach(GTK_TABLE(table), clock_font_line1, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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 = 2; + 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++; + label = gtk_label_new(_("Font second line")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label);

@@ -4026,6 +4065,8 @@ gtk_table_attach(GTK_TABLE(table), clock_font_line2, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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

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 @@ gtk_widget_show(executor->execp_font);

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

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 @@ gtk_table_attach(GTK_TABLE(table), battery_font_line1, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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 = 2; + 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++; + label = gtk_label_new(_("Font second line")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label);

@@ -5030,6 +5093,8 @@ gtk_table_attach(GTK_TABLE(table), battery_font_line2, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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

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 @@ gtk_table_attach(GTK_TABLE(table), tooltip_font, col, col+3, row, row+1, GTK_FILL, 0, 0, 0);

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"));
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -52,7 +52,8 @@

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

// 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 @@ // clock

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_saturation, *systray_icon_brightness;

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 @@ GtkWidget *execp_command, *execp_interval, *execp_has_icon, *execp_cache_icon, *execp_show_tooltip;

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;
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -290,7 +290,8 @@ (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))); + 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 @@ "task_padding = %d %d %d\n",

(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 @@ fprintf(fp, "# Clock\n");

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

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 @@ fprintf(fp, "execp_mclick_command = %s\n", gtk_entry_get_text(GTK_ENTRY(executor->execp_mclick_command)));

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 @@ "tooltip_font_color",

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 @@ gtk_entry_set_text(GTK_ENTRY(battery_alert_cmd), 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 @@ gtk_entry_set_text(GTK_ENTRY(clock_format_line2), 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 @@ gtk_entry_set_text(GTK_ENTRY(clock_tmz_line2), 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 @@ gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_name_active_background), id);

} 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 @@ if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(task_spacing), atoi(value3));

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

} 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 @@ gtk_entry_set_text(GTK_ENTRY(execp_get_last()->execp_dwheel_command), 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);