From f57e9259c0cddfa22304ccac633fd8e5a051a816 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Wed, 26 Jul 2023 14:17:47 +0800 Subject: Show buttons only when mouse is hovering --- contents/ui/ActivityView.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contents/ui/ActivityView.qml b/contents/ui/ActivityView.qml index e8d840a..e48b2a5 100644 --- a/contents/ui/ActivityView.qml +++ b/contents/ui/ActivityView.qml @@ -11,7 +11,9 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras import "activity.js" as Activity PlasmaComponents.ListItem { + id: activityItem separatorVisible: false + enabled: true // enable mouse event handling RowLayout { id: activityView width: (type == "announcement" ? announcementsListView : assignmentsListView).width @@ -83,6 +85,8 @@ PlasmaComponents.ListItem { PlasmaComponents3.ToolButton { icon.name: "view-visible" + // only show when mouse is hovering above this activity + opacity: activityItem.containsMouse ? 1 : 0 onClicked: () => { Qt.openUrlExternally(url) } @@ -91,6 +95,7 @@ PlasmaComponents.ListItem { PlasmaComponents3.ToolButton { icon.name: "emblem-important-symbolic" checked: important + opacity: activityItem.containsMouse ? 1 : 0 onClicked: () => { important = !important -- cgit v1.2.3