Replace use of CustomButton with standard Button

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-11-25 12:53:56 +01:00
parent 7dc8a7ab0c
commit b97ee9a61e
No known key found for this signature in database
GPG key ID: C839200C384636B0
12 changed files with 29 additions and 53 deletions

View file

@ -130,7 +130,7 @@ Page {
wrapMode: Text.Wrap
}
CustomButton {
Button {
id: closeButton
Layout.rowSpan: headerGridLayout.rows
@ -142,10 +142,7 @@ Page {
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
toolTipText: qsTr("Dismiss")
visible: root.showCloseButton
onClicked: root.closeButtonClicked()
}

View file

@ -152,11 +152,10 @@ GridLayout {
spacing: 0
CustomButton {
Button {
id: createLinkButton
Layout.alignment: Qt.AlignCenter
toolTipText: qsTr("Create a new share link")
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight
@ -171,7 +170,7 @@ GridLayout {
onClicked: root.createNewLinkShare()
}
CustomButton {
Button {
id: copyLinkButton
function copyShareLink() {
@ -190,8 +189,6 @@ GridLayout {
Layout.preferredWidth: shareLinkCopied ? implicitWidth : Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight
toolTipText: qsTr("Copy share link location")
text: shareLinkCopied ? qsTr("Copied!") : ""
icon.source: shareLinkCopied ? "image://svgimage-custom-color/copy.svg/" + palette.brightText :
@ -219,11 +216,9 @@ GridLayout {
}
}
CustomButton {
Button {
id: moreButton
toolTipText: qsTr("Share options")
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight

View file

@ -220,7 +220,7 @@ Page {
elide: Text.ElideRight
}
CustomButton {
Button {
id: closeButton
Layout.rowSpan: headerGridLayout.rows
@ -232,8 +232,6 @@ Page {
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
toolTipText: qsTr("Dismiss")
onClicked: root.closeShareDetails()
}
@ -716,26 +714,23 @@ Page {
}
}
CustomButton {
Button {
height: Style.standardPrimaryButtonHeight
icon.source: "image://svgimage-custom-color/close.svg/" + Style.errorBoxBackgroundColor
imageSourceHover: "image://svgimage-custom-color/close.svg/" + palette.brightText
icon.source: hovered
? "image://svgimage-custom-color/close.svg/" + palette.brightText
: "image://svgimage-custom-color/close.svg/" + Style.errorBoxBackgroundColor
text: qsTr("Unshare")
onClicked: root.deleteShare()
}
CustomButton {
Button {
height: Style.standardPrimaryButtonHeight
icon.source: "image://svgimage-custom-color/add.svg/" + root.accentColor
imageSourceHover: "image://svgimage-custom-color/add.svg/" + palette.brightText
icon.source: hovered
? "image://svgimage-custom-color/add.svg/" + palette.brightText
: "image://svgimage-custom-color/add.svg/" + root.accentColor
text: qsTr("Add another link")
visible: root.isLinkShare && root.canCreateLinkShares
enabled: visible
onClicked: root.createNewLinkShare()
}
}

View file

@ -52,7 +52,7 @@ ApplicationWindow {
Layout.fillWidth: true
}
CustomButton {
Button {
padding: Style.smallSpacing
text: qsTr("Reload")
onClicked: reloadMaterialisedItems(accountUserIdAtHost)

View file

@ -86,7 +86,7 @@ Item {
}
}
CustomButton {
Button {
id: deleteButton
Layout.minimumWidth: implicitWidth

View file

@ -149,12 +149,12 @@ Page {
elide: Text.ElideRight
}
CustomButton {
Button {
text: qsTr("Signal file provider domain")
onClicked: root.controller.signalFileProviderDomain(root.accountUserIdAtHost)
}
CustomButton {
Button {
text: qsTr("Create debug archive")
onClicked: root.controller.createDebugArchive(root.accountUserIdAtHost)
}

View file

@ -52,7 +52,7 @@ GridLayout {
horizontalAlignment: Text.AlignRight
}
CustomButton {
Button {
Layout.row: 0
Layout.column: 2
Layout.alignment: Layout.AlignRight | Layout.AlignVCenter

View file

@ -26,7 +26,7 @@ Repeater {
model: root.linksForActionButtons
CustomButton {
Button {
id: activityActionButton
property string verb: model.modelData.verb

View file

@ -158,7 +158,7 @@ RowLayout {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
spacing: Style.extraSmallSpacing
CustomButton {
Button {
id: fileDetailsButton
width: Style.activityListButtonWidth
@ -178,7 +178,7 @@ RowLayout {
onClicked: Systray.presentShareViewInTray(model.openablePath)
}
CustomButton {
Button {
id: dismissActionButton
width: Style.activityListButtonWidth

View file

@ -210,7 +210,7 @@ ApplicationWindow {
id: linksRepeater
model: root.links
CustomButton {
Button {
id: answerCall
readonly property string verb: modelData.verb
readonly property bool isAnswerCallButton: verb === "WEB"
@ -219,7 +219,6 @@ ApplicationWindow {
text: modelData.label
icon.source: root.talkIcon + palette.brightText
imageSourceHover: root.talkIcon + palette.brightText
Layout.fillWidth: true
Layout.preferredHeight: Style.callNotificationPrimaryButtonMinHeight
@ -233,15 +232,13 @@ ApplicationWindow {
Accessible.name: qsTr("Answer Talk call notification")
Accessible.onPressAction: answerCall.clicked()
}
}
CustomButton {
Button {
id: declineCall
text: qsTr("Decline")
icon.source: root.deleteIcon + "white"
imageSourceHover: root.deleteIcon + "white"
Layout.fillWidth: true
Layout.preferredHeight: Style.callNotificationPrimaryButtonMinHeight

View file

@ -739,7 +739,7 @@ ApplicationWindow {
active: false
sourceComponent: CustomButton {
sourceComponent: Button {
id: newActivitiesButton
hoverEnabled: true
padding: Style.smallSpacing
@ -767,9 +767,9 @@ ApplicationWindow {
OpacityAnimator {
id: fadeoutActivitiesButtonDisappear
target: newActivitiesButton;
from: 1;
to: 0;
target: newActivitiesButton
from: 1
to: 0
duration: Style.newActivityButtonDisappearFadeTimeout
loops: 1
running: false

View file

@ -84,13 +84,9 @@ RowLayout {
}
}
CustomButton {
Button {
id: syncNowButton
FontMetrics {
id: syncNowFm
}
Layout.rightMargin: Style.trayHorizontalMargin
text: qsTr("Sync now")
@ -109,11 +105,7 @@ RowLayout {
}
}
CustomButton {
Layout.preferredWidth: syncNowFm.boundingRect(text).width +
leftPadding +
rightPadding +
Style.standardSpacing * 2
Button {
Layout.rightMargin: Style.trayHorizontalMargin
text: qsTr("Resolve conflicts")