From 171695750c5dcc12441019a1b50050752e19a3c5 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Thu, 3 Sep 2020 15:40:44 -0700 Subject: [PATCH] minor widget and theme fix/additions for the profile manager --- Icon.qml | 4 ++++ PortraitRow.qml | 3 +++ RadioButton.qml | 28 +++++++++++++++++++++------- Setting.qml | 7 ++++--- TextField.qml | 3 +++ theme/CwtchDark.qml | 1 + theme/CwtchLight.qml | 5 +++-- theme/Theme.qml | 3 +++ theme/ThemeType.qml | 4 +++- 9 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Icon.qml b/Icon.qml index 34dc462..f9e4000 100644 --- a/Icon.qml +++ b/Icon.qml @@ -26,6 +26,8 @@ Rectangle { signal clicked() + signal hover(bool hover) + //property int horizontalPadding: 0 //property int verticalPadding: 0 @@ -68,10 +70,12 @@ Rectangle { onEntered: { isHover = true + root.hover(true) } onExited: { isHover = false + root.hover(false) } } diff --git a/PortraitRow.qml b/PortraitRow.qml index 8c5a3c3..e212a35 100644 --- a/PortraitRow.qml +++ b/PortraitRow.qml @@ -36,6 +36,9 @@ Item { property alias badgeContent: portrait.badgeContent property alias hoverEnabled: buttonMA.hoverEnabled + // Ideally read only for icons to match against + property alias color: crRect.color + property alias content: extraMeta.children signal clicked(string handle) diff --git a/RadioButton.qml b/RadioButton.qml index 5ce7b21..2cf9ff2 100644 --- a/RadioButton.qml +++ b/RadioButton.qml @@ -1,27 +1,41 @@ import QtQuick 2.7 import QtQuick.Controls 2.13 - +import "theme" +import "fonts" RadioButton { id: control - property real size: 12 - spacing: 0 + property color textColor: Theme.mainTextColor + property color indicatorColor: Theme.boxCheckedColor + //property real size: 12 + spacing: 0 //4 * gcd.themeScale + indicator: Rectangle { width: 16 * gcd.themeScale height: 16 * gcd.themeScale anchors.verticalCenter: parent.verticalCenter - radius: 9 + radius: 9 * gcd.themeScale border.width: 1 Rectangle { anchors.fill: parent visible: control.checked - color: "black" - radius: 9 - anchors.margins: 4 + color: indicatorColor + radius: 9 * gcd.themeScale + anchors.margins: 4 * gcd.themeScale } } + + contentItem: ScalingLabel { + size: Theme.chatMetaTextSize + color: textColor + text: control.text + font.family: Fonts.applicationFontRegular.name + font.styleName: "Bold" + leftPadding: control.indicator.width + control.spacing + } + } diff --git a/Setting.qml b/Setting.qml index 903a186..40b093f 100644 --- a/Setting.qml +++ b/Setting.qml @@ -31,12 +31,12 @@ Column { Grid { id: container columns: inline ? 2 : 1 - spacing: 10 - padding: 10 + spacing: 10 * gcd.themeScale + padding: 10 * gcd.themeScale width: parent.width - property int gridWidth: inline ? (parent.width / 2) - 20 : parent.width - 20 + property int gridWidth: inline ? (parent.width / 2) - (20 * gcd.themeScale) : parent.width - (20 * gcd.themeScale) anchors.horizontalCenter: parent.horizontalCenter @@ -47,6 +47,7 @@ Column { color: Theme.mainTextColor size: Theme.secondaryTextSize * gcd.themeScale font.weight: Font.Bold + visible: text != "" } diff --git a/TextField.qml b/TextField.qml index d0f4f0d..31ca86f 100644 --- a/TextField.qml +++ b/TextField.qml @@ -17,6 +17,9 @@ TextField { font.pointSize: 10 * gcd.themeScale width: 100 + // selectByMouse shouldn't be enabled on mobile + selectByMouse: gcd.os != "android" && !readOnly + background: Rectangle { radius: 2 color: Theme.textfieldBackgroundColor diff --git a/theme/CwtchDark.qml b/theme/CwtchDark.qml index b4874ce..d950ce8 100644 --- a/theme/CwtchDark.qml +++ b/theme/CwtchDark.qml @@ -60,6 +60,7 @@ ThemeType { sliderButtonColor: whitePurple sliderBarLeftColor: mauvePurple sliderBarRightColor: mauvePurple + boxCheckedColor: hotPink toolbarIconColor: whitePurple toolbarMainColor: darkGreyPurple diff --git a/theme/CwtchLight.qml b/theme/CwtchLight.qml index 5133099..5d21d3b 100644 --- a/theme/CwtchLight.qml +++ b/theme/CwtchLight.qml @@ -33,8 +33,8 @@ ThemeType { textfieldBackgroundColor: whitePurple textfieldBorderColor: purple textfieldTextColor: purple - textfieldButtonColor: purple - textfieldButtonTextColor: pink + textfieldButtonColor: hotPink + textfieldButtonTextColor: whitePurple portraitOnlineBorderColor: darkPurple portraitOnlineBackgroundColor: darkPurple @@ -61,6 +61,7 @@ ThemeType { sliderButtonColor: pink sliderBarLeftColor: purple sliderBarRightColor: purple + boxCheckedColor: darkPurple toolbarIconColor: darkPurple toolbarMainColor: whitePurple diff --git a/theme/Theme.qml b/theme/Theme.qml index 9341c4a..e672063 100644 --- a/theme/Theme.qml +++ b/theme/Theme.qml @@ -56,6 +56,8 @@ Item { readonly property color sliderButtonColor: theme.sliderButtonColor readonly property color sliderBarLeftColor: theme.sliderBarLeftColor readonly property color sliderBarRightColor: theme.sliderBarRightColor + readonly property color boxCheckedColor: theme.boxCheckedColor + readonly property color toolbarIconColor: theme.toolbarIconColor readonly property color toolbarMainColor: theme.toolbarMainColor @@ -83,6 +85,7 @@ Item { readonly property int headerSize: 50 readonly property int usernameSize: 30 + readonly property int primaryTextSize: 25 readonly property int tabSize: 25 readonly property int chatSize: 20 readonly property int secondaryTextSize: 20 // address diff --git a/theme/ThemeType.qml b/theme/ThemeType.qml index 4213855..a06f2a5 100644 --- a/theme/ThemeType.qml +++ b/theme/ThemeType.qml @@ -40,7 +40,6 @@ QtObject { property color portraitBlockedBackgroundColor: "red" property color portraitBlockedTextColor: "red" - property color portraitContactBadgeColor: "red" property color portraitContactBadgeTextColor: "red" property color portraitProfileBadgeColor: "red" @@ -52,6 +51,8 @@ QtObject { property color sliderButtonColor: "red" property color sliderBarLeftColor: "red" property color sliderBarRightColor: "red" + property color boxCheckedColor: "red" + property color toolbarIconColor: "red" property color toolbarMainColor: "red" @@ -77,6 +78,7 @@ QtObject { property color messageStatusAlertColor: "red" property color messageStatusAlertTextColor: "red" + // ... more to come