Repository navigation
feat: added support for setting playback interval through movable buttons - #2765
Conversation
|
Looks good.
I think maybe better to make them as icons? In this case, the artist will be able to draw them himself. |
yes, i think the on hover cursor is a good idea to notify the users that it is movable. But since they are able to be moved in both directions along the x axis why not just this one for both ? |
|
I added the "ew-resize" cursor, however, if other two cursors are more suitable, I could just switch them up it wouldn't be a big deal. ~~ regarding making them as icons. I saw that the icon would have to be rendered into a pixbuf then the pixbuff would be used in the cairo rectangle/context but I dont quite know yet how I would put the icon into the pixbuf, im looking into how to do it, in the documentation it mentions using
update: ok I think now its working I just need to make the icon. update: I made a test icon and set it and everything looks to be working fine, so I'll just spend some time making the icon and then I will hopefully be committing in a bit. |
|
@ice0 done. |
| cr->paint(); | ||
| cr->restore(); | ||
|
|
||
| Glib::RefPtr<Gdk::Pixbuf> icon; |
There was a problem hiding this comment.
ok sounds good will do.
|
ok, now when the added icon is 100 x 200 pixels it should be showing fine, I also added a bit of extra buffer width for the rectangle to be safe. |
| lower_boundary_pixbuf = icon_theme->load_icon("bound_button_icon_lower", 1); | ||
| upper_boundary_pixbuf = icon_theme->load_icon("bound_button_icon_upper", 1); |
There was a problem hiding this comment.
There is no need to this "1". Or is there?
There was a problem hiding this comment.
This is the desired icon size.
|
Hmm, looks like I messed something up while renaming the icon , will look into it when I get back home/ in the morning. |
|
unfortunately, we are having a power outage now for the past 3/4 hours or so but they say it will end soon I was just about to push a commit in the very latest feature but power went out and laptop is about to die soon :( . will push the commit when power comes back then resolve the comments here. update: power is back finally i'll push the commit in the latest feature then update here ( looks like this is gonna be delayed till morning it got really late :( ) |
| virtual void draw_background(const Cairo::RefPtr<Cairo::Context> &cr); | ||
|
|
||
| void get_bounds_rectangle_dimensions(double& x0, double& x1, double& w , bool lower); | ||
| const double boundary_dimension =8; |
There was a problem hiding this comment.
ugh. It is used in more than one method, so we cannot reduce its scope.
However, if we decide to change the default value, it will force recompilation of any file that #includes Widget_TimeSlider.h
@ice0 opinion?
There was a problem hiding this comment.
Agree.
@mohamedAdhamc Can you explain how it is used?
There was a problem hiding this comment.
boundary_dimension is the width of the draggable handle.
It's used in
1- Widget_Timeslider::on_draw in the process of rendering using cairo to set the dimensions for the bound rectangles and the bound handle.
2- it is also used in the button press and motion notify event to know if the press/ position of the mouse is within the boundaries of the "bound handle"
I guess then we can move it to the cpp file as a global along with the other constants already there.
There was a problem hiding this comment.
I think it might be much easier to use Gtk::Image for handles?
It supports event handling, knows the position and size, and we can control the boundaries with margins.
Am I missing something here?
There was a problem hiding this comment.
I think it might be much easier to use
Gtk::Imagefor handles? It supports event handling, knows the position and size, and we can control the boundaries with margins. Am I missing something here?
well the thing is the whole "timetrack/timeslide/playback area" is drawn with cairo surfaces, I mean the play bounds, the patterns, etc... and it isnt resizable. so I think it kind of makes sense to have this bound handle be the same as well to be moved in the same manner and for overall consistency. An image may make it easier to be resized and all ----- even though really that isn't necessarily needed the only thing needed if a user would want to replace the icon he just needs to make sure to replace it with an icon of the same size and everything should be fine, which I think shouldnt be too foreign as although im not exactly sure but I think replacing any other icon with another of incorrect size may cause problems -----, but I'm not sure how reliable moving a gtk::image would be in terms of being moved around the time track/slider .
There was a problem hiding this comment.
I don't know if it be better, but you could use a Gtk::Overlay that contains a Gtk::Fixed to then include the Gtk::Images
|
alright, I spent most of the day today working on the latest feature, I'm now heading out and hopefully, when I come back in a couple of hours I will address the comments before I sleep. |
|
done |
|
@rodolforg, done :) p.s. I believe the deadline for the mentor mid- evaluation is sometime tomorrow the 12th. they probably should've sent out an email, but I'm notifying here just in case as my timeline is non-standard. |
I'm "letting" @ice0 and @morevnaproject decide here XD
Hmm, I'm not sure either if it could be a problem - that is better left for you guys to decide- but if it is of any help. The reason I thought it may be helpful is while moving the bound knowing the exact place where it is, and if there is already an animation in place it lets you visualise which part of it you are bounding as was shown in the video above. |
Before: After: As for me now it's more clear what is going on here.
cursor-issue.mp4 |
- renamed from button to handle - also I accidently set boundary_dimensinon to 80 so here its back to 8
handling also a not thought of case which is when the bounds are not even enabled, we don't need to handle moving them.
59a347d to
2d389f3
Compare
Exactly my reaction when I received the "approved" email notification a few hours back XD. |
|
Should I merge, @mohamedAdhamc ? XD I think I'll squash all commits then merge. What do you think? |
Konstantin approved so I'm assuming things are good 😄 . I'll also give it one final test from my side as extra precaution. update: tested, seems to be functioning as expected.
Yes sure, I think most of the commits were just multiple fixes and adjustments anyways. |
|
Thank you for attempting to improve your contribution description! ✨ New Features
|
|
Nice catches, qt creator has the tendency to be really weird with indentations, it wasn't even showing me some of the tabs correctly now xD. Btw -sidenote- has there even been a clang file made for synfig ? I don't recall one being mentioned before. Maybe if we make one that only targets indentation for pr specific changes it could be helpful in reviews just to ask people to run it. What do you think ? |
I'm trying to create one, but it still has some issues. |
|
Thank you for attempting to improve your contribution description! ✨ New Features
|
|
Thank you for attempting to improve your contribution description! ✨ New Features
|
|
Merged! Thank you for your contribution. |











Quick description of what I did in terms of implementation.
Things that need opinions:
Feature:
bounds.feature.mp4
Fix #1493