Add proper tooltip delays

Split from !521
This commit is contained in:
Bharadwaj Raju
2022-09-12 20:35:40 +00:00
parent 2a2c117ac1
commit 76edc858aa
4 changed files with 8 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ TimelineContainer {
icon.name: "document-open" icon.name: "document-open"
QQC2.ToolTip.text: i18nc("tooltip for a button on a message; offers ability to open its downloaded file with an appropriate application", "Open File") QQC2.ToolTip.text: i18nc("tooltip for a button on a message; offers ability to open its downloaded file with an appropriate application", "Open File")
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
onClicked: openSavedFile() onClicked: openSavedFile()
} }
@@ -70,6 +71,7 @@ TimelineContainer {
icon.name: "media-playback-stop" icon.name: "media-playback-stop"
QQC2.ToolTip.text: i18nc("tooltip for a button on a message; stops downloading the message's file", "Stop Download") QQC2.ToolTip.text: i18nc("tooltip for a button on a message; stops downloading the message's file", "Stop Download")
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
onClicked: currentRoom.cancelFileTransfer(eventId) onClicked: currentRoom.cancelFileTransfer(eventId)
} }
}, },

View File

@@ -229,6 +229,7 @@ QQC2.ItemDelegate {
color: Kirigami.Theme.disabledTextColor color: Kirigami.Theme.disabledTextColor
QQC2.ToolTip.visible: hoverHandler.hovered QQC2.ToolTip.visible: hoverHandler.hovered
QQC2.ToolTip.text: time.toLocaleString(Qt.locale(), Locale.LongFormat) QQC2.ToolTip.text: time.toLocaleString(Qt.locale(), Locale.LongFormat)
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
HoverHandler { HoverHandler {
id: hoverHandler id: hoverHandler

View File

@@ -454,6 +454,7 @@ Kirigami.ScrollablePage {
property int childOffset: userMsg && Config.showLocalMessagesOnRight && !Config.compactLayout ? (bubble ? bubble.width : 0) - childWidth : Math.max((bubble ? bubble.width : 0) - childWidth, 0) property int childOffset: userMsg && Config.showLocalMessagesOnRight && !Config.compactLayout ? (bubble ? bubble.width : 0) - childWidth : Math.max((bubble ? bubble.width : 0) - childWidth, 0)
x: delegate && bubble ? (delegate.x + bubble.x + Kirigami.Units.largeSpacing + childOffset - (Config.compactLayout ? Kirigami.Units.gridUnit * 3 : 0)) : 0 x: delegate && bubble ? (delegate.x + bubble.x + Kirigami.Units.largeSpacing + childOffset - (Config.compactLayout ? Kirigami.Units.gridUnit * 3 : 0)) : 0
y: bubble ? bubble.mapToItem(parent, 0, 0).y - hoverActions.childHeight + Kirigami.Units.smallSpacing: 0; y: bubble ? bubble.mapToItem(parent, 0, 0).y - hoverActions.childHeight + Kirigami.Units.smallSpacing: 0;
visible: false visible: false
property var updateFunction property var updateFunction
@@ -473,6 +474,7 @@ Kirigami.ScrollablePage {
QQC2.Button { QQC2.Button {
QQC2.ToolTip.text: i18n("React") QQC2.ToolTip.text: i18n("React")
QQC2.ToolTip.visible: hovered QQC2.ToolTip.visible: hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
icon.name: "preferences-desktop-emoticons" icon.name: "preferences-desktop-emoticons"
onClicked: emojiDialog.open(); onClicked: emojiDialog.open();
EmojiDialog { EmojiDialog {
@@ -486,6 +488,7 @@ Kirigami.ScrollablePage {
QQC2.Button { QQC2.Button {
QQC2.ToolTip.text: i18n("Edit") QQC2.ToolTip.text: i18n("Edit")
QQC2.ToolTip.visible: hovered QQC2.ToolTip.visible: hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
visible: hoverActions.showEdit visible: hoverActions.showEdit
icon.name: "document-edit" icon.name: "document-edit"
onClicked: { onClicked: {
@@ -498,6 +501,7 @@ Kirigami.ScrollablePage {
QQC2.Button { QQC2.Button {
QQC2.ToolTip.text: i18n("Reply") QQC2.ToolTip.text: i18n("Reply")
QQC2.ToolTip.visible: hovered QQC2.ToolTip.visible: hovered
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
icon.name: "mail-replied-symbolic" icon.name: "mail-replied-symbolic"
onClicked: { onClicked: {
chatBoxHelper.replyToMessage(hoverActions.event.eventId, hoverActions.event.message, hoverActions.event.author); chatBoxHelper.replyToMessage(hoverActions.event.eventId, hoverActions.event.message, hoverActions.event.author);

View File

@@ -237,6 +237,7 @@ Kirigami.ScrollablePage {
HoverHandler { id: sliderHover } HoverHandler { id: sliderHover }
QQC2.ToolTip.visible: sliderHover.hovered && !enabled QQC2.ToolTip.visible: sliderHover.hovered && !enabled
QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.") QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.")
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
} }
QQC2.Label { QQC2.Label {
text: Math.round(Config.transparency * 100) + "%" text: Math.round(Config.transparency * 100) + "%"