-
Notifications
You must be signed in to change notification settings - Fork 272
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
TimeLineCells rewrite part 1 #1880
Open
MrStevns
wants to merge
41
commits into
pencil2d:master
Choose a base branch
from
MrStevns:timeline-rewrite-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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