-
-
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
Create Linear and Radial Gradients #605
Comments
We are dropping goocanvas library so working with anything related to goocanvas will be a waste of time |
@abdallah-moh The gradient is being drawn using Cairo.Pattern, and the only place where I am using GooCanvas is when dealing with the CanvasItem to be colored. If you are thinking of dropping GooCanvas, does that mean you will be using Cairo instead? In which case changing a couple of lines in the code should do the trick. Could you also point me to the branch where GooCanvas is being dropped so that I can start working off of that? |
@AshishS-1123 if the code doesn't depend on goocanvas to work you can open a pr on master |
And for the naming
|
@AshishS-1123 Hi, thank you so much for your interest in Akira and the starting of this contribution.
I'm not sure about this.
We don't do that.
Abdallah is misinformed. One important change that should land soon on Another important change that should land soon, is in PR #587. As a suggestion, I'd say for now focus on the UI of that widget in order to implement the different views for the gradients in the ColorPicker, and take a look at how other apps handle the multiple colors in a gradient.
Indeed, "solid color" instead of "simple" sounds better, but you're using mixed of plural and singular nouns, and also a mix of uppercase and lowercase.
Great start on this! |
Right now, when choosing a color, a popover is used. While this may have worked for solid colors, it creates a maneuverability issue for gradients. After choosing a stop color, if the user wishes to change the position/direction of a stop color, they have to close the popover. Sometimes the popover might also hide a canvas item. When the user clicks on the color button, the Fill object will expand and the color picker will appear there. If the user clicks on another fill object, this picker will disappear and make space for the new one. |
Mhh...that's an interesting proposal, but I'm not 100% sure about this. The mock-up is a bit too simplified to make an educated decision as there are a lot of missing elements that are always part of the color picker. My main concern is that if the user is handling a shape with multiple fill (or border) colors, they will most likely be forced to scroll down the panel in order to select another color, and when they do, the UI will jump around moving the currently selected color all the way up, therefore changing the focal point. I totally understand the points you're raising regarding Canvas focus, but I'm sure we can mitigate that by forcing the popup to stay open if the user selects the gradient controller that we will implement above the shape. |
Expected Behavior
One of the features in the Beta Wishlist is Gradients. I would like to work on adding it. I have already gotten a simple gradient working and will discuss my approach here.
If there are any changes to be made, please comment. If not, could any of the maintainers create a branch- like
WIP-gradients
for this feature?The following are some functionality this feature must have.
User Stories
Possible Solution
UI Changes
In the ColorPicker popover, add a dropdown menu. This menu will be created using Gtk.ComboBoxText.
The dropdown menu will contain 3 items
1. Simple Color: this will represent a simple, plain color.
2. Linear Gradient: this will represent a linear gradient.
3. Radial Gradient: this will represent a radial gradient.
The user can select what kind of fill they want.
Other that the dropdown menu, a direction line will also be created. This line will determine the direction of gradients. This line will only be present if "Linear Gradient" or "Radial Gradient" Mode is chosen.
The user can then drag this line around to change the direction of gradient. This is similar to how most graphics software products use gradients.
This is what the popover looks like after adding the dropdown menu
This is what the gradient looks like by default.
Code Changes
This approach looks a little too complicated to me, but when the user changes the color of a CanvasItem, these are the steps that happen, which is why I did the same.
I have implemented this, and can be found on my fork in the branch WIP-Gradient.
As of now, when the user selects the Linear Gradient or Radial Gradient mode, a static gradient of colors black and white and running diagonally appears. Its color or direction cannot be changed. The direction line also isn't created. But selecting another mode removes the gradient.
Future Work
Implement the remaining User Stories. There are also some bugs that cause the CanvasItem to draw Simple colors even when gradient mode is selected.
The text was updated successfully, but these errors were encountered: