Skip to content
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

Fix binding loop in AudioResourceControl, and simplify #25955

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Item {
Loader {
id: activityLoader

Layout.preferredWidth: activityLoader.active ? root.height : 0
Layout.preferredHeight: root.height
Layout.fillHeight: true
Layout.preferredWidth: root.height
Layout.alignment: Qt.AlignLeft

visible: root.supportsByPassing && root.showAdditionalButtons
Expand Down Expand Up @@ -161,16 +161,15 @@ Item {
id: titleLoader

Layout.fillWidth: true
Layout.preferredHeight: root.height
Layout.fillHeight: true

visible: root.supportsTitle
active: visible

sourceComponent: FlatButton {
id: titleButton

height: root.height
width: titleLoader.width
anchors.fill: parent

enabled: root.showAdditionalButtons
? (root.resourceItemModel ? root.resourceItemModel.hasNativeEditorSupport : false)
Expand Down Expand Up @@ -230,9 +229,8 @@ Item {
}

contentItem: StyledTextLabel {
// To do: this causes a binding loop warning
width: titleLoader.width - 8 // 4px padding on each side
height: root.height
width: titleButton.width - 8 // 4px padding on each side
height: titleButton.height

text: root.title
}
Expand All @@ -247,8 +245,8 @@ Item {
id: selectorLoader

Layout.fillWidth: !titleLoader.visible
Layout.fillHeight: true
Layout.preferredWidth: root.height
Layout.preferredHeight: root.height
Layout.alignment: Qt.AlignRight

visible: root.showAdditionalButtons && root.supportsMenu
Expand All @@ -268,12 +266,12 @@ Item {
}

contentItem: Item {
width: titleLoader.visible ? root.height : root.width
height: root.height
width: menuButton.width
height: menuButton.height

StyledIconLabel {
anchors.right: parent.right
width: selectorLoader.Layout.preferredWidth
width: titleLoader.visible ? parent.width : parent.height
height: parent.height
iconCode: IconCode.SMALL_ARROW_DOWN
}
Expand Down