Change tooltip palette settings for QML
This commit is contained in:
parent
4951241d23
commit
d205952fc8
@ -7,8 +7,11 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
ToolTip.visible: ma.containsMouse && indicator.visible
|
ToolTip {
|
||||||
ToolTip.text: qsTr("Encrypted")
|
palette: colors
|
||||||
|
visible: ma.containsMouse && indicator.visible
|
||||||
|
text: qsTr("Encrypted")
|
||||||
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id: ma
|
id: ma
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -8,13 +8,16 @@ Rectangle {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
ToolTip.visible: ma.containsMouse && state != MtxEvent.Empty
|
ToolTip {
|
||||||
ToolTip.text: switch (state) {
|
palette: colors
|
||||||
case MtxEvent.Failed: return qsTr("Failed")
|
visible: ma.containsMouse && state != MtxEvent.Empty
|
||||||
case MtxEvent.Sent: return qsTr("Sent")
|
text: switch (state) {
|
||||||
case MtxEvent.Received: return qsTr("Received")
|
case MtxEvent.Failed: return qsTr("Failed")
|
||||||
case MtxEvent.Read: return qsTr("Read")
|
case MtxEvent.Sent: return qsTr("Sent")
|
||||||
default: return ""
|
case MtxEvent.Received: return qsTr("Received")
|
||||||
|
case MtxEvent.Read: return qsTr("Read")
|
||||||
|
default: return ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id: ma
|
id: ma
|
||||||
|
@ -54,6 +54,8 @@ RowLayout {
|
|||||||
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
id: replyButton
|
id: replyButton
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
|
||||||
image: ":/icons/icons/ui/mail-reply.png"
|
image: ":/icons/icons/ui/mail-reply.png"
|
||||||
ToolTip {
|
ToolTip {
|
||||||
@ -68,6 +70,7 @@ RowLayout {
|
|||||||
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
id: optionsButton
|
id: optionsButton
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
image: ":/icons/icons/ui/vertical-ellipsis.png"
|
image: ":/icons/icons/ui/vertical-ellipsis.png"
|
||||||
ToolTip {
|
ToolTip {
|
||||||
|
@ -192,7 +192,7 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: chatFooter
|
id: chatFooter
|
||||||
|
|
||||||
height: Math.max(16, aaaaa.height)
|
height: Math.max(16, footerContent.height)
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
@ -201,7 +201,7 @@ Item {
|
|||||||
color: colors.window
|
color: colors.window
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: aaaaa
|
id: footerContent
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
@ -235,6 +235,7 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.right: closeReplyButton.left
|
anchors.right: closeReplyButton.left
|
||||||
|
anchors.rightMargin: 20
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
modelData: chat.model ? chat.model.getDump(timelineManager.replyingEvent) : {}
|
modelData: chat.model ? chat.model.getDump(timelineManager.replyingEvent) : {}
|
||||||
@ -245,8 +246,9 @@ Item {
|
|||||||
id: closeReplyButton
|
id: closeReplyButton
|
||||||
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 15
|
||||||
anchors.top: replyPreview.top
|
anchors.top: replyPreview.top
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
image: ":/icons/icons/ui/remove-symbol.png"
|
image: ":/icons/icons/ui/remove-symbol.png"
|
||||||
ToolTip {
|
ToolTip {
|
||||||
|
@ -29,6 +29,8 @@ TimelineViewManager::updateColorPalette()
|
|||||||
/*bright_text*/ QColor(),
|
/*bright_text*/ QColor(),
|
||||||
/*base*/ QColor("white"),
|
/*base*/ QColor("white"),
|
||||||
/*window*/ 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("currentActivePalette", lightActive);
|
||||||
view->rootContext()->setContextProperty("currentInactivePalette", lightActive);
|
view->rootContext()->setContextProperty("currentInactivePalette", lightActive);
|
||||||
} else if (settings.theme() == "dark") {
|
} else if (settings.theme() == "dark") {
|
||||||
@ -42,6 +44,8 @@ TimelineViewManager::updateColorPalette()
|
|||||||
/*base*/ QColor("#202228"),
|
/*base*/ QColor("#202228"),
|
||||||
/*window*/ QColor("#202228"));
|
/*window*/ QColor("#202228"));
|
||||||
darkActive.setColor(QPalette::Highlight, QColor("#e7e7e9"));
|
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("currentActivePalette", darkActive);
|
||||||
view->rootContext()->setContextProperty("currentInactivePalette", darkActive);
|
view->rootContext()->setContextProperty("currentInactivePalette", darkActive);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user