Compare commits

...

2 Commits

Author SHA1 Message Date
Carl Schwan
fab2a81aee Ton down the intensity of the background on dark theme 2024-12-15 16:12:37 +01:00
Carl Schwan
4daff26747 Add background to room page
Similar to What's App, Telegram and Kaidan.
2024-12-12 12:57:18 +01:00
4 changed files with 22 additions and 0 deletions

View File

@@ -163,6 +163,23 @@ Kirigami.Page {
Kirigami.Theme.colorSet: Kirigami.Theme.View
Kirigami.Theme.inherit: false
color: NeoChatConfig.compactLayout ? Kirigami.Theme.backgroundColor : "transparent"
Image {
visible: !NeoChatConfig.compactLayout && !NeoChatConfig.blur
source: "qrc:/qt/qml/org/kde/neochat/timeline/images/chat-page-background.svg"
anchors.fill: parent
fillMode: Image.Tile
horizontalAlignment: Image.AlignLeft
verticalAlignment: Image.AlignTop
function isDarkColor(background: color): bool {
const temp = Qt.darker(background, 1);
const darkness = 1 - (0.299 * temp.r + 0.587 * temp.g + 0.114 * temp.b);
return temp.a > 0 && darkness >= 0.4;
}
opacity: isDarkColor(Kirigami.Theme.backgroundColor) ? 0.2 : 1
}
}
footer: Loader {

View File

@@ -79,6 +79,7 @@ ecm_add_qml_module(timeline GENERATE_PLUGIN_SOURCE
images/transfer.svg
images/wait.svg
images/walk.svg
images/chat-page-background.svg
DEPENDENCIES
QtQuick
)

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022 Raghavendra Kamath <raghu@raghukamath.com>
SPDX-License-Identifier: CC-BY-SA-4.0