to dismiss an activity use a round button with hover enabled

change size of dismiss button for items in activity list

fix #5275

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2023-01-30 17:54:14 +01:00
parent 4c1ab7092b
commit f8feb6403f
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553
4 changed files with 22 additions and 19 deletions

View file

@ -32,10 +32,6 @@ ItemDelegate {
contentItem: ColumnLayout { contentItem: ColumnLayout {
id: contentLayout id: contentLayout
anchors.left: root.left
anchors.right: root.right
anchors.rightMargin: Style.standardSpacing
anchors.leftMargin: Style.standardSpacing
spacing: Style.activityContentSpace spacing: Style.activityContentSpace
@ -75,7 +71,7 @@ ItemDelegate {
ActivityItemActions { ActivityItemActions {
id: activityActions id: activityActions
visible: !root.isFileActivityList && model.linksForActionButtons.length > 1 && !isTalkReplyOptionVisible visible: !root.isFileActivityList && model.linksForActionButtons.length > 0 && !isTalkReplyOptionVisible
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: Style.trayListItemIconSize + activityContent.spacing Layout.leftMargin: Style.trayListItemIconSize + activityContent.spacing

View file

@ -34,7 +34,6 @@ RowLayout {
Layout.minimumWidth: primaryButton ? Style.activityItemActionPrimaryButtonMinWidth : Style.activityItemActionSecondaryButtonMinWidth Layout.minimumWidth: primaryButton ? Style.activityItemActionPrimaryButtonMinWidth : Style.activityItemActionSecondaryButtonMinWidth
Layout.preferredHeight: parent.height Layout.preferredHeight: parent.height
Layout.preferredWidth: primaryButton ? -1 : parent.height
verb: model.modelData.verb verb: model.modelData.verb
primaryButton: (model.index === 0 && verb !== "DELETE") || model.modelData.primary primaryButton: (model.index === 0 && verb !== "DELETE") || model.modelData.primary
@ -61,6 +60,7 @@ RowLayout {
Layout.fillHeight: true Layout.fillHeight: true
active: root.displayActions && (root.linksContextMenu.length > 0) active: root.displayActions && (root.linksContextMenu.length > 0)
visible: active
sourceComponent: Button { sourceComponent: Button {
id: moreActionsButton id: moreActionsButton

View file

@ -177,34 +177,42 @@ RowLayout {
} }
} }
CustomButton { RoundButton {
id: dismissActionButton id: dismissActionButton
Layout.preferredWidth: Style.trayListItemIconSize Layout.preferredWidth: Style.headerButtonIconSize
Layout.preferredHeight: Style.trayListItemIconSize Layout.preferredHeight: Style.headerButtonIconSize
visible: root.showDismissButton && !fileDetailsButton.visible visible: root.showDismissButton && !fileDetailsButton.visible
icon.source: "image://svgimage-custom-color/clear.svg" + "/" + Style.ncTextColor 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() onClicked: root.dismissButtonClicked()
} }
CustomButton { Button {
id: fileDetailsButton id: fileDetailsButton
Layout.preferredWidth: Style.trayListItemIconSize Layout.preferredWidth: Style.headerButtonIconSize
Layout.preferredHeight: Style.trayListItemIconSize Layout.preferredHeight: Style.headerButtonIconSize
icon.source: "image://svgimage-custom-color/more.svg" + "/" + Style.adjustedCurrentUserHeaderColor icon.source: "image://svgimage-custom-color/more.svg" + "/" + Style.adjustedCurrentUserHeaderColor
imageSourceHover: "image://svgimage-custom-color/more.svg" + "/" + Style.currentUserHeaderTextColor //imageSourceHover: "image://svgimage-custom-color/more.svg" + "/" + Style.currentUserHeaderTextColor
toolTipText: qsTr("Open file details") //toolTipText: qsTr("Open file details")
bgColor: Style.currentUserHeaderColor //bgColor: Style.currentUserHeaderColor
flat: true
display: Button.IconOnly
padding: 0
visible: model.showFileDetails visible: model.showFileDetails

View file

@ -6,7 +6,6 @@ import com.nextcloud.desktopclient 1.0 as NC
ScrollView { ScrollView {
id: controlRoot id: controlRoot
property alias model: sortedActivityList.sourceModel property alias model: sortedActivityList.sourceModel
property bool isFileActivityList: false property bool isFileActivityList: false
property int iconSize: Style.trayListItemIconSize property int iconSize: Style.trayListItemIconSize