From db082d122d00689feaa94a00b1ab5a30fa217c0c Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Sun, 6 Mar 2022 18:08:55 +0100 Subject: [PATCH 1/3] Add option 'sessionButtonOpacity', default user list text color to white --- SessionButton.qml | 1 + components/UserDelegate.qml | 3 ++- theme.conf | 2 ++ theme.conf.user | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SessionButton.qml b/SessionButton.qml index 8cb56ba..abcb777 100644 --- a/SessionButton.qml +++ b/SessionButton.qml @@ -14,6 +14,7 @@ import QtQuick.Controls 1.3 as QQC PlasmaComponents.ToolButton { id: root property int currentIndex: -1 + opacity: config.sessionButtonOpacity implicitWidth: minimumWidth diff --git a/components/UserDelegate.qml b/components/UserDelegate.qml index 9a823a2..1582188 100644 --- a/components/UserDelegate.qml +++ b/components/UserDelegate.qml @@ -58,7 +58,7 @@ Item { bottomMargin: PlasmaCore.Units.largeSpacing horizontalCenter: parent.horizontalCenter } - Behavior on width { + Behavior on width { PropertyAnimation { from: faceSize duration: PlasmaCore.Units.longDuration; @@ -161,6 +161,7 @@ Item { text: wrapper.name style: softwareRendering ? Text.Outline : Text.Normal styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + color: 'white' elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter //make an indication that this has active focus, this only happens when reached with keyboard navigation diff --git a/theme.conf b/theme.conf index 7882e7c..701ef26 100644 --- a/theme.conf +++ b/theme.conf @@ -19,3 +19,5 @@ relativePositionX=0.3 relativePositionY=0.7 showTopBar=true autofocusInput=true + +sessionButtonOpacity=0.5 diff --git a/theme.conf.user b/theme.conf.user index 156cc82..711535c 100644 --- a/theme.conf.user +++ b/theme.conf.user @@ -9,3 +9,5 @@ type=color usernameLeftMargin=15 showTopBar=true autofocusInput=true + +sessionButtonOpacity=0.5 From 53de25cc27f803c7d6757d8fa59bf390f3f70e16 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Sun, 6 Mar 2022 20:08:18 +0100 Subject: [PATCH 2/3] Increase avatar size, add outline to usernames --- components/Clock.qml | 41 +++++++++++++++++++++++++++++++++++++ components/UserDelegate.qml | 15 ++++++++------ components/UserList.qml | 4 ++-- 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 components/Clock.qml diff --git a/components/Clock.qml b/components/Clock.qml new file mode 100644 index 0000000..1d2d42e --- /dev/null +++ b/components/Clock.qml @@ -0,0 +1,41 @@ +/* + SPDX-FileCopyrightText: 2016 David Edmundson + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +import QtQuick 2.8 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.5 as QQC2 +import org.kde.plasma.core 2.0 as PlasmaCore + +ColumnLayout { + readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software + + QQC2.Label { + text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) + color: PlasmaCore.ColorScope.textColor + // style: softwareRendering ? Text.Outline : Text.Normal + // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + style: Text.Outline + styleColor: "gray" + font.pointSize: 48 + Layout.alignment: Qt.AlignHCenter + } + QQC2.Label { + text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) + color: PlasmaCore.ColorScope.textColor + // style: softwareRendering ? Text.Outline : Text.Normal + // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + style: Text.Outline + styleColor: "gray" + font.pointSize: 24 + Layout.alignment: Qt.AlignHCenter + } + PlasmaCore.DataSource { + id: timeSource + engine: "time" + connectedSources: ["Local"] + interval: 1000 + } +} diff --git a/components/UserDelegate.qml b/components/UserDelegate.qml index 1582188..4be9a78 100644 --- a/components/UserDelegate.qml +++ b/components/UserDelegate.qml @@ -30,9 +30,9 @@ Item { property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2 signal clicked() - property real faceSize: PlasmaCore.Units.gridUnit * 7 + property real faceSize: PlasmaCore.Units.gridUnit * 10 - opacity: isCurrent ? 1.0 : 0.5 + opacity: isCurrent ? 1.0 : 0.75 Behavior on opacity { OpacityAnimator { @@ -64,7 +64,7 @@ Item { duration: PlasmaCore.Units.longDuration; } } - width: isCurrent ? faceSize : faceSize - PlasmaCore.Units.largeSpacing + width: isCurrent ? faceSize : faceSize * 0.75 height: width //Image takes priority, taking a full path to a file, if that doesn't exist we show an icon @@ -152,15 +152,18 @@ Item { id: usernameDelegate // Make it bigger than other fonts to match the scale of the avatar better - font.pointSize: wrapper.fontSize + 4 + font.pointSize: wrapper.fontSize + 10 anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter } width: constrainText ? parent.width : implicitWidth text: wrapper.name - style: softwareRendering ? Text.Outline : Text.Normal - styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + // style: softwareRendering ? Text.Outline : Text.Normal + // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + style: Text.Outline + styleColor: "gray" + // Text { font.pointSize: 18; text: "hello"; style: Text.Raised; styleColor: "gray" } color: 'white' elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter diff --git a/components/UserList.qml b/components/UserList.qml index 49f38eb..afe829b 100644 --- a/components/UserList.qml +++ b/components/UserList.qml @@ -10,8 +10,8 @@ import org.kde.plasma.core 2.0 as PlasmaCore ListView { id: view readonly property string selectedUser: currentItem ? currentItem.userName : "" - readonly property int userItemWidth: PlasmaCore.Units.gridUnit * 8 - readonly property int userItemHeight: PlasmaCore.Units.gridUnit * 8 + readonly property int userItemWidth: PlasmaCore.Units.gridUnit * 11 + readonly property int userItemHeight: PlasmaCore.Units.gridUnit * 11 property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2 implicitHeight: userItemHeight From 79ae3de43517f9f0937cae35feb5db8dec3fcf5c Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Sun, 6 Mar 2022 21:17:10 +0100 Subject: [PATCH 3/3] Parameterize colors, sizes, margins --- Main.qml | 3 --- components/Clock.qml | 16 ++++++---------- components/UserDelegate.qml | 15 ++++++--------- components/UserList.qml | 4 ++-- theme.conf | 14 ++++++++++++-- theme.conf.user | 14 ++++++++++++-- 6 files changed, 38 insertions(+), 28 deletions(-) diff --git a/Main.qml b/Main.qml index 26f7225..1ea2291 100644 --- a/Main.qml +++ b/Main.qml @@ -616,9 +616,6 @@ Rectangle { id: clock y: parent.height * config.relativePositionY - clock.height / 2 x: parent.width * config.relativePositionX - clock.width / 2 - color: "white" - timeFont.family: textFont.name - dateFont.family: textFont.name } Rectangle { diff --git a/components/Clock.qml b/components/Clock.qml index 1d2d42e..725ab4b 100644 --- a/components/Clock.qml +++ b/components/Clock.qml @@ -14,22 +14,18 @@ ColumnLayout { QQC2.Label { text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) - color: PlasmaCore.ColorScope.textColor - // style: softwareRendering ? Text.Outline : Text.Normal - // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + color: config.textColor style: Text.Outline - styleColor: "gray" - font.pointSize: 48 + styleColor: config.textOutlineColor + font.pointSize: config.timeFontPointSize Layout.alignment: Qt.AlignHCenter } QQC2.Label { text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) - color: PlasmaCore.ColorScope.textColor - // style: softwareRendering ? Text.Outline : Text.Normal - // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter + color: config.textColor style: Text.Outline - styleColor: "gray" - font.pointSize: 24 + styleColor: config.textOutlineColor + font.pointSize: config.dateFontPointSize Layout.alignment: Qt.AlignHCenter } PlasmaCore.DataSource { diff --git a/components/UserDelegate.qml b/components/UserDelegate.qml index 4be9a78..4b6e3e1 100644 --- a/components/UserDelegate.qml +++ b/components/UserDelegate.qml @@ -30,9 +30,9 @@ Item { property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2 signal clicked() - property real faceSize: PlasmaCore.Units.gridUnit * 10 + property real faceSize: PlasmaCore.Units.gridUnit * config.faceSizeInGridUnits - opacity: isCurrent ? 1.0 : 0.75 + opacity: isCurrent ? 1.0 : config.avatarOpacityWhenNotSelected Behavior on opacity { OpacityAnimator { @@ -64,7 +64,7 @@ Item { duration: PlasmaCore.Units.longDuration; } } - width: isCurrent ? faceSize : faceSize * 0.75 + width: isCurrent ? faceSize : faceSize * config.faceSizeFactorWhenNotSelected height: width //Image takes priority, taking a full path to a file, if that doesn't exist we show an icon @@ -152,19 +152,16 @@ Item { id: usernameDelegate // Make it bigger than other fonts to match the scale of the avatar better - font.pointSize: wrapper.fontSize + 10 + font.pointSize: config.usernamePointSize anchors { bottom: parent.bottom horizontalCenter: parent.horizontalCenter } width: constrainText ? parent.width : implicitWidth text: wrapper.name - // style: softwareRendering ? Text.Outline : Text.Normal - // styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter style: Text.Outline - styleColor: "gray" - // Text { font.pointSize: 18; text: "hello"; style: Text.Raised; styleColor: "gray" } - color: 'white' + styleColor: config.textOutlineColor + color: config.textColor elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter //make an indication that this has active focus, this only happens when reached with keyboard navigation diff --git a/components/UserList.qml b/components/UserList.qml index afe829b..a55a001 100644 --- a/components/UserList.qml +++ b/components/UserList.qml @@ -10,8 +10,8 @@ import org.kde.plasma.core 2.0 as PlasmaCore ListView { id: view readonly property string selectedUser: currentItem ? currentItem.userName : "" - readonly property int userItemWidth: PlasmaCore.Units.gridUnit * 11 - readonly property int userItemHeight: PlasmaCore.Units.gridUnit * 11 + readonly property int userItemWidth: PlasmaCore.Units.gridUnit * config.faceElemWidthInGridUnits + readonly property int userItemHeight: PlasmaCore.Units.gridUnit * config.faceElemHeightInGridUnits property int fontSize: PlasmaCore.Theme.defaultFont.pointSize + 2 implicitHeight: userItemHeight diff --git a/theme.conf b/theme.conf index 701ef26..aeb41e6 100644 --- a/theme.conf +++ b/theme.conf @@ -9,8 +9,6 @@ needsFullUserModel=false background_img_day=background.jpg background_img_night=background.jpg -background_vid_day=playlists/day.m3u -background_vid_night=playlists/night.m3u displayFont="Droid Sans Mono for Powerline" showLoginButton=true passwordLeftMargin=15 @@ -20,4 +18,16 @@ relativePositionY=0.7 showTopBar=true autofocusInput=true +background_vid_day=playlists/all_sd.m3u +background_vid_night=playlists/all_sd.m3u sessionButtonOpacity=0.5 +textColor=white +textOutlineColor=black +avatarOpacityWhenNotSelected=0.75 +faceSizeInGridUnits=10 +faceSizeFactorWhenNotSelected=0.75 +faceElemWidthInGridUnits=11 +faceElemHeightInGridUnits=11 +usernamePointSize=20 +timeFontPointSize=56 +dateFontPointSize=24 diff --git a/theme.conf.user b/theme.conf.user index 711535c..803a52d 100644 --- a/theme.conf.user +++ b/theme.conf.user @@ -1,6 +1,4 @@ [General] -background_vid_day=playlists/day.m3u -background_vid_night=playlists/night.m3u passwordLeftMargin=15 relativePositionX=0.5 relativePositionY=0.75 @@ -10,4 +8,16 @@ usernameLeftMargin=15 showTopBar=true autofocusInput=true +background_vid_day=playlists/all_sd.m3u +background_vid_night=playlists/all_sd.m3u sessionButtonOpacity=0.5 +textColor=white +textOutlineColor=black +avatarOpacityWhenNotSelected=0.75 +faceSizeInGridUnits=10 +faceSizeFactorWhenNotSelected=0.75 +faceElemWidthInGridUnits=11 +faceElemHeightInGridUnits=11 +usernamePointSize=20 +timeFontPointSize=56 +dateFontPointSize=24