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
No related tags found
No related merge requests found
...@@ -94,87 +94,71 @@ AbstractButton { ...@@ -94,87 +94,71 @@ AbstractButton {
return root.color; return root.color;
} }
contentItem: Item { contentItem: RowLayout {
id: item anchors.verticalCenter: parent.verticalCenter
spacing: hasIcon ? JamiTheme.preferredMarginSize : 0
Binding on implicitWidth { Component {
when: root.preferredWidth === undefined || !root.Layout.fillWidth id: iconComponent
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
}
spacing: hasIcon ? JamiTheme.preferredMarginSize : 0 ResponsiveImage {
source: source_
Component { Layout.preferredWidth: iconSize
id: iconComponent Layout.preferredHeight: iconSize
color: contentColorProvider
ResponsiveImage {
source: source_
Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize
color: contentColorProvider
}
} }
}
Component { Component {
id: animatedIconComponent id: animatedIconComponent
AnimatedImage { AnimatedImage {
source: animatedSource_ source: animatedSource_
Layout.preferredWidth: iconSize Layout.preferredWidth: iconSize
Layout.preferredHeight: iconSize Layout.preferredHeight: iconSize
width: iconSize width: iconSize
height: iconSize height: iconSize
playing: true playing: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
mipmap: true mipmap: true
}
} }
}
Loader { Loader {
id: icon id: icon
property string source_
property string animatedSource_
active: hasIcon
Layout.preferredWidth: active * width property string source_
property string animatedSource_
Layout.alignment: Qt.AlignVCenter active: hasIcon
Layout.leftMargin: hasIcon ? JamiTheme.preferredMarginSize : undefined
sourceComponent: animatedSource_.length !== 0 ? animatedIconComponent : iconComponent
}
Text { Layout.preferredWidth: active * width
id: textButton
Layout.rightMargin: { Layout.alignment: Qt.AlignVCenter
if ((!hasIcon || root.preferredWidth === undefined) && !root.Layout.fillWidth) Layout.leftMargin: hasIcon ? JamiTheme.preferredMarginSize : undefined
return undefined; sourceComponent: animatedSource_.length !== 0 ? animatedIconComponent : iconComponent
return icon.width + JamiTheme.preferredMarginSize / 2 + parent.spacing; }
}
Layout.fillWidth: true Text {
Layout.alignment: Qt.AlignHCenter id: textButton
leftPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textLeftPadding Layout.rightMargin: {
rightPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textRightPadding if ((!hasIcon || root.preferredWidth === undefined) && !root.Layout.fillWidth)
text: root.text return undefined;
elide: Text.ElideRight return icon.width + JamiTheme.preferredMarginSize / 2 + parent.spacing;
verticalAlignment: Text.AlignVCenter
horizontalAlignment: root.textAlignment
color: contentColorProvider
font.pixelSize: fontSize
} }
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 { ...@@ -41,7 +41,6 @@ BaseModalDialog {
width: aboutPopUpContentRectColumnLayout.implicitWidth width: aboutPopUpContentRectColumnLayout.implicitWidth
height: Math.min(root.implicitHeight, aboutPopUpContentRectColumnLayout.implicitHeight) height: Math.min(root.implicitHeight, aboutPopUpContentRectColumnLayout.implicitHeight)
Component.onCompleted: print(root.height, aboutPopUpContentRectColumnLayout.implicitHeight)
contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
ColumnLayout { 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