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
{width=419 height=138}
When space is limited
{width=411 height=130}
User messages
{width=296 height=114}
BUG: 503784
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user