diff --git a/imports/NeoChat/Settings/AppearanceSettingsPage.qml b/imports/NeoChat/Settings/AppearanceSettingsPage.qml index cf2662e8a..db1194495 100644 --- a/imports/NeoChat/Settings/AppearanceSettingsPage.qml +++ b/imports/NeoChat/Settings/AppearanceSettingsPage.qml @@ -204,6 +204,28 @@ Kirigami.ScrollablePage { Config.save(); } } + RowLayout { + visible: Controller.hasWindowSystem && Config.blur + Kirigami.FormData.label: i18n("Transparency:") + QQC2.Slider { + enabled: !Config.compactLayout && Config.blur + from: 0 + to: 1 + stepSize: 0.05 + value: Config.transparency + onMoved: { + Config.transparency = value; + Config.save(); + } + + HoverHandler { id: sliderHover } + QQC2.ToolTip.visible: sliderHover.hovered && !enabled + QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.") + } + QQC2.Label { + text: Math.round(Config.transparency * 100) + "%" + } + } QQC2.CheckBox { text: i18n("Show your messages on the right") checked: Config.showLocalMessagesOnRight diff --git a/qml/main.qml b/qml/main.qml index 30bd1f353..d1fe72586 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -296,7 +296,14 @@ Kirigami.ApplicationWindow { } } + // blur effect color: Config.blur && !Config.compactLayout ? "transparent" : Kirigami.Theme.backgroundColor + + // we need to apply the translucency effect separately on top of the color + background: Rectangle { + color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent" + } + Component { id: roomListComponent RoomListPage { diff --git a/src/neochatconfig.kcfg b/src/neochatconfig.kcfg index 8acba0e2a..f89fe5c9d 100644 --- a/src/neochatconfig.kcfg +++ b/src/neochatconfig.kcfg @@ -21,6 +21,10 @@ false + + + 0.3 + true