Merge pull request #7217 from nextcloud/backport/7142/stable-3.14

[stable-3.14] Fix alignment and size of buttons.
This commit is contained in:
Matthieu Gallien 2024-09-26 16:11:09 +02:00 committed by GitHub
commit abbbc29e5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 25 deletions

View file

@ -134,11 +134,14 @@ Page {
id: closeButton id: closeButton
Layout.rowSpan: headerGridLayout.rows Layout.rowSpan: headerGridLayout.rows
Layout.preferredWidth: Style.iconButtonWidth Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: width Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.rightMargin: headerGridLayout.textRightMargin Layout.rightMargin: headerGridLayout.textRightMargin
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
toolTipText: qsTr("Dismiss") toolTipText: qsTr("Dismiss")
visible: root.showCloseButton visible: root.showCloseButton

View file

@ -186,9 +186,9 @@ GridLayout {
property bool shareLinkCopied: false property bool shareLinkCopied: false
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: shareLinkCopied ? implicitWidth : Style.iconButtonWidth Layout.preferredWidth: shareLinkCopied ? implicitWidth : Style.activityListButtonWidth
Layout.preferredHeight: Style.iconButtonWidth Layout.preferredHeight: Style.activityListButtonHeight
toolTipText: qsTr("Copy share link location") toolTipText: qsTr("Copy share link location")
@ -232,15 +232,15 @@ GridLayout {
CustomButton { CustomButton {
id: moreButton id: moreButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: Style.iconButtonWidth
Layout.preferredHeight: width
toolTipText: qsTr("Share options") toolTipText: qsTr("Share options")
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
icon.source: "image://svgimage-custom-color/more.svg/" + palette.buttonText icon.source: "image://svgimage-custom-color/more.svg/" + palette.buttonText
icon.width: Style.smallIconSize icon.width: Style.activityListButtonIconSize
icon.height: Style.smallIconSize icon.height: Style.activityListButtonIconSize
visible: !root.isPlaceholderLinkShare && !root.isSecureFileDropPlaceholderLinkShare && !root.isInternalLinkShare visible: !root.isPlaceholderLinkShare && !root.isSecureFileDropPlaceholderLinkShare && !root.isInternalLinkShare
enabled: visible enabled: visible

View file

@ -224,11 +224,14 @@ Page {
id: closeButton id: closeButton
Layout.rowSpan: headerGridLayout.rows Layout.rowSpan: headerGridLayout.rows
Layout.preferredWidth: Style.iconButtonWidth Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: width Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.rightMargin: root.padding Layout.rightMargin: root.padding
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText icon.source: "image://svgimage-custom-color/clear.svg" + "/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
toolTipText: qsTr("Dismiss") toolTipText: qsTr("Dismiss")
onClicked: root.closeShareDetails() onClicked: root.closeShareDetails()
@ -764,7 +767,13 @@ Page {
height: Style.standardPrimaryButtonHeight height: Style.standardPrimaryButtonHeight
Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
icon.source: "image://svgimage-custom-color/copy.svg/" + palette.brightText icon.source: "image://svgimage-custom-color/copy.svg/" + palette.brightText
icon.width: Style.smallIconSize
icon.height: Style.smallIconSize
text: shareLinkCopied ? qsTr("Share link copied!") : qsTr("Copy share link") text: shareLinkCopied ? qsTr("Share link copied!") : qsTr("Copy share link")
visible: root.isLinkShare visible: root.isLinkShare
enabled: visible enabled: visible

View file

@ -159,11 +159,13 @@ RowLayout {
CustomButton { CustomButton {
id: fileDetailsButton id: fileDetailsButton
Layout.preferredWidth: Style.dismissButtonSize Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.dismissButtonSize Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignTop | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
icon.source: "image://svgimage-custom-color/more.svg/" + palette.buttonText icon.source: "image://svgimage-custom-color/more.svg/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
ToolTip { ToolTip {
text: qsTr("Open file details") text: qsTr("Open file details")
@ -171,8 +173,6 @@ RowLayout {
} }
display: Button.IconOnly display: Button.IconOnly
leftPadding: 0
rightPadding: 0
visible: model.showFileDetails visible: model.showFileDetails
@ -182,17 +182,15 @@ RowLayout {
CustomButton { CustomButton {
id: dismissActionButton id: dismissActionButton
Layout.preferredWidth: Style.dismissButtonSize Layout.preferredWidth: Style.activityListButtonWidth
Layout.preferredHeight: Style.dismissButtonSize Layout.preferredHeight: Style.activityListButtonHeight
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
visible: root.showDismissButton && !fileDetailsButton.visible
icon.source: "image://svgimage-custom-color/clear.svg/" + palette.buttonText icon.source: "image://svgimage-custom-color/clear.svg/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize
display: Button.IconOnly display: Button.IconOnly
leftPadding: 0
rightPadding: 0
ToolTip { ToolTip {
text: qsTr("Dismiss") text: qsTr("Dismiss")

View file

@ -105,6 +105,9 @@ QtObject {
property int addAccountButtonHeight: 50 property int addAccountButtonHeight: 50
property int activityListButtonWidth: 42
property int activityListButtonHeight: 32
property int activityListButtonIconSize: 18
property int headerButtonIconSize: 32 property int headerButtonIconSize: 32
property int addButtonIconSize: 26 property int addButtonIconSize: 26
property int dismissButtonSize: 26 property int dismissButtonSize: 26