diff --git a/Portrait.qml b/Portrait.qml index cd83a50..a64d81a 100644 --- a/Portrait.qml +++ b/Portrait.qml @@ -8,8 +8,6 @@ import "theme" Item { id: imgProfile - implicitWidth: baseWidth - implicitHeight: baseWidth property string source property alias badgeColor: badge.color @@ -24,6 +22,12 @@ Item { property alias badgeVisible: badge.visible property alias badgeContent: badge.content + property bool performTransform: false + property alias overlayColor: iconColorOverlay.color + property real rotationAngle: 0.0 + + implicitWidth: baseWidth + implicitHeight: baseWidth Rectangle { id: mainImage @@ -54,6 +58,18 @@ Item { sourceSize.height: imageInner.height*2 } + ColorOverlay{ + id: iconColorOverlay + anchors.fill: img + + source: img + visible: false + + antialiasing: true + smooth: true + transform: Rotation { origin.x: width/2; origin.y: height / 2; angle: rotationAngle} + } + Image { // CIRCLE MASK id: mask fillMode: Image.PreserveAspectFit @@ -63,7 +79,7 @@ Item { OpacityMask { anchors.fill: img - source: img + source: performTransform ? iconColorOverlay : img maskSource: mask } } diff --git a/ScalingLabel.qml b/ScalingLabel.qml index 5be2a3d..fd03ec1 100644 --- a/ScalingLabel.qml +++ b/ScalingLabel.qml @@ -5,6 +5,7 @@ import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 import QtQuick.Window 2.11 import "theme" +import "fonts" Label { font.pixelSize: gcd.themeScale * size @@ -12,4 +13,8 @@ Label { color: Theme.mainTextColor textFormat: Text.PlainText property real size: 12 + property bool bold: false + + font.family: bold ? Fonts.applicationFontRegular.name : Fonts.applicationFontBold.name + font.styleName: bold ? "Bold" : "" } diff --git a/TextField.qml b/TextField.qml index 31ca86f..f60361e 100644 --- a/TextField.qml +++ b/TextField.qml @@ -13,7 +13,10 @@ For example: */ TextField { - color: Theme.textfieldTextColor + property color errorColor: Theme.textfieldErrorColor + property bool error: false + + color: error ? errorColor : Theme.textfieldTextColor font.pointSize: 10 * gcd.themeScale width: 100 @@ -23,6 +26,6 @@ TextField { background: Rectangle { radius: 2 color: Theme.textfieldBackgroundColor - border.color: Theme.textfieldBorderColor + border.color: error ? errorColor : Theme.textfieldBorderColor } } diff --git a/UnderlineTextField.qml b/UnderlineTextField.qml index e1675c5..1f613ea 100644 --- a/UnderlineTextField.qml +++ b/UnderlineTextField.qml @@ -9,8 +9,10 @@ import "theme" // UnderlineTextField is a textfield styled as just an underline TextField { property alias backgroundColor: bg.color + property color errorColor: Theme.textfieldErrorColor + property bool error: false - color: Theme.mainTextColor + color: error ? errorColor : Theme.mainTextColor font.pixelSize: Theme.secondaryTextSize * gcd.themeScale * gcd.themeScale signal clicked smooth: true @@ -29,6 +31,6 @@ TextField { anchors.left: parent.left anchors.right: parent.right height: 2 - color: Theme.mainTextColor + color: error ? errorColor : Theme.mainTextColor } } diff --git a/theme/CwtchDark.qml b/theme/CwtchDark.qml index 3d2f36f..f5893b2 100644 --- a/theme/CwtchDark.qml +++ b/theme/CwtchDark.qml @@ -33,6 +33,7 @@ ThemeType { textfieldBackgroundColor: deepPurple textfieldBorderColor: deepPurple textfieldTextColor: purple + textfieldErrorColor: hotPink textfieldButtonColor: purple textfieldButtonTextColor: darkGreyPurple @@ -54,6 +55,7 @@ ThemeType { portraitContactBadgeColor: hotPink portraitContactBadgeTextColor: whitePurple portraitProfileBadgeColor: mauvePurple + portraitProfileBadgeTextColor: darkGreyPurple dropShadowColor: mauvePurple dropShadowPaneColor: darkGreyPurple diff --git a/theme/CwtchLight.qml b/theme/CwtchLight.qml index 56ff0f0..74b9fd5 100644 --- a/theme/CwtchLight.qml +++ b/theme/CwtchLight.qml @@ -34,6 +34,7 @@ ThemeType { textfieldBackgroundColor: whitePurple textfieldBorderColor: purple textfieldTextColor: purple + textfieldErrorColor: hotPink textfieldButtonColor: hotPink textfieldButtonTextColor: whitePurple @@ -55,6 +56,7 @@ ThemeType { portraitContactBadgeColor: hotPink portraitContactBadgeTextColor: whitePurple portraitProfileBadgeColor: brightPurple + portraitProfileBadgeTextColor: whitePurple dropShadowColor: purple dropShadowPaneColor: purple diff --git a/theme/Theme.qml b/theme/Theme.qml index 7de372b..93e6e03 100644 --- a/theme/Theme.qml +++ b/theme/Theme.qml @@ -26,6 +26,7 @@ Item { readonly property color textfieldBackgroundColor: theme.textfieldBackgroundColor readonly property color textfieldBorderColor: theme.textfieldBorderColor readonly property color textfieldTextColor: theme.textfieldTextColor + readonly property color textfieldErrorColor: theme.textfieldErrorColor readonly property color textfieldButtonColor: theme.textfieldButtonColor readonly property color textfieldButtonTextColor: theme.textfieldButtonTextColor @@ -51,6 +52,7 @@ Item { readonly property color portraitContactBadgeColor: theme.portraitContactBadgeColor readonly property color portraitContactBadgeTextColor: theme.portraitContactBadgeTextColor readonly property color portraitProfileBadgeColor: theme.portraitProfileBadgeColor + readonly property color portraitProfileBadgeTextColor: theme.portraitProfileBadgeTextColor readonly property color toggleColor: theme.toggleColor readonly property color toggleOffColor: theme.toggleOffColor diff --git a/theme/ThemeType.qml b/theme/ThemeType.qml index 840cc62..a04aaa7 100644 --- a/theme/ThemeType.qml +++ b/theme/ThemeType.qml @@ -24,6 +24,7 @@ QtObject { property color textfieldBackgroundColor: "red" property color textfieldBorderColor: "red" property color textfieldTextColor: "red" + property color textfieldErrorColor: "red" property color textfieldButtonColor: "red" property color textfieldButtonTextColor: "red" @@ -45,6 +46,7 @@ QtObject { property color portraitContactBadgeColor: "red" property color portraitContactBadgeTextColor: "red" property color portraitProfileBadgeColor: "red" + property color portraitProfileBadgeTextColor: "red" property color dropShadowColor: "black" property color dropShadowPaneColor: "black" property color toggleColor: "black"