Skip to content
Snippets Groups Projects
Commit 500681fb authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

misc-qml: remove some dead code

Causes Binding loops in MaterialButton.
Seems like support for a previous Qt/QML version.

Change-Id: I32f71cb50a20c81e0354635c56a308821c6f5832
parent 8b09149e
No related branches found
Tags beta/202310101006
No related merge requests found
......@@ -94,87 +94,71 @@ AbstractButton {
return root.color;
}
contentItem: Item {
id: item
contentItem: RowLayout {
anchors.verticalCenter: parent.verticalCenter
spacing: hasIcon ? JamiTheme.preferredMarginSize : 0
Binding on implicitWidth {
when: root.preferredWidth === undefined || !root.Layout.fillWidth
value: item.childrenRect.width
}
implicitHeight: childrenRect.height
RowLayout {
anchors.verticalCenter: parent.verticalCenter
Binding on width {
when: root.preferredWidth !== undefined || root.Layout.fillWidth
value: root.availableWidth
}
Component {
id: iconComponent
spacing: hasIcon ? JamiTheme.preferredMarginSize : 0
Component {
id: iconComponent
ResponsiveImage {
source: source_
Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize
color: contentColorProvider
}
ResponsiveImage {
source: source_
Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize
color: contentColorProvider
}
}
Component {
id: animatedIconComponent
AnimatedImage {
source: animatedSource_
Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize
width: iconSize
height: iconSize
playing: true
fillMode: Image.PreserveAspectFit
mipmap: true
}
Component {
id: animatedIconComponent
AnimatedImage {
source: animatedSource_
Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize
width: iconSize
height: iconSize
playing: true
fillMode: Image.PreserveAspectFit
mipmap: true
}
}
Loader {
id: icon
property string source_
property string animatedSource_
active: hasIcon
Loader {
id: icon
Layout.preferredWidth: active * width
property string source_
property string animatedSource_
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: hasIcon ? JamiTheme.preferredMarginSize : undefined
sourceComponent: animatedSource_.length !== 0 ? animatedIconComponent : iconComponent
}
active: hasIcon
Text {
id: textButton
Layout.preferredWidth: active * width
Layout.rightMargin: {
if ((!hasIcon || root.preferredWidth === undefined) && !root.Layout.fillWidth)
return undefined;
return icon.width + JamiTheme.preferredMarginSize / 2 + parent.spacing;
}
Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: hasIcon ? JamiTheme.preferredMarginSize : undefined
sourceComponent: animatedSource_.length !== 0 ? animatedIconComponent : iconComponent
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Text {
id: textButton
leftPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textLeftPadding
rightPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textRightPadding
text: root.text
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.textAlignment
color: contentColorProvider
font.pixelSize: fontSize
Layout.rightMargin: {
if ((!hasIcon || root.preferredWidth === undefined) && !root.Layout.fillWidth)
return undefined;
return icon.width + JamiTheme.preferredMarginSize / 2 + parent.spacing;
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
leftPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textLeftPadding
rightPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textRightPadding
text: root.text
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.textAlignment
color: contentColorProvider
font.pixelSize: fontSize
}
}
......
......@@ -41,7 +41,6 @@ BaseModalDialog {
width: aboutPopUpContentRectColumnLayout.implicitWidth
height: Math.min(root.implicitHeight, aboutPopUpContentRectColumnLayout.implicitHeight)
Component.onCompleted: print(root.height, aboutPopUpContentRectColumnLayout.implicitHeight)
contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
ColumnLayout {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment