Repository navigation
7613 effect panel - #7637
7613 effect panel#7637
Conversation
a111cef to
bd3fafb
Compare
There was a problem hiding this comment.
The diff tool didn't really get the change here:
This ColumnLayout actually didn't change, except for its indentation and anchors.fill: parent which got replaced by
Layout.fillWidth: true
Layout.fillHeight: true
So from here on, there are no changes left in this file.
There was a problem hiding this comment.
I would suggest using section in name, as it is misleading with our real panels
There was a problem hiding this comment.
I don't mind, but what is it that you call "panel" ? Those dockable guys ?
There was a problem hiding this comment.
Can you please explain what's going on here?
There was a problem hiding this comment.
Yes:
ProjectPage constructs a TracksTitleBar (A) and a TracksPanel (B). Before this change, these two only had to fill the width of their parent.
Now, optionally, A' and B' will appear, meaning TracksTitleBar and TracksPanel need to use the same width so the end result looks like a regular grid.

In C++, I'd probably just add a non-optional ctor argument to these classes, and this would be passed by ProjectPage.
But I don't know of non-optional ctor args in QML. These lines you've commented were a feeble attempt from me to solve this: ProjectPage, when instantiating these two guys, would have to specify TracksTitleBar { effectsPanelWidth: 240 } and likewise for TracksPanel, and if it doesn't, I issue a warning.
I think the proper way would actually be to have a global constant for these two guys to reuse, but I thought you and Greg might teach me some best practice during the review?
There was a problem hiding this comment.
The title bar width is calculated based on the parent width (anchors.fill: parent for root), so it looks like you don't need to calculate anything extra here.
try without these manipulations
There was a problem hiding this comment.
Yes, the title bar width is calculated based on the parent width, but then internally it has to know the relative width of its two sections, so I'm afraid there's no way around these manipulations.
There was a problem hiding this comment.
you can use effectsTitleBar directly
or even better make an alias for root
property alias showEffectsPanel: effectsTitleBar.visible
There was a problem hiding this comment.
qsTrc("projectscene", "Effects")
bd3fafb to
cf09dc0
Compare
There was a problem hiding this comment.
In qml there is a concept of binding: if you assign one property to another property (line 175), the value is automatically assigned to the first property when the second property changes. But if you later assign a fixed value to the first property, as in this line, then the binding stops working.
You of course need to remove the entire onShowEffectsSectionChanged block because you are already doing the same thing from line 175
There was a problem hiding this comment.
Is binding really what's happening line 175 in this case, though?
root.verticalPanelDefaultWidth + (showEffectsSection ? effectsSectionWidth : 0) isn't a property but an expression using properties.
I would really have liked this to work, but I tried your suggestion and indeed, it doesn't.
There was a problem hiding this comment.
please add new line before this line
There was a problem hiding this comment.
please add new line before this line
There was a problem hiding this comment.
I wasn't the author, I'm certainly not going to begin applying rules I don't hold for important to code I haven't modified.
There was a problem hiding this comment.
please add new line before this line
also this is old style for qml, you should use function like for onAddRequested
There was a problem hiding this comment.
Line 85 of this file is onInited: {, and git tells me you're the author.
There was a problem hiding this comment.
@Eism By the way, what our codestyle says about arrow function syntax?
There was a problem hiding this comment.
Using functions is necessary to resolve warnings in qml so that we can use the arrow function because it is also a function :)
There was a problem hiding this comment.
I'll pay attention to this warning, thanks for the info.
There was a problem hiding this comment.
Ok, that one's obvious :D
There was a problem hiding this comment.
id always comes first in properties
e1f3660 to
7523bc9
Compare
There was a problem hiding this comment.
try adding it here:
spacing: 0There are multiple items within layout and it probably has some default spacing set (which is more than 0, hence vertical misalignment)
7523bc9 to
94bc009
Compare
Resolves: #7613
Recommended: