Make unshare button less prominent, move out of bottom button box
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 23 Nov 2022 13:33:49 +0000 (14:33 +0100)
committerClaudio Cambra <claudio.cambra@gmail.com>
Fri, 9 Dec 2022 11:54:09 +0000 (12:54 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/ShareDetailsPage.qml
src/gui/tray/CustomButton.qml
src/gui/tray/NCButtonBackground.qml

index 403b228c98c61ee1901475c1a3ee41be161c2778..ade22ea19f515328cafab115b24b101903f4220e 100644 (file)
@@ -715,27 +715,30 @@ Page {
                         }
                     }
                 }
+
+                CustomButton {
+                    height: Style.standardPrimaryButtonHeight
+
+                    imageSource: "image://svgimage-custom-color/close.svg/" + Style.errorBoxBackgroundColor
+                    imageSourceHover: "image://svgimage-custom-color/close.svg/" + Style.ncHeaderTextColor
+                    text: qsTr("Unshare")
+                    textColor: Style.errorBoxBackgroundColor
+                    textColorHovered: "white"
+                    contentsFont.bold: true
+                    bgNormalColor: Style.buttonBackgroundColor
+                    bgHoverColor: Style.errorBoxBackgroundColor
+                    bgNormalOpacity: 1.0
+                    bgHoverOpacity: 1.0
+
+                    onClicked: root.deleteShare()
+                }
             }
         }
 
         RowLayout {
             Layout.fillWidth: true
 
-            CustomButton {
-                Layout.fillWidth: true
-                implicitWidth: parent.width / 2
-                height: Style.standardPrimaryButtonHeight
-
-                imageSource: "image://svgimage-custom-color/close.svg/" + Style.ncHeaderTextColor
-                text: qsTr("Unshare")
-                textColor: Style.ncHeaderTextColor
-                contentsFont.bold: true
-                bgColor: Style.errorBoxBackgroundColor
-                bgNormalOpacity: 1.0
-                bgHoverOpacity: Style.hoverOpacity
 
-                onClicked: root.deleteShare()
-            }
 
             CustomButton {
                 Layout.fillWidth: true
index dfd3a6554f41ec420d50c1aef2edec2d068f4392..c21ab16ebaf26dd6b3b2ca3a28b7e20b816eae33 100644 (file)
@@ -18,6 +18,8 @@ Button {
     property alias contentsFont: contents.font
 
     property alias bgColor: bgRectangle.color
+    property alias bgNormalColor: bgRectangle.normalColor
+    property alias bgHoverColor: bgRectangle.hoverColor
     property alias bgNormalOpacity: bgRectangle.normalOpacity
     property alias bgHoverOpacity: bgRectangle.hoverOpacity
 
index 678c5902be18883bd20ca831a37b1a3f63c11a08..3e960a61142b427f79fc7e123fed5e3bf0b70a31 100644 (file)
 
 import QtQuick 2.15
 
+import Style 1.0
+
 Rectangle {
     property bool hovered: false
     property real normalOpacity: 0.3
     property real hoverOpacity: 1.0
+    property color normalColor: Style.buttonBackgroundColor
+    property color hoverColor: Style.buttonBackgroundColor
 
-    color: "transparent"
+    color: hovered ? hoverColor : normalColor
     opacity: hovered ? hoverOpacity : normalOpacity
     radius: width / 2
 }