all repos — tint2 @ 4c45538f6eadccbc3357a3af3bc6a8b9a0536286

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

tint2conf: gradient config: do not add gradient 0 when missing
o9000 mrovi9000@gmail.com
commit

4c45538f6eadccbc3357a3af3bc6a8b9a0536286

parent

e3e81505b9385c0b12c732a08107c7051b803403

2 files changed, 19 insertions(+), 9 deletions(-)

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

@@ -427,7 +427,7 @@ &borderColor,

bgColBorderOpacity, borderOpacity, bgColGradientId, - 0, + -1, bgColBorderWidth, b, bgColCornerRadius,

@@ -443,7 +443,7 @@ &borderColorOver,

bgColBorderOpacityOver, borderOpacityOver, bgColGradientIdOver, - 0, + -1, bgColFillColorPress, &fillColorPress, bgColFillOpacityPress,

@@ -453,7 +453,7 @@ &borderColorPress,

bgColBorderOpacityPress, borderOpacityPress, bgColGradientIdPress, - 0, + -1, bgColBorderSidesTop, sideTop, bgColBorderSidesBottom,

@@ -502,6 +502,7 @@ GdkColor *fillColorPress;

int fillOpacityPress; GdkColor *borderColorPress; int borderOpacityPress; + int gradient_id, gradient_id_over, gradient_id_press; gtk_tree_model_get(GTK_TREE_MODEL(backgrounds), &iter,

@@ -541,6 +542,12 @@ bgColBorderSidesLeft,

&sideLeft, bgColBorderSidesRight, &sideRight, + bgColGradientId, + &gradient_id, + bgColGradientIdOver, + &gradient_id_over, + bgColGradientIdPress, + &gradient_id_press, -1); gtk_list_store_append(backgrounds, &iter);

@@ -555,7 +562,7 @@ fillOpacity,

bgColBorderColor, borderColor, bgColGradientId, - 0, + gradient_id, bgColBorderOpacity, borderOpacity, bgColText,

@@ -569,7 +576,7 @@ borderColorOver,

bgColBorderOpacityOver, borderOpacityOver, bgColGradientIdOver, - 0, + gradient_id_over, bgColFillColorPress, fillColorPress, bgColFillOpacityPress,

@@ -579,7 +586,7 @@ borderColorPress,

bgColBorderOpacityPress, borderOpacityPress, bgColGradientIdPress, - 0, + gradient_id_press, bgColBorderWidth, b, bgColCornerRadius,
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -235,13 +235,16 @@ fprintf(fp, "border_sides = %s\n", sides);

config_write_color(fp, "background_color", *fillColor, fillOpacity); config_write_color(fp, "border_color", *borderColor, borderOpacity); - fprintf(fp, "gradient_id = %d\n", gradient_id); + if (gradient_id >= 0) + fprintf(fp, "gradient_id = %d\n", gradient_id); config_write_color(fp, "background_color_hover", *fillColorOver, fillOpacityOver); config_write_color(fp, "border_color_hover", *borderColorOver, borderOpacityOver); - fprintf(fp, "gradient_id_hover = %d\n", gradient_id_over); + if (gradient_id_over >= 0) + fprintf(fp, "gradient_id_hover = %d\n", gradient_id_over); config_write_color(fp, "background_color_pressed", *fillColorPress, fillOpacityPress); config_write_color(fp, "border_color_pressed", *borderColorPress, borderOpacityPress); - fprintf(fp, "gradient_id_pressed = %d\n", gradient_id_press); + if (gradient_id_press >= 0) + fprintf(fp, "gradient_id_pressed = %d\n", gradient_id_press); fprintf(fp, "\n"); } }