Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color row widget #604

Merged
merged 10 commits into from
Jun 12, 2021
Merged

Add color row widget #604

merged 10 commits into from
Jun 12, 2021

Conversation

Alecaddd
Copy link
Member

Summary / How this PR fixes the problem?

This PR aims at removing some overhead from the connection between the item's components Fill and Border and the UI widgets.
Along the way it fixes some syncing issues between the input fields and color pickers, as well as creating reusable widgets and removing code duplication.

Steps to Test

Use the fills and borders as usual and nothing should look different.

Screenshots

TBD

Known Issues / Things To Do

  • I had to create a shared ColorModel in order to dynamically use the Fill or Border component in the same Widget. Maybe a better method is out there but I don't know.
  • I'm using an enum Type to distinguish the components in the UI, also maybe here there's a better approach we could use.'
  • The syncing between the ColorChooser and the ColorInput and OpacityInput it's a bit weird with a manual boolean variable set to prevent infinite loop. Maybe something smarter could be done?

This PR fixes/implements the following bugs/features:

  • Remove the Models for Fills and Colors and stops using the uber complicated Models/ListModel which is a bit overkill for what we need.
  • Removes a redundant layer of separation between the components and the UI.
  • Creates a reusable ColorRow widget shared between Borders and Fills.
  • Clean ups a lot of repeated code.
  • Hopefully makes things more linear.

@Alecaddd Alecaddd marked this pull request as ready for review June 11, 2021 05:03
@Alecaddd Alecaddd requested a review from mbfraga June 11, 2021 05:04
@Alecaddd Alecaddd added this to the v0.1.0 milestone Jun 11, 2021
@Alecaddd Alecaddd merged commit a13a8c7 into master Jun 12, 2021
@Alecaddd Alecaddd deleted the add-color-button-widget branch June 12, 2021 21:07
madjesc pushed a commit to madjesc/Akira that referenced this pull request Jun 28, 2021
* Move color picker code to its own class

* Move color field inside reusable color picker widget

* Move the opacity field in the color button widget

* Update the item fill color when the opacity field is changed

* Properly update colors and alpha of items and UI buttons

* Use a shared ColorModel for fills and borders

* Reload list of fill deletion

* Remove 2 way bindings for color fields

* Hook border to reusable UI widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants