Use color palette.

This commit is contained in:
Black Hat 2018-12-16 10:47:58 +08:00
parent df045a786f
commit 0d06498467
10 changed files with 34 additions and 13 deletions

View File

@ -1,7 +1,6 @@
import QtQuick 2.12
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.4
import Spectral.Setting 0.1
import Spectral.Font 0.1
@ -11,7 +10,7 @@ Text {
id: materialLabel
color: Material.foreground
color: MPalette.foreground
font.pixelSize: 24
font.family: MaterialFont.name
horizontalAlignment: Text.AlignHCenter

View File

@ -58,7 +58,7 @@ ColumnLayout {
visible: !(sentByMe || avatarVisible)
text: Qt.formatDateTime(time, "hh:mm")
color: "#5B7480"
color: MPalette.lighter
font.pixelSize: 10
horizontalAlignment: Label.AlignHCenter

View File

@ -1,8 +1,10 @@
import QtQuick 2.12
import QtQuick.Controls 2.4
import Spectral.Setting 0.1
Label {
text: section + " • " + Qt.formatTime(time, "hh:mm")
color: MPalette.foreground
font.pixelSize: 13
font.weight: Font.Medium
font.capitalization: Font.AllUppercase

View File

@ -6,6 +6,7 @@ import QtQuick.Controls.Material 2.4
import Spectral 0.1
import Spectral.Effect 2.0
import Spectral.Component 2.0
import Spectral.Setting 0.1
Control {
property alias avatar: headerImage.source
@ -53,6 +54,7 @@ Control {
Layout.fillHeight: true
text: currentRoom ? currentRoom.displayName : ""
color: MPalette.foreground
font.pixelSize: 16
elide: Text.ElideRight
wrapMode: Text.NoWrap
@ -64,7 +66,7 @@ Control {
id: headerTopicLabel
color: "#5B7480"
color: MPalette.lighter
elide: Text.ElideRight
wrapMode: Text.NoWrap
}

View File

@ -12,7 +12,7 @@ import Spectral.Setting 0.1
import SortFilterProxyModel 0.2
Rectangle {
Item {
property var controller: null
readonly property var user: controller.connection ? controller.connection.localUser : null
@ -25,8 +25,6 @@ Rectangle {
id: root
color: MSettings.darkTheme ? "#303030" : "#FFFFFF"
RoomListModel {
id: roomListModel
@ -638,6 +636,7 @@ Rectangle {
topPadding: 0
bottomPadding: 0
placeholderText: "Search..."
color: MPalette.lighter
background: Item {}
}
@ -779,6 +778,7 @@ Rectangle {
Layout.fillHeight: true
text: name || "No Name"
color: MPalette.foreground
font.pixelSize: 16
elide: Text.ElideRight
wrapMode: Text.NoWrap
@ -789,7 +789,7 @@ Rectangle {
Layout.fillHeight: true
text: (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm,"")
color: "#5B7480"
color: MPalette.lighter
font.pixelSize: 13
elide: Text.ElideRight
wrapMode: Text.NoWrap
@ -855,7 +855,7 @@ Rectangle {
height: 24
text: section
color: "#5B7480"
color: MPalette.lighter
leftPadding: 16
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
@ -894,7 +894,7 @@ Rectangle {
}
Button {
text: "Reject"
text: "Cancel"
flat: true
onClicked: inviteDialog.close()

View File

@ -0,0 +1,13 @@
pragma Singleton
import QtQuick 2.12
import QtQuick.Controls.Material 2.3
QtObject {
readonly property int theme: MSettings.darkTheme ? Material.Dark : Material.Light
readonly property color primary: "#344955"
readonly property color accent: "#673AB7"
readonly property color foreground: MSettings.darkTheme ? "#FFFFFF" : "#1D333E"
readonly property color background: MSettings.darkTheme ? "#303030" : "#FFFFFF"
readonly property color lighter: MSettings.darkTheme ? "#FFFFFF" : "#5B7480"
}

View File

@ -1,3 +1,3 @@
module Spectral.Setting
singleton MSettings 0.1 Setting.qml
singleton MPalette 0.1 Palette.qml

View File

@ -14,7 +14,8 @@ import Spectral 0.1
import Spectral.Setting 0.1
ApplicationWindow {
Material.theme: MSettings.darkTheme ? Material.Dark : Material.Light
Material.theme: MPalette.theme
Material.background: MPalette.background
width: 960
height: 640
@ -26,6 +27,10 @@ ApplicationWindow {
visible: true
title: qsTr("Spectral")
background: Rectangle {
color: MSettings.darkTheme ? "#303030" : "#FFFFFF"
}
Platform.SystemTrayIcon {
visible: MSettings.showTray
iconSource: "qrc:/assets/img/icon.png"

View File

@ -10,5 +10,4 @@ Theme=Light
Variant=Dense
Primary=#344955
Accent=#673AB7
Background=#FFFFFF
Font/Family="Roboto,Noto Sans,Noto Color Emoji"

View File

@ -42,5 +42,6 @@
<file>assets/img/roompanel-dark.svg</file>
<file>imports/Spectral/Component/Timeline/ImageDelegate.qml</file>
<file>imports/Spectral/Component/Avatar.qml</file>
<file>imports/Spectral/Setting/Palette.qml</file>
</qresource>
</RCC>