to dismiss an activity use a round button with hover enabled
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 30 Jan 2023 16:54:14 +0000 (17:54 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 17 May 2023 16:16:10 +0000 (18:16 +0200)
change size of dismiss button for items in activity list

fix #5275

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/tray/ActivityItem.qml
src/gui/tray/ActivityItemActions.qml
src/gui/tray/ActivityItemContent.qml
src/gui/tray/ActivityList.qml

index ab64fe0e07ca63d949864ee2987f9a0bd926664f..aed7ad4595b16c5716c5d1ba6f2d589219cfcd53 100644 (file)
@@ -32,10 +32,6 @@ ItemDelegate {
 
     contentItem: ColumnLayout {
         id: contentLayout
-        anchors.left: root.left
-        anchors.right: root.right
-        anchors.rightMargin: Style.standardSpacing
-        anchors.leftMargin: Style.standardSpacing
 
         spacing: Style.activityContentSpace
 
@@ -75,7 +71,7 @@ ItemDelegate {
         ActivityItemActions {
             id: activityActions
 
-            visible: !root.isFileActivityList && model.linksForActionButtons.length > 1 && !isTalkReplyOptionVisible
+            visible: !root.isFileActivityList && model.linksForActionButtons.length > 0 && !isTalkReplyOptionVisible
 
             Layout.fillWidth: true
             Layout.leftMargin: Style.trayListItemIconSize + activityContent.spacing
index dba45e46831af6189a2ca40af95da26db7ab4b26..3b8e8dd3d97cbbaf2a428c4fa2a6a0467ec5de27 100644 (file)
@@ -34,7 +34,6 @@ RowLayout {
 
             Layout.minimumWidth: primaryButton ? Style.activityItemActionPrimaryButtonMinWidth : Style.activityItemActionSecondaryButtonMinWidth
             Layout.preferredHeight: parent.height
-            Layout.preferredWidth: primaryButton ? -1 : parent.height
 
             verb: model.modelData.verb
             primaryButton: (model.index === 0 && verb !== "DELETE") || model.modelData.primary
@@ -61,6 +60,7 @@ RowLayout {
         Layout.fillHeight: true
 
         active: root.displayActions && (root.linksContextMenu.length > 0)
+        visible: active
 
         sourceComponent: Button {
             id: moreActionsButton
index 643cd05f0c91cc8137455804242e0058d831f342..bac127a7ce1d1b42b89518fd6e05156ed5916fcf 100644 (file)
@@ -177,34 +177,42 @@ RowLayout {
         }
     }
 
-    CustomButton {
+    RoundButton {
         id: dismissActionButton
 
-        Layout.preferredWidth: Style.trayListItemIconSize
-        Layout.preferredHeight: Style.trayListItemIconSize
+        Layout.preferredWidth: Style.headerButtonIconSize
+        Layout.preferredHeight: Style.headerButtonIconSize
 
         visible: root.showDismissButton && !fileDetailsButton.visible
 
         icon.source: "image://svgimage-custom-color/clear.svg" + "/" + Style.ncTextColor
-        imageSourceHover: "image://svgimage-custom-color/clear.svg" + "/" + UserModel.currentUser.headerTextColor
+        //imageSourceHover: "image://svgimage-custom-color/clear.svg" + "/" + UserModel.currentUser.headerTextColor
 
-        toolTipText: qsTr("Dismiss")
+        flat: true
+        display: Button.IconOnly
+        hoverEnabled: true
+        padding: 0
+        //toolTipText: qsTr("Dismiss")
 
-        bgColor: Style.menuBorder
+        //bgColor: Style.menuBorder
 
         onClicked: root.dismissButtonClicked()
     }
 
-    CustomButton {
+    Button {
         id: fileDetailsButton
 
-        Layout.preferredWidth: Style.trayListItemIconSize
-        Layout.preferredHeight: Style.trayListItemIconSize
+        Layout.preferredWidth: Style.headerButtonIconSize
+        Layout.preferredHeight: Style.headerButtonIconSize
 
         icon.source: "image://svgimage-custom-color/more.svg" + "/" + Style.adjustedCurrentUserHeaderColor
-        imageSourceHover: "image://svgimage-custom-color/more.svg" + "/" + Style.currentUserHeaderTextColor
-        toolTipText: qsTr("Open file details")
-        bgColor: Style.currentUserHeaderColor
+        //imageSourceHover: "image://svgimage-custom-color/more.svg" + "/" + Style.currentUserHeaderTextColor
+        //toolTipText: qsTr("Open file details")
+        //bgColor: Style.currentUserHeaderColor
+
+        flat: true
+        display: Button.IconOnly
+        padding: 0
 
         visible: model.showFileDetails
 
index 168afaaba59a1f142b3d0751ea0ac9832a497f5e..9dba09efc8a3c55bd6d680bf00512b35db5bc416 100644 (file)
@@ -6,7 +6,6 @@ import com.nextcloud.desktopclient 1.0 as NC
 
 ScrollView {
     id: controlRoot
-
     property alias model: sortedActivityList.sourceModel
     property bool isFileActivityList: false
     property int iconSize: Style.trayListItemIconSize