From 5e0a2672fb9311052c55a38a1eec6bb6ba86eccd Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 23 Nov 2022 14:33:49 +0100 Subject: [PATCH] Make unshare button less prominent, move out of bottom button box Signed-off-by: Claudio Cambra --- src/gui/filedetails/ShareDetailsPage.qml | 31 +++++++++++++----------- src/gui/tray/CustomButton.qml | 2 ++ src/gui/tray/NCButtonBackground.qml | 6 ++++- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/gui/filedetails/ShareDetailsPage.qml b/src/gui/filedetails/ShareDetailsPage.qml index 403b228c9..ade22ea19 100644 --- a/src/gui/filedetails/ShareDetailsPage.qml +++ b/src/gui/filedetails/ShareDetailsPage.qml @@ -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 diff --git a/src/gui/tray/CustomButton.qml b/src/gui/tray/CustomButton.qml index dfd3a6554..c21ab16eb 100644 --- a/src/gui/tray/CustomButton.qml +++ b/src/gui/tray/CustomButton.qml @@ -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 diff --git a/src/gui/tray/NCButtonBackground.qml b/src/gui/tray/NCButtonBackground.qml index 678c5902b..3e960a611 100644 --- a/src/gui/tray/NCButtonBackground.qml +++ b/src/gui/tray/NCButtonBackground.qml @@ -14,12 +14,16 @@ 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 }