tint2conf: gradient config: do not add gradient 0 when missing
o9000 mrovi9000@gmail.com
2 files changed,
19 insertions(+),
9 deletions(-)
M
src/tint2conf/background_gui.c
→
src/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.c
→
src/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"); } }