From: Claudio Cambra Date: Thu, 15 Sep 2022 16:18:12 +0000 (+0200) Subject: Improve flat buttons in share delegates X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~11^2~169^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6adefb572a7b9a0100b771fa7e2637dbcdaa91f8;p=nextcloud-desktop.git Improve flat buttons in share delegates Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/ShareDelegate.qml b/src/gui/filedetails/ShareDelegate.qml index 56cbe9edf..617e9af88 100644 --- a/src/gui/filedetails/ShareDelegate.qml +++ b/src/gui/filedetails/ShareDelegate.qml @@ -230,25 +230,27 @@ GridLayout { visible: text !== "" } - RowLayout { + RowLayout { Layout.row: 0 Layout.column: 2 Layout.rowSpan: root.rows Layout.fillHeight: true + spacing: 0 - Button { + CustomButton { id: createLinkButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: icon.width + (Style.standardSpacing * 2) + Layout.preferredWidth: Style.iconButtonWidth + Layout.preferredHeight: width - flat: true - display: AbstractButton.IconOnly - icon.color: Style.ncTextColor - icon.source: "qrc:///client/theme/add.svg" - icon.width: 16 - icon.height: 16 + toolTipText: qsTr("Create a new share link") + + bgColor: Style.lightHover + bgNormalOpacity: 0 + + imageSource: "qrc:///client/theme/add.svg" visible: root.isPlaceholderLinkShare && root.canCreateLinkShares enabled: visible @@ -256,16 +258,19 @@ GridLayout { onClicked: root.createNewLinkShare() } - Button { + CustomButton { id: copyLinkButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: icon.width + (Style.standardSpacing * 2) + Layout.preferredWidth: Style.iconButtonWidth + Layout.preferredHeight: width + + toolTipText: qsTr("Copy share link location") - flat: true - display: AbstractButton.IconOnly - icon.color: Style.ncTextColor - icon.source: "qrc:///client/theme/copy.svg" + bgColor: Style.lightHover + bgNormalOpacity: 0 + + imageSource: "qrc:///client/theme/copy.svg" icon.width: 16 icon.height: 16 @@ -282,18 +287,19 @@ GridLayout { TextEdit { id: clipboardHelper; visible: false} } - Button { + CustomButton { id: moreButton Layout.alignment: Qt.AlignCenter - Layout.preferredWidth: icon.width + (Style.standardSpacing * 2) + Layout.preferredWidth: Style.iconButtonWidth + Layout.preferredHeight: width - flat: true - display: AbstractButton.IconOnly - icon.color: Style.ncTextColor - icon.source: "qrc:///client/theme/more.svg" - icon.width: 16 - icon.height: 16 + toolTipText: qsTr("Share options") + + bgColor: Style.lightHover + bgNormalOpacity: 0 + + imageSource: "qrc:///client/theme/more.svg" visible: !root.isPlaceholderLinkShare enabled: visible diff --git a/src/gui/tray/CustomButton.qml b/src/gui/tray/CustomButton.qml index c132830be..f07acc31c 100644 --- a/src/gui/tray/CustomButton.qml +++ b/src/gui/tray/CustomButton.qml @@ -7,7 +7,8 @@ Button { id: root property string imageSource: "" - property string imageSourceHover: "" + property string imageSourceHover: imageSource + property var iconItem: icon property string toolTipText: "" diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index 9214c17ea..cba2ee9f3 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -51,6 +51,8 @@ QtObject { property int standardSpacing: 10 property int smallSpacing: 5 + property int iconButtonWidth: 36 + property int minActivityHeight: variableSize(40) property int currentAccountButtonWidth: 220