From 89fcfbea82cc51dd49ac82b35670dd0c592de9f7 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 28 Apr 2019 15:13:18 -0400 Subject: [PATCH] Colors for controls and PaneToolBar --- harmonyqml/components/Base/HButton.qml | 2 +- .../components/Base/HScrollableTextArea.qml | 6 +++++ harmonyqml/components/Base/HStyle.qml | 24 ++++++++++++++++++- harmonyqml/components/Base/HTextField.qml | 7 ++++++ harmonyqml/components/Chat/SendBox.qml | 1 + .../components/SidePane/PaneToolBar.qml | 6 ++++- 6 files changed, 43 insertions(+), 3 deletions(-) diff --git a/harmonyqml/components/Base/HButton.qml b/harmonyqml/components/Base/HButton.qml index 152ef4a3..526a88cd 100644 --- a/harmonyqml/components/Base/HButton.qml +++ b/harmonyqml/components/Base/HButton.qml @@ -8,7 +8,7 @@ Button { property bool circle: false property int fontSize: HStyle.fontSize.normal - property color backgroundColor: "lightgray" + property color backgroundColor: HStyle.controls.button.background property alias overlayOpacity: buttonBackgroundOverlay.opacity property bool loading: false diff --git a/harmonyqml/components/Base/HScrollableTextArea.qml b/harmonyqml/components/Base/HScrollableTextArea.qml index aede4a77..52d1ebb2 100644 --- a/harmonyqml/components/Base/HScrollableTextArea.qml +++ b/harmonyqml/components/Base/HScrollableTextArea.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.2 ScrollView { + property alias backgroundColor: textAreaBackground.color property alias placeholderText: textArea.placeholderText property alias text: textArea.text property alias area: textArea @@ -18,7 +19,12 @@ ScrollView { wrapMode: TextEdit.Wrap font.family: HStyle.fontFamily.sans font.pixelSize: HStyle.fontSize.normal + color: HStyle.colors.foreground + background: Rectangle { + id: textAreaBackground + color: HStyle.controls.textArea.background + } } } diff --git a/harmonyqml/components/Base/HStyle.qml b/harmonyqml/components/Base/HStyle.qml index 7e30287c..2cfbff6a 100644 --- a/harmonyqml/components/Base/HStyle.qml +++ b/harmonyqml/components/Base/HStyle.qml @@ -20,6 +20,8 @@ QtObject { property string mono: "Hack" } + property int radius: 5 + readonly property QtObject colors: QtObject { property color background0: Qt.hsla(0, 0, 0.8, 0.5) property color background1: Qt.hsla(0, 0, 0.8, 0.7) @@ -28,10 +30,30 @@ QtObject { property color foregroundError: Qt.hsla(0.95, 0.64, 0.32, 1) } - property int radius: 5 + readonly property QtObject controls: QtObject { + readonly property QtObject button: QtObject { + property color background: colors.background1 + } + + readonly property QtObject textField: QtObject { + property color background: colors.background1 + } + + readonly property QtObject textArea: QtObject { + property color background: colors.background1 + } + } readonly property QtObject sidePane: QtObject { property color background: colors.background1 + + readonly property QtObject settingsButton: QtObject { + property color background: colors.background1 + } + + readonly property QtObject filterRooms: QtObject { + property color background: colors.background1 + } } readonly property QtObject chat: QtObject { diff --git a/harmonyqml/components/Base/HTextField.qml b/harmonyqml/components/Base/HTextField.qml index c300cd86..8cc43d60 100644 --- a/harmonyqml/components/Base/HTextField.qml +++ b/harmonyqml/components/Base/HTextField.qml @@ -2,9 +2,16 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 TextField { + property alias backgroundColor: textFieldBackground.color + font.family: HStyle.fontFamily.sans font.pixelSize: HStyle.fontSize.normal + color: HStyle.colors.foreground + background: Rectangle { + id: textFieldBackground + color: HStyle.controls.textField.background + } selectByMouse: true } diff --git a/harmonyqml/components/Chat/SendBox.qml b/harmonyqml/components/Chat/SendBox.qml index c3cf9fd6..07a2e09d 100644 --- a/harmonyqml/components/Chat/SendBox.qml +++ b/harmonyqml/components/Chat/SendBox.qml @@ -29,6 +29,7 @@ Base.HGlassRectangle { id: textArea placeholderText: qsTr("Type a message...") + backgroundColor: "transparent" area.focus: true function setTyping(typing) { diff --git a/harmonyqml/components/SidePane/PaneToolBar.qml b/harmonyqml/components/SidePane/PaneToolBar.qml index 40a8b5f1..69ed436d 100644 --- a/harmonyqml/components/SidePane/PaneToolBar.qml +++ b/harmonyqml/components/SidePane/PaneToolBar.qml @@ -9,11 +9,15 @@ Base.HRowLayout { Layout.fillWidth: true Layout.preferredHeight: 32 - Base.HButton { iconName: "settings" } + Base.HButton { + iconName: "settings" + backgroundColor: Base.HStyle.sidePane.settingsButton.background + } Base.HTextField { id: filterField placeholderText: qsTr("Filter rooms") + backgroundColor: Base.HStyle.sidePane.filterRooms.background Layout.fillWidth: true Layout.preferredHeight: 32