all repos — tint2 @ 57c38c462c8d706b58d33f306c0051db6296d9fe

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

Add support for battery tooltip option in tint2conf
Sebastian Reichel sre@ring0.de
commit

57c38c462c8d706b58d33f306c0051db6296d9fe

parent

995ae3c72be85dde0b48eaa3d99e3f602649f588

3 files changed, 20 insertions(+), 2 deletions(-)

jump to
M src/tint2conf/properties.csrc/tint2conf/properties.c

@@ -92,6 +92,7 @@ // 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_background; +GtkWidget *battery_tooltip; GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command; // systray

@@ -3829,6 +3830,20 @@ gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);

gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING); row = 0, col = 2; + label = gtk_label_new(_("Tooltips")); + 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++; + + battery_tooltip = gtk_check_button_new(); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_tooltip), 1); + gtk_widget_show(battery_tooltip); + gtk_table_attach(GTK_TABLE(table), battery_tooltip, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + gtk_tooltips_set_tip(tooltips, battery_tooltip, _("If enabled, shows a tooltip with detailed battery information when the mouse is moved over the battery widget."), NULL); + + row++, col = 2; label = gtk_label_new(_("Left click command")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_widget_show(label);
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -95,6 +95,7 @@ // 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_background; +extern GtkWidget *battery_tooltip; extern GtkWidget *battery_left_command, *battery_mclick_command, *battery_right_command, *battery_uwheel_command, *battery_dwheel_command; // systray
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -560,6 +560,7 @@ {

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

@@ -904,8 +905,9 @@ else if (strcmp(key, "battery") == 0) {

// Obsolete option config_has_battery = 1; config_battery_enabled = atoi(value); - } - else if (strcmp(key, "battery_low_status") == 0) { + } else if (strcmp(key, "battery_tooltip") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(battery_tooltip), atoi(value)); + } else if (strcmp(key, "battery_low_status") == 0) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(battery_alert_if_lower), atof(value)); } else if (strcmp(key, "battery_low_cmd") == 0) {