mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 19:38:48 +03:00
Fix button colors
This commit is contained in:
parent
8e4e3f2eb0
commit
a8bd8dddbf
27 changed files with 44 additions and 58 deletions
|
@ -48,7 +48,7 @@ Page {
|
|||
|
||||
property color backgroundColor: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property color bubbleBackground: timelineRoot.palette.highlight
|
||||
property color bubbleText: timelineRoot.palette.highlightedText
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ Control {
|
|||
|
||||
Label {
|
||||
text: "(" + model.userid + ")"
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.buttonText
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.placeholderText
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ Control {
|
|||
|
||||
Label {
|
||||
text: "(" + model.packname + ")"
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.buttonText
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.placeholderText
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ Control {
|
|||
|
||||
Label {
|
||||
text: "(" + model.roomAlias + ")"
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.buttonText
|
||||
color: model.index == popup.currentIndex ? timelineRoot.palette.highlightedText : timelineRoot.palette.placeholderText
|
||||
textFormat: Text.RichText
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ Image {
|
|||
case Crypto.Verified:
|
||||
return sourceUrl + "green";
|
||||
case Crypto.TOFU:
|
||||
return sourceUrl + timelineRoot.palette.buttonText;
|
||||
return sourceUrl + timelineRoot.palette.placeholderText;
|
||||
default:
|
||||
return sourceUrl + Nheko.theme.error;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ AbstractButton {
|
|||
property alias cursor: mouseArea.cursorShape
|
||||
property string image: undefined
|
||||
property color highlightColor: timelineRoot.palette.highlight
|
||||
property color buttonTextColor: timelineRoot.palette.buttonText
|
||||
property color buttonTextColor: timelineRoot.palette.placeholderText
|
||||
property bool changeColorOnHover: true
|
||||
property bool ripple: true
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ Rectangle {
|
|||
|
||||
selectByMouse: true
|
||||
placeholderText: qsTr("Write a message...")
|
||||
placeholderTextColor: timelineRoot.palette.buttonText
|
||||
placeholderTextColor: timelineRoot.palette.placeholderText
|
||||
color: timelineRoot.palette.text
|
||||
width: textInput.width
|
||||
verticalAlignment: TextEdit.AlignVCenter
|
||||
|
|
|
@ -73,7 +73,7 @@ Item {
|
|||
|
||||
background: Rectangle {
|
||||
color: timelineRoot.palette.window
|
||||
border.color: timelineRoot.palette.buttonText
|
||||
border.color: timelineRoot.palette.placeholderText
|
||||
border.width: 1
|
||||
radius: padding
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ Item {
|
|||
id: editButton
|
||||
|
||||
visible: !!row.model && row.model.isEditable
|
||||
buttonTextColor: timelineRoot.palette.buttonText
|
||||
buttonTextColor: timelineRoot.palette.placeholderText
|
||||
width: 16
|
||||
hoverEnabled: true
|
||||
image: ":/icons/icons/ui/edit.svg"
|
||||
|
@ -335,7 +335,7 @@ Item {
|
|||
|
||||
Label {
|
||||
id: statusMsg
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
text: Presence.userStatus(userId)
|
||||
textFormat: Text.PlainText
|
||||
elide: Text.ElideRight
|
||||
|
@ -768,7 +768,7 @@ Item {
|
|||
background: Rectangle {
|
||||
color: toEndButton.down ? timelineRoot.palette.highlight : timelineRoot.palette.button
|
||||
opacity: enabled ? 1 : 0.3
|
||||
border.color: toEndButton.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText
|
||||
border.color: toEndButton.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText
|
||||
border.width: 1
|
||||
radius: toEndButton.radius
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ Item {
|
|||
id: buttonImg
|
||||
anchors.fill: parent
|
||||
anchors.margins: Nheko.paddingMedium
|
||||
source: "image://colorimage/:/icons/icons/ui/download.svg?" + (toEndButton.down ? timelineRoot.palette.highlightedText : timelineRoot.palette.buttonText)
|
||||
source: "image://colorimage/:/icons/icons/ui/download.svg?" + (toEndButton.down ? timelineRoot.palette.highlightedText : timelineRoot.palette.placeholderText)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ Page {
|
|||
|
||||
property color backgroundColor: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property color bubbleBackground: timelineRoot.palette.highlight
|
||||
property color bubbleText: timelineRoot.palette.highlightedText
|
||||
required property string roomName
|
||||
|
@ -492,7 +492,7 @@ Page {
|
|||
|
||||
ElidedLabel {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
font.pointSize: fontMetrics.font.pointSize * 0.9
|
||||
elideWidth: col.width
|
||||
fullText: userInfoGrid.profile ? userInfoGrid.profile.userid : ""
|
||||
|
@ -547,7 +547,7 @@ Page {
|
|||
|
||||
Layout.margins: Nheko.paddingMedium
|
||||
Layout.rightMargin: Nheko.paddingSmall
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
Layout.fillWidth: true
|
||||
text: {
|
||||
switch (SelfVerificationStatus.status) {
|
||||
|
|
22
qml/Root.qml
22
qml/Root.qml
|
@ -19,27 +19,7 @@ import im.nheko
|
|||
|
||||
Pane {
|
||||
id: timelineRoot
|
||||
|
||||
palette {
|
||||
windowText: "#caccd1"
|
||||
button: "white"
|
||||
light: "#caccd1"
|
||||
dark: "#3c464d"
|
||||
mid: "#202228"
|
||||
text: "#caccd1"
|
||||
brightText: "#f4f5f8"
|
||||
base: "#202228"
|
||||
window: "#2d3139"
|
||||
|
||||
alternateBase: "#2d3139"
|
||||
highlight: "#38a3d8"
|
||||
highlightedText: "#f4f5f8"
|
||||
toolTipBase: timelineRoot.palette.base
|
||||
toolTipText: timelineRoot.palette.text
|
||||
link: "#38a3d8"
|
||||
buttonText: "#828284"
|
||||
|
||||
}
|
||||
|
||||
background: null
|
||||
padding: 0
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ AbstractButton {
|
|||
width: parent.iconSize
|
||||
sourceSize.width: parent.iconSize * Screen.devicePixelRatio
|
||||
sourceSize.height: parent.iconSize * Screen.devicePixelRatio
|
||||
source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((eventId == chat.model.edit) ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((eventId == chat.model.edit) ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
ToolTip.visible: editHovered.hovered
|
||||
ToolTip.delay: Nheko.tooltipDelay
|
||||
ToolTip.text: qsTr("Edited")
|
||||
|
|
|
@ -60,7 +60,7 @@ Page {
|
|||
case MediaUpload.Image: return "image";
|
||||
default: return "zip";
|
||||
}
|
||||
source: (modelData.thumbnail != "") ? modelData.thumbnail : ("image://colorimage/:/icons/icons/ui/"+typeStr+".svg?" + timelineRoot.palette.buttonText)
|
||||
source: (modelData.thumbnail != "") ? modelData.thumbnail : ("image://colorimage/:/icons/icons/ui/"+typeStr+".svg?" + timelineRoot.palette.placeholderText)
|
||||
}
|
||||
MatrixTextField {
|
||||
Layout.fillWidth: true
|
||||
|
|
|
@ -14,7 +14,7 @@ Rectangle {
|
|||
|
||||
property color background: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property color bubbleBackground: timelineRoot.palette.highlight
|
||||
property color bubbleText: timelineRoot.palette.highlightedText
|
||||
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.3)
|
||||
|
|
|
@ -13,7 +13,7 @@ AbstractButton {
|
|||
|
||||
property alias cursor: mouseArea.cursorShape
|
||||
property color highlightColor: timelineRoot.palette.highlight
|
||||
property color buttonTextColor: timelineRoot.palette.buttonText
|
||||
property color buttonTextColor: timelineRoot.palette.placeholderText
|
||||
|
||||
focusPolicy: Qt.NoFocus
|
||||
width: buttonText.implicitWidth
|
||||
|
|
|
@ -35,7 +35,7 @@ AbstractButton {
|
|||
|
||||
anchors.fill: parent
|
||||
visible: img.status != Image.Ready
|
||||
source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + timelineRoot.palette.buttonText)
|
||||
source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + timelineRoot.palette.placeholderText)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectFit
|
||||
sourceSize.width: parent.width * Screen.devicePixelRatio
|
||||
|
|
|
@ -10,7 +10,7 @@ import im.nheko
|
|||
TextMessage {
|
||||
property bool isStateEvent
|
||||
font.italic: true
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
font.pointSize: isStateEvent? 0.8*Settings.fontSize : Settings.fontSize
|
||||
horizontalAlignment: isStateEvent? Text.AlignHCenter : undefined
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ ApplicationWindow {
|
|||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: userID.text
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
font.pointSize: fontMetrics.font.pointSize * 0.9
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ ApplicationWindow {
|
|||
|
||||
property color background: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property color bubbleBackground: timelineRoot.palette.highlight
|
||||
property color bubbleText: timelineRoot.palette.highlightedText
|
||||
required property string shortCode
|
||||
|
|
|
@ -94,7 +94,7 @@ ApplicationWindow {
|
|||
|
||||
property color background: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property color bubbleBackground: timelineRoot.palette.highlight
|
||||
property color bubbleText: timelineRoot.palette.highlightedText
|
||||
required property string displayName
|
||||
|
|
|
@ -137,7 +137,7 @@ ApplicationWindow {
|
|||
|
||||
Label {
|
||||
text: model.mxid
|
||||
color: del.hovered ? timelineRoot.palette.brightText : timelineRoot.palette.buttonText
|
||||
color: del.hovered ? timelineRoot.palette.brightText : timelineRoot.palette.placeholderText
|
||||
font.pointSize: fontMetrics.font.pointSize * 0.9
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ ApplicationWindow {
|
|||
|
||||
Label {
|
||||
text: model.timestamp
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
font.pointSize: fontMetrics.font.pointSize * 0.9
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ ApplicationWindow {
|
|||
|
||||
property color background: timelineRoot.palette.window
|
||||
property color importantText: timelineRoot.palette.text
|
||||
property color unimportantText: timelineRoot.palette.buttonText
|
||||
property color unimportantText: timelineRoot.palette.placeholderText
|
||||
property int avatarSize: fontMetrics.height * 3.2
|
||||
|
||||
color: background
|
||||
|
|
|
@ -152,7 +152,7 @@ ApplicationWindow {
|
|||
|
||||
ElidedLabel {
|
||||
fullText: model.mxid
|
||||
color: del.hovered ? timelineRoot.palette.brightText : timelineRoot.palette.buttonText
|
||||
color: del.hovered ? timelineRoot.palette.brightText : timelineRoot.palette.placeholderText
|
||||
font.pixelSize: Math.ceil(fontMetrics.font.pixelSize * 0.9)
|
||||
elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ Menu {
|
|||
Layout.preferredWidth: 7 * 52 + 20 - 6
|
||||
palette: timelineRoot.palette
|
||||
background: null
|
||||
placeholderTextColor: timelineRoot.palette.buttonText
|
||||
placeholderTextColor: timelineRoot.palette.placeholderText
|
||||
color: timelineRoot.palette.text
|
||||
placeholderText: qsTr("Search")
|
||||
selectByMouse: true
|
||||
|
@ -90,7 +90,7 @@ Menu {
|
|||
id: clearSearch
|
||||
|
||||
visible: emojiSearch.text !== ''
|
||||
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
focusPolicy: Qt.NoFocus
|
||||
onClicked: emojiSearch.clear()
|
||||
hoverEnabled: true
|
||||
|
@ -105,7 +105,7 @@ Menu {
|
|||
Image {
|
||||
height: parent.height - 2 * Nheko.paddingSmall
|
||||
width: height
|
||||
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
|
@ -294,7 +294,7 @@ Menu {
|
|||
mipmap: true
|
||||
sourceSize.width: 32 * Screen.devicePixelRatio
|
||||
sourceSize.height: 32 * Screen.devicePixelRatio
|
||||
source: "image://colorimage/" + modelData.image + "?" + (hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
source: "image://colorimage/" + modelData.image + "?" + (hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
|
|
|
@ -64,7 +64,7 @@ Menu {
|
|||
Layout.preferredWidth: stickersPerRow * stickerDimPad + 20 - 6
|
||||
palette: timelineRoot.palette
|
||||
background: null
|
||||
placeholderTextColor: timelineRoot.palette.buttonText
|
||||
placeholderTextColor: timelineRoot.palette.placeholderText
|
||||
color: timelineRoot.palette.text
|
||||
placeholderText: qsTr("Search")
|
||||
selectByMouse: true
|
||||
|
@ -88,7 +88,7 @@ Menu {
|
|||
id: clearSearch
|
||||
|
||||
visible: emojiSearch.text !== ''
|
||||
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
focusPolicy: Qt.NoFocus
|
||||
onClicked: emojiSearch.clear()
|
||||
hoverEnabled: true
|
||||
|
@ -103,7 +103,7 @@ Menu {
|
|||
Image {
|
||||
height: parent.height - 2 * Nheko.paddingSmall
|
||||
width: height
|
||||
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.buttonText)
|
||||
source: "image://colorimage/:/icons/icons/ui/round-remove-button.svg?" + (clearSearch.hovered ? timelineRoot.palette.highlight : timelineRoot.palette.placeholderText)
|
||||
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
|
|
|
@ -178,7 +178,7 @@ Rectangle {
|
|||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
height: 1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ Slider {
|
|||
width: control.availableWidth - handle.width
|
||||
height: implicitHeight
|
||||
radius: height / 2
|
||||
color: timelineRoot.palette.buttonText
|
||||
color: timelineRoot.palette.placeholderText
|
||||
|
||||
Rectangle {
|
||||
width: control.visualPosition * parent.width
|
||||
|
|
|
@ -72,6 +72,8 @@ MainWindow::MainWindow(QWindow *parent)
|
|||
registerQmlTypes();
|
||||
|
||||
setColor(Theme::paletteFromTheme(userSettings_->theme()).window().color());
|
||||
QApplication::setPalette(Theme::paletteFromTheme(userSettings_->theme()));
|
||||
|
||||
setSource(QUrl(QStringLiteral("qrc:///im/nheko/qml/Root.qml")));
|
||||
|
||||
trayIcon_ = new TrayIcon(QStringLiteral(":/logos/nheko.svg"), this);
|
||||
|
|
|
@ -31,6 +31,8 @@ Theme::paletteFromTheme(QStringView theme)
|
|||
lightActive.setColor(QPalette::ToolTipText, lightActive.text().color());
|
||||
lightActive.setColor(QPalette::Link, QColor(0x00, 0x77, 0xb5));
|
||||
lightActive.setColor(QPalette::ButtonText, QColor(0x55, 0x54, 0x59));
|
||||
lightActive.setColor(QPalette::PlaceholderText, QColor(0x55, 0x54, 0x59));
|
||||
|
||||
return lightActive;
|
||||
}();
|
||||
return lightActive;
|
||||
|
@ -53,6 +55,8 @@ Theme::paletteFromTheme(QStringView theme)
|
|||
darkActive.setColor(QPalette::ToolTipText, darkActive.text().color());
|
||||
darkActive.setColor(QPalette::Link, QColor(0x38, 0xa3, 0xd8));
|
||||
darkActive.setColor(QPalette::ButtonText, QColor(0x82, 0x82, 0x84));
|
||||
darkActive.setColor(QPalette::PlaceholderText, QColor(0x82, 0x82, 0x84));
|
||||
|
||||
return darkActive;
|
||||
}();
|
||||
return darkActive;
|
||||
|
|
Loading…
Reference in a new issue