-
Notifications
You must be signed in to change notification settings - Fork 283
TimeLineCells rewrite part 1 #1880
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
base: master
Are you sure you want to change the base?
Conversation
This simplifies the painting of layers by moving the layer header into its own widget. The list is no longer based on our own scrolling logic but has instead been put into a QScrollArea.
Because the map we're iterating on has been detached and erased in the meantime.
and re-implement vertical scrolling
So that we can easily extend this interface in the future
- Gutter now only appears when the layer will move to a different position - Bottom layer (camera layer) cannot be dragged anymore - Made the gutter visual more clear
Because this is not handled by double clicking on the layer label
Oh, that sounds cool! |
Not at the moment but I'll look into it. |
Nice catch! I'll look into fixing that. Thanks for testing @DearFox |
I've made another fix for the undo behavior after editing finished. Now it should behave more like a cancel function. As for the camera dialog, yes it's intentionally still accessible through the the camera layer, by pressing on the icon or near it. While I know that some applications like Flash, OpenToonz and possibly also ToonBoom just add another panel, I don't want to add that kind of clutter to the interface, even if it is temporary. There needs to be a very good reason for a feature to exist as a docked widget. The "Options" panel changes depending on the tool for the given layer, compared to the camera resolution which affects all key frames. While we could maybe add a Layer options panel, we would need to have more than one or two things for each layer to justify it being a docked widget in my opinion. There's also still no guarantee that this would solve our infamous problem with the dialog being difficult to access since you would still need to click on the camera layer to access it. I'll think about it... 🤔 |
This PR consists of a rewrite of the timeline cells part where:
This component currently consist of a single button which is the layer visibility dot but has been built so it can be extended trivially
A shared component that can either be used to control the local visibility state or the global, depending on the context it's created with.
a full rewrite of the layer logic of TimeLineLayerCells, now built using these widgets.
The layer list also takes care of delegating information back to the track list and handles the dragging functionality of each cell.
A base call for the different potential cell types, although right now it's only used for TimeLineLayerCell.
A derivetive of TimeLineBaseCell that is mostly a container for the TimeLineLayerCellEditorWidget. It sets the base geometry for the editor widget when created and takes care of cleaning it up when removed
The component that actually draws the layer cell. Now a QWidget with a simple QHBoxLayout. The editor widget also contains a new widget, namely LineEditWidget.
A generic component that can be used to edit a line of text, exists because Qt's own QLineEdit does not auto select the entire text when used...
For the timeline layer component, this widget can be used to edit the name of the layer, by double-clicking.
The component that draws the layer gutter, which is either shown or hidden but always exist as a overlay widget on top of the list.
The header component consists of drawing of track numbers, small scrubber and the onion skin logic.
The logic has been left mostly intact.
TimelineTrackList is mostly a refactoring of the existing logic in TimeLineCells that handled the track, frame visualization and selection logic.
Here's what the timeline look like now:

A bunch of other changes and improvements made along the way:
You can see the improvements in action here:

TLDR
The left part of the timeline, namely the layer cells has been rewritten to use widgets, are now easier to maintain and extend.
The right part of the timeline, namely the track cells have been left mostly untouched and in large parts have just been moved into it's own component but still uses QPainter and contain the same logic as before.
fixes #1849