-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Linear and Radial Gradients feature on CanvasItems #621
Conversation
The ColorRow widget should be used only for handling widgets in the row. When colors change, the ColorMode class should change colors based on the mode. Also added ColorMode widget
This widget consists of 3 buttons that select the Solid, Linear Gradient or Radial Gradient color mode. When the Linear or Radial Gradient mode button is clicked, an EventBox appears. This eventbox an be used to set the stop colors for gradient.
This is a Gtk.EventBox. It only becomes active in Linear or Radial gradient mode. Clicking on the event box adds a new stop color.
@AshishS-1123 Could you center the color options |
No, don't center them. Thank you so much for this initial PR. I'll take some time to review it and give you some detailed feedback for both code and UI. |
I finally had some time to look at this PR and it looks very promising.
There are other various things that could be improved, but I think this is enough for now :D |
Marking this as Draft since it needs more work. |
All of these have been implemented.
@Alecaddd I don't understand what you mean by this. I have used Adobe XD, and they seem to be placing the first and last stop colors at the corners. Since these stop points are centered at the edges of the GradientEditor, half side of them would have to be hidden.
Dragging the first and last stop colors will reduce the space available for the user to add more stop colors in between them. Instead the user should move the nobs of direction line Some of the additional features implemented are-
If everything else is okay, should I mark this as Ready for review. |
This is getting better and better, thanks. |
Awesome stuff! Will review as soon as I have time :) |
Closing this since we're targeting the |
Summary / How this PR fixes the problem?
UI Changes
Gtk.EventBox
is used to place stop colors on the gradients. It only becomes active in Linear Gradient or Radial Gradient mode.EventBox
and the selected CanvasItem instantaneously.Gtk.EventBox
.Code Changes
Steps to Test
Screenshots
Known Issues / Things To Do
Select an item, then apply gradient to it and change the direction,
Then select the item again and select gradient. The direction resets to its initial position.
Fix: Use the gradient pattern from ColorModel to figure out the initial positions of gradient.
Select an item and apply gradient to it.
Delete the fill item and create a new fill item.
Selecting gradient mode in this fill item crashes the app.
This PR fixes/implements the following bugs/features: