francma / wob

A lightweight overlay volume/backlight/progress/anything bar for Wayland.
ISC License
911 stars 50 forks source link

[WIP] Use struct for colors #33

Closed 7415963987456321 closed 4 years ago

7415963987456321 commented 4 years ago

Instead of having 3 different variables, put all the colors in a struct. Just wanted to get your input before I go further with this. I'm thinking that more could be done with change, i.e. maybe put the old_background_color inside the struct as well and maybe change the logic for that....
Also I have yet to fix the indentation.

francma commented 4 years ago

I like this :+1:

Maybe put the old_background_color inside the struct as well

Yes, that would be nice.

You can also drop color postfix from struct members as it is already clear from struct name that it is color.

Also I have yet to fix the indentation.

Check out clang-format - in most distributions it's part of a clang package. To fix indentation & coding styles you just run clang-format -i [file_name] and that's it.

7415963987456321 commented 4 years ago

All comments have been adressed, removed the postfix and fixed the indent.

francma commented 4 years ago

I think we misunderstood each other. By:

Maybe put the old_background_color inside the struct as well

I imagined having struct like this:

struct wob_colors {
    argb_color bar;
    argb_color background;
    argb_color border;
};

And have 2 variables - one for current color and one for old color.

7415963987456321 commented 4 years ago

Ah so you mean to have another instance of the wob_color struct for the old variables, that makes sense. EDIT: I've pushed some changes, should be correct now. Made another instance of the wob_colors struct for the old colors.

7415963987456321 commented 4 years ago

All comments adressed :)

francma commented 4 years ago

Thanks :slightly_smiling_face: