mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Improve link theming
This commit is contained in:
parent
4d79f8078e
commit
b1eff0a37f
5 changed files with 17 additions and 3 deletions
|
@ -1,12 +1,15 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
TextEdit {
|
TextArea {
|
||||||
textFormat: TextEdit.RichText
|
textFormat: TextEdit.RichText
|
||||||
readOnly: true
|
readOnly: true
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: colors.text
|
//color: colors.text
|
||||||
|
palette: colors
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
|
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
|
||||||
|
|
|
@ -2,6 +2,6 @@ import ".."
|
||||||
|
|
||||||
MatrixText {
|
MatrixText {
|
||||||
property string formatted: model.data.formattedBody
|
property string formatted: model.data.formattedBody
|
||||||
text: formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
text: "<style type=\"text/css\">a { color:"+colors.link+";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
||||||
width: parent ? parent.width : undefined
|
width: parent ? parent.width : undefined
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,10 @@ QLabel {
|
||||||
color: #caccd1;
|
color: #caccd1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextLabel::a {
|
||||||
|
color: #38a3d8;
|
||||||
|
}
|
||||||
|
|
||||||
QuickSwitcher,
|
QuickSwitcher,
|
||||||
ReplyPopup,
|
ReplyPopup,
|
||||||
SuggestionsPopup,
|
SuggestionsPopup,
|
||||||
|
|
|
@ -3,6 +3,11 @@ QLabel {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextLabel::a {
|
||||||
|
color: #0077b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QuickSwitcher,
|
QuickSwitcher,
|
||||||
ReplyPopup,
|
ReplyPopup,
|
||||||
SuggestionsPopup,
|
SuggestionsPopup,
|
||||||
|
|
|
@ -32,6 +32,7 @@ TimelineViewManager::updateColorPalette()
|
||||||
/*window*/ QColor("white"));
|
/*window*/ QColor("white"));
|
||||||
lightActive.setColor(QPalette::ToolTipBase, lightActive.base().color());
|
lightActive.setColor(QPalette::ToolTipBase, lightActive.base().color());
|
||||||
lightActive.setColor(QPalette::ToolTipText, lightActive.text().color());
|
lightActive.setColor(QPalette::ToolTipText, lightActive.text().color());
|
||||||
|
lightActive.setColor(QPalette::Link, QColor("#0077b5"));
|
||||||
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") {
|
||||||
|
@ -47,6 +48,7 @@ TimelineViewManager::updateColorPalette()
|
||||||
darkActive.setColor(QPalette::Highlight, QColor("#e7e7e9"));
|
darkActive.setColor(QPalette::Highlight, QColor("#e7e7e9"));
|
||||||
darkActive.setColor(QPalette::ToolTipBase, darkActive.base().color());
|
darkActive.setColor(QPalette::ToolTipBase, darkActive.base().color());
|
||||||
darkActive.setColor(QPalette::ToolTipText, darkActive.text().color());
|
darkActive.setColor(QPalette::ToolTipText, darkActive.text().color());
|
||||||
|
darkActive.setColor(QPalette::Link, QColor("#38a3d8"));
|
||||||
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 a new issue