Change tooltip palette settings for QML

This commit is contained in:
Joseph Donofry 2020-01-28 19:20:39 -05:00
parent 4951241d23
commit d205952fc8
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
5 changed files with 27 additions and 12 deletions

View File

@ -7,8 +7,11 @@ Rectangle {
color: "transparent"
width: 16
height: 16
ToolTip.visible: ma.containsMouse && indicator.visible
ToolTip.text: qsTr("Encrypted")
ToolTip {
palette: colors
visible: ma.containsMouse && indicator.visible
text: qsTr("Encrypted")
}
MouseArea{
id: ma
anchors.fill: parent

View File

@ -8,13 +8,16 @@ Rectangle {
color: "transparent"
width: 16
height: 16
ToolTip.visible: ma.containsMouse && state != MtxEvent.Empty
ToolTip.text: switch (state) {
case MtxEvent.Failed: return qsTr("Failed")
case MtxEvent.Sent: return qsTr("Sent")
case MtxEvent.Received: return qsTr("Received")
case MtxEvent.Read: return qsTr("Read")
default: return ""
ToolTip {
palette: colors
visible: ma.containsMouse && state != MtxEvent.Empty
text: switch (state) {
case MtxEvent.Failed: return qsTr("Failed")
case MtxEvent.Sent: return qsTr("Sent")
case MtxEvent.Received: return qsTr("Received")
case MtxEvent.Read: return qsTr("Read")
default: return ""
}
}
MouseArea{
id: ma

View File

@ -54,6 +54,8 @@ RowLayout {
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
id: replyButton
hoverEnabled: true
image: ":/icons/icons/ui/mail-reply.png"
ToolTip {
@ -68,6 +70,7 @@ RowLayout {
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
id: optionsButton
hoverEnabled: true
image: ":/icons/icons/ui/vertical-ellipsis.png"
ToolTip {

View File

@ -192,7 +192,7 @@ Item {
Rectangle {
id: chatFooter
height: Math.max(16, aaaaa.height)
height: Math.max(16, footerContent.height)
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
@ -201,7 +201,7 @@ Item {
color: colors.window
Column {
id: aaaaa
id: footerContent
anchors.left: parent.left
anchors.right: parent.right
@ -235,6 +235,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 10
anchors.right: closeReplyButton.left
anchors.rightMargin: 20
anchors.bottom: parent.bottom
modelData: chat.model ? chat.model.getDump(timelineManager.replyingEvent) : {}
@ -245,8 +246,9 @@ Item {
id: closeReplyButton
anchors.right: parent.right
anchors.rightMargin: 10
anchors.rightMargin: 15
anchors.top: replyPreview.top
hoverEnabled: true
image: ":/icons/icons/ui/remove-symbol.png"
ToolTip {

View File

@ -29,6 +29,8 @@ TimelineViewManager::updateColorPalette()
/*bright_text*/ QColor(),
/*base*/ QColor("white"),
/*window*/ QColor("white"));
lightActive.setColor(QPalette::ToolTipBase, lightActive.base().color());
lightActive.setColor(QPalette::ToolTipText, lightActive.text().color());
view->rootContext()->setContextProperty("currentActivePalette", lightActive);
view->rootContext()->setContextProperty("currentInactivePalette", lightActive);
} else if (settings.theme() == "dark") {
@ -42,6 +44,8 @@ TimelineViewManager::updateColorPalette()
/*base*/ QColor("#202228"),
/*window*/ QColor("#202228"));
darkActive.setColor(QPalette::Highlight, QColor("#e7e7e9"));
darkActive.setColor(QPalette::ToolTipBase, darkActive.base().color());
darkActive.setColor(QPalette::ToolTipText, darkActive.text().color());
view->rootContext()->setContextProperty("currentActivePalette", darkActive);
view->rootContext()->setContextProperty("currentInactivePalette", darkActive);
} else {