From 1db8c66759d834f8d82c929eff2751718aaa9d47 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 28 Feb 2021 18:16:43 -0400 Subject: [PATCH] Hide image event name/time bubbles when kb-focused --- docs/TODO.md | 3 +-- src/gui/Pages/Chat/Timeline/EventDelegate.qml | 2 ++ src/gui/Pages/Chat/Timeline/EventImage.qml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 2dc1f94b..3c6de025 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -1,13 +1,12 @@ # TODO -- custom action - - seen tooltips can't be shown on image hover - quick settings - import/export/json edit rules? - room selector for room rules - validate json for unknown action/condition +- custom action - PCN docstrings - PCN error handling diff --git a/src/gui/Pages/Chat/Timeline/EventDelegate.qml b/src/gui/Pages/Chat/Timeline/EventDelegate.qml index 05c3ecf1..b2a5bf3e 100644 --- a/src/gui/Pages/Chat/Timeline/EventDelegate.qml +++ b/src/gui/Pages/Chat/Timeline/EventDelegate.qml @@ -17,6 +17,8 @@ HColumnLayout { readonly property var nextModel: eventList.model.get(model.index - 1) readonly property QtObject currentModel: model + readonly property bool isFocused: model.index === eventList.currentIndex + readonly property bool compact: window.settings.General.compact readonly property bool checked: model.id in eventList.checked readonly property bool isOwn: chat.userId === model.sender_id diff --git a/src/gui/Pages/Chat/Timeline/EventImage.qml b/src/gui/Pages/Chat/Timeline/EventImage.qml index 72acc4a6..ea4c4983 100644 --- a/src/gui/Pages/Chat/Timeline/EventImage.qml +++ b/src/gui/Pages/Chat/Timeline/EventImage.qml @@ -131,7 +131,7 @@ HMxcImage { anchors.top: parent.top text: loader.showSender textFormat: Text.StyledText - opacity: hover.hovered ? 0 : 1 + opacity: hover.hovered || eventDelegate.isFocused ? 0 : 1 visible: opacity > 0 Behavior on opacity { HNumberAnimation {} } @@ -143,7 +143,7 @@ HMxcImage { text: loader.showDate + loader.showLocalEcho textFormat: Text.RichText - opacity: hover.hovered ? 0 : 1 + opacity: hover.hovered || eventDelegate.isFocused ? 0 : 1 visible: opacity > 0 Behavior on opacity { HNumberAnimation {} }