Merge pull request 'Portrait performTransform + color; ScalingLabel bold option; TextField error option + color' (#17) from profileAddEdit into master

Reviewed-on: #17
This commit is contained in:
erinn 2020-10-23 14:56:58 -07:00
commit c33a868d0c
8 changed files with 41 additions and 7 deletions

View File

@ -8,8 +8,6 @@ import "theme"
Item { Item {
id: imgProfile id: imgProfile
implicitWidth: baseWidth
implicitHeight: baseWidth
property string source property string source
property alias badgeColor: badge.color property alias badgeColor: badge.color
@ -24,6 +22,12 @@ Item {
property alias badgeVisible: badge.visible property alias badgeVisible: badge.visible
property alias badgeContent: badge.content property alias badgeContent: badge.content
property bool performTransform: false
property alias overlayColor: iconColorOverlay.color
property real rotationAngle: 0.0
implicitWidth: baseWidth
implicitHeight: baseWidth
Rectangle { Rectangle {
id: mainImage id: mainImage
@ -54,6 +58,18 @@ Item {
sourceSize.height: imageInner.height*2 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 Image { // CIRCLE MASK
id: mask id: mask
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@ -63,7 +79,7 @@ Item {
OpacityMask { OpacityMask {
anchors.fill: img anchors.fill: img
source: img source: performTransform ? iconColorOverlay : img
maskSource: mask maskSource: mask
} }
} }

View File

@ -5,6 +5,7 @@ import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.11 import QtQuick.Window 2.11
import "theme" import "theme"
import "fonts"
Label { Label {
font.pixelSize: gcd.themeScale * size font.pixelSize: gcd.themeScale * size
@ -12,4 +13,8 @@ Label {
color: Theme.mainTextColor color: Theme.mainTextColor
textFormat: Text.PlainText textFormat: Text.PlainText
property real size: 12 property real size: 12
property bool bold: false
font.family: bold ? Fonts.applicationFontRegular.name : Fonts.applicationFontBold.name
font.styleName: bold ? "Bold" : ""
} }

View File

@ -13,7 +13,10 @@ For example:
*/ */
TextField { TextField {
color: Theme.textfieldTextColor property color errorColor: Theme.textfieldErrorColor
property bool error: false
color: error ? errorColor : Theme.textfieldTextColor
font.pointSize: 10 * gcd.themeScale font.pointSize: 10 * gcd.themeScale
width: 100 width: 100
@ -23,6 +26,6 @@ TextField {
background: Rectangle { background: Rectangle {
radius: 2 radius: 2
color: Theme.textfieldBackgroundColor color: Theme.textfieldBackgroundColor
border.color: Theme.textfieldBorderColor border.color: error ? errorColor : Theme.textfieldBorderColor
} }
} }

View File

@ -9,8 +9,10 @@ import "theme"
// UnderlineTextField is a textfield styled as just an underline // UnderlineTextField is a textfield styled as just an underline
TextField { TextField {
property alias backgroundColor: bg.color 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 font.pixelSize: Theme.secondaryTextSize * gcd.themeScale * gcd.themeScale
signal clicked signal clicked
smooth: true smooth: true
@ -29,6 +31,6 @@ TextField {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: 2 height: 2
color: Theme.mainTextColor color: error ? errorColor : Theme.mainTextColor
} }
} }

View File

@ -33,6 +33,7 @@ ThemeType {
textfieldBackgroundColor: deepPurple textfieldBackgroundColor: deepPurple
textfieldBorderColor: deepPurple textfieldBorderColor: deepPurple
textfieldTextColor: purple textfieldTextColor: purple
textfieldErrorColor: hotPink
textfieldButtonColor: purple textfieldButtonColor: purple
textfieldButtonTextColor: darkGreyPurple textfieldButtonTextColor: darkGreyPurple
@ -54,6 +55,7 @@ ThemeType {
portraitContactBadgeColor: hotPink portraitContactBadgeColor: hotPink
portraitContactBadgeTextColor: whitePurple portraitContactBadgeTextColor: whitePurple
portraitProfileBadgeColor: mauvePurple portraitProfileBadgeColor: mauvePurple
portraitProfileBadgeTextColor: darkGreyPurple
dropShadowColor: mauvePurple dropShadowColor: mauvePurple
dropShadowPaneColor: darkGreyPurple dropShadowPaneColor: darkGreyPurple

View File

@ -34,6 +34,7 @@ ThemeType {
textfieldBackgroundColor: whitePurple textfieldBackgroundColor: whitePurple
textfieldBorderColor: purple textfieldBorderColor: purple
textfieldTextColor: purple textfieldTextColor: purple
textfieldErrorColor: hotPink
textfieldButtonColor: hotPink textfieldButtonColor: hotPink
textfieldButtonTextColor: whitePurple textfieldButtonTextColor: whitePurple
@ -55,6 +56,7 @@ ThemeType {
portraitContactBadgeColor: hotPink portraitContactBadgeColor: hotPink
portraitContactBadgeTextColor: whitePurple portraitContactBadgeTextColor: whitePurple
portraitProfileBadgeColor: brightPurple portraitProfileBadgeColor: brightPurple
portraitProfileBadgeTextColor: whitePurple
dropShadowColor: purple dropShadowColor: purple
dropShadowPaneColor: purple dropShadowPaneColor: purple

View File

@ -26,6 +26,7 @@ Item {
readonly property color textfieldBackgroundColor: theme.textfieldBackgroundColor readonly property color textfieldBackgroundColor: theme.textfieldBackgroundColor
readonly property color textfieldBorderColor: theme.textfieldBorderColor readonly property color textfieldBorderColor: theme.textfieldBorderColor
readonly property color textfieldTextColor: theme.textfieldTextColor readonly property color textfieldTextColor: theme.textfieldTextColor
readonly property color textfieldErrorColor: theme.textfieldErrorColor
readonly property color textfieldButtonColor: theme.textfieldButtonColor readonly property color textfieldButtonColor: theme.textfieldButtonColor
readonly property color textfieldButtonTextColor: theme.textfieldButtonTextColor readonly property color textfieldButtonTextColor: theme.textfieldButtonTextColor
@ -51,6 +52,7 @@ Item {
readonly property color portraitContactBadgeColor: theme.portraitContactBadgeColor readonly property color portraitContactBadgeColor: theme.portraitContactBadgeColor
readonly property color portraitContactBadgeTextColor: theme.portraitContactBadgeTextColor readonly property color portraitContactBadgeTextColor: theme.portraitContactBadgeTextColor
readonly property color portraitProfileBadgeColor: theme.portraitProfileBadgeColor readonly property color portraitProfileBadgeColor: theme.portraitProfileBadgeColor
readonly property color portraitProfileBadgeTextColor: theme.portraitProfileBadgeTextColor
readonly property color toggleColor: theme.toggleColor readonly property color toggleColor: theme.toggleColor
readonly property color toggleOffColor: theme.toggleOffColor readonly property color toggleOffColor: theme.toggleOffColor

View File

@ -24,6 +24,7 @@ QtObject {
property color textfieldBackgroundColor: "red" property color textfieldBackgroundColor: "red"
property color textfieldBorderColor: "red" property color textfieldBorderColor: "red"
property color textfieldTextColor: "red" property color textfieldTextColor: "red"
property color textfieldErrorColor: "red"
property color textfieldButtonColor: "red" property color textfieldButtonColor: "red"
property color textfieldButtonTextColor: "red" property color textfieldButtonTextColor: "red"
@ -45,6 +46,7 @@ QtObject {
property color portraitContactBadgeColor: "red" property color portraitContactBadgeColor: "red"
property color portraitContactBadgeTextColor: "red" property color portraitContactBadgeTextColor: "red"
property color portraitProfileBadgeColor: "red" property color portraitProfileBadgeColor: "red"
property color portraitProfileBadgeTextColor: "red"
property color dropShadowColor: "black" property color dropShadowColor: "black"
property color dropShadowPaneColor: "black" property color dropShadowPaneColor: "black"
property color toggleColor: "black" property color toggleColor: "black"