Yeet HoverActions into the sun

Replace HoverActions with an inline action component that appears on hover. There are only actions for reply and react if there is space the overflow button opens the normal message menu.

NOTE: the most recent update changes things slightly, from the images below the buttons are now top aligned because of potentially hige messages. The actions are also now disabled for compact mode as they never really made sense there anyway. The menu now has all options so no one is missing out.

For normal messages

![image](/uploads/b8679eb09c9190404fc84f01e14169af/image.png){width=419 height=138}

When space is limited

![image](/uploads/ecd7c725ea2526689e586a2d786f389e/image.png){width=411 height=130}

User messages

![image](/uploads/767ef09f6650a5fb6abf3a49ef9f9b90/image.png){width=296 height=114}

BUG: 503784
This commit is contained in:
James Graham
2025-05-11 11:11:52 +01:00
parent a04769baad
commit 101a8b9ec3
12 changed files with 239 additions and 222 deletions

View File

@@ -96,6 +96,11 @@ class MessageDelegateBase : public TimelineDelegate
Q_PROPERTY(QQmlComponent *compactBackgroundComponent READ compactBackgroundComponent WRITE setCompactBackgroundComponentt NOTIFY
compactBackgroundComponentChanged FINAL)
/**
* @brief The component to use to visualize quick actions.
*/
Q_PROPERTY(QQmlComponent *quickActionComponent READ quickActionComponent WRITE setQuickActionComponent NOTIFY quickActionComponentChanged FINAL)
/**
* @brief Whether to use the compact mode appearance.
*/
@@ -152,6 +157,9 @@ public:
bool compactMode() const;
void setCompactMode(bool compactMode);
QQmlComponent *quickActionComponent() const;
void setQuickActionComponent(QQmlComponent *quickActionComponent);
bool showLocalMessagesOnRight() const;
void setShowLocalMessagesOnRight(bool showLocalMessagesOnRight);
@@ -172,6 +180,7 @@ Q_SIGNALS:
void readMarkerComponentChanged();
void showReadMarkersChanged();
void compactBackgroundComponentChanged();
void quickActionComponentChanged();
void compactModeChanged();
void showLocalMessagesOnRightChanged();
void isTemporaryHighlightedChanged();
@@ -211,6 +220,10 @@ private:
bool m_compactMode = false;
void updateBackground();
QPointer<QQmlComponent> m_quickActionComponent;
bool m_quickActionIncubating = false;
QPointer<QQuickItem> m_quickActionItem;
bool m_showLocalMessagesOnRight = true;
bool m_hovered = false;
@@ -245,4 +258,7 @@ private:
void resizeContent() override;
QPointer<QTimer> m_temporaryHighlightTimer;
private Q_SLOTS:
void updateQuickAction();
};