feat: implement new colors for dark mode

This commit is contained in:
Jonathan Rainville 2021-02-18 14:07:23 -05:00 committed by Iuri Matias
parent 0e699cac65
commit 46412204c5
16 changed files with 42 additions and 35 deletions

View File

@ -14,7 +14,7 @@ Rectangle {
width: buttonRow.width + buttonsContainer.containerMargin * 2 width: buttonRow.width + buttonsContainer.containerMargin * 2
height: 36 height: 36
radius: Style.current.radius radius: Style.current.radius
color: Style.current.background color: Style.current.modalBackground
z: 52 z: 52
layer.enabled: true layer.enabled: true

View File

@ -65,7 +65,7 @@ Item {
+ (retry.visible && !chatTime.visible ? Style.current.smallPadding : 0) + (retry.visible && !chatTime.visible ? Style.current.smallPadding : 0)
width: parent.width width: parent.width
color: root.isHovered || isMessageActive ? (hasMention ? Style.current.mentionMessageHoverColor : Style.current.backgroundHover) : color: root.isHovered || isMessageActive ? (hasMention ? Style.current.mentionMessageHoverColor : Style.current.backgroundHoverLight) :
(hasMention ? Style.current.mentionMessageColor : Style.current.transparent) (hasMention ? Style.current.mentionMessageColor : Style.current.transparent)

View File

@ -61,7 +61,7 @@ Button {
btnBackground.color = "transparent" btnBackground.color = "transparent"
} }
onEntered: { onEntered: {
btnBackground.color = Style.current.topBarChatInfoColor btnBackground.color = Style.current.backgroundHover
} }
} }
} }

View File

@ -90,7 +90,7 @@ ModalPopup {
anchors.top: lblNewGroup.bottom anchors.top: lblNewGroup.bottom
//% "%1 / 10 members" //% "%1 / 10 members"
text: qsTrId("%1-/-10-members").arg(memberCount) text: qsTrId("%1-/-10-members").arg(memberCount)
color: Style.current.darkGrey color: Style.current.secondaryText
font.pixelSize: 15 font.pixelSize: 15
} }
} }

View File

@ -7,38 +7,39 @@ Theme {
property color black: "#000000" property color black: "#000000"
property color almostBlack: "#141414" property color almostBlack: "#141414"
property color grey: "#EEF2F5" property color grey: "#EEF2F5"
property color lightGrey: "#ccd0d4" property color lightGrey: "#7A7A7A"
property color darkGrey: "#373737"
property color evenDarkerGrey: "#4b4b4b"
property color lightBlue: "#ECEFFC" property color lightBlue: "#ECEFFC"
property color cyan: "#00FFFF" property color cyan: "#00FFFF"
property color blue: "#758EF0" property color blue: "#88B0FF"
property color darkAccentBlue: "#2946C4" property color darkAccentBlue: "#2946C4"
property color transparent: "#00000000" property color transparent: "#00000000"
property color darkGrey: "#838C91"
property color evenDarkerGrey: "#252528"
property color lightBlueText: "#8f9fec" property color lightBlueText: "#8f9fec"
property color darkBlue: "#3c55c9" property color darkBlue: "#3c55c9"
property color darkBlueBtn: "#5a70dd" property color darkBlueBtn: "#5a70dd"
property color red: "#FC5F5F" property color red: "#FF5C7B"
property color lightRed: "#FFEAEE" property color lightRed: "#FFEAEE"
property color green: "#4EBC60" property color green: "#4EBC60"
property color turquoise: "#007b7d" property color turquoise: "#007b7d"
property color tenPercentWhite: Qt.rgba(255, 255, 255, 0.1) property color tenPercentWhite: Qt.rgba(255, 255, 255, 0.1)
property color tenPercentBlue: Qt.rgba(67, 96, 223, 0.1) property color tenPercentBlue: Qt.rgba(67, 96, 223, 0.1)
property color background: almostBlack property color background: "#212121"
property color border: evenDarkerGrey property color border: darkGrey
property color borderSecondary: tenPercentWhite property color borderSecondary: tenPercentWhite
property color borderTertiary: blue property color borderTertiary: blue
property color textColor: white property color textColor: white
property color textColorTertiary: blue property color textColorTertiary: blue
property color currentUserTextColor: white property color currentUserTextColor: white
property color secondaryBackground: "#23252F" property color secondaryBackground: "#353a4d"
property color inputBackground: secondaryBackground property color inputBackground: darkGrey
property color inputBorderFocus: blue property color inputBorderFocus: blue
property color inputColor: darkGrey property color inputColor: textColor
property color modalBackground: background property color modalBackground: darkGrey
property color backgroundHover: evenDarkerGrey property color backgroundHover: evenDarkerGrey
property color secondaryText: darkGrey property color backgroundHoverLight: darkGrey
property color secondaryText: lightGrey
property color secondaryHover: tenPercentWhite property color secondaryHover: tenPercentWhite
property color primary: blue property color primary: blue
property color danger: red property color danger: red
@ -48,13 +49,12 @@ Theme {
property color backgroundTertiary: tenPercentBlue property color backgroundTertiary: tenPercentBlue
property color pillButtonTextColor: almostBlack property color pillButtonTextColor: almostBlack
property color chatReplyCurrentUser: lightGrey property color chatReplyCurrentUser: lightGrey
property color topBarChatInfoColor: evenDarkerGrey
property color codeBackground: "#2E386B" property color codeBackground: "#2E386B"
property color primarySelectionColor: "#b4c8ff" property color primarySelectionColor: "#b4c8ff"
property color emojiReactionBackground: "#2d2823" property color emojiReactionBackground: "#2d2823"
property color emojiReactionBackgroundHovered: "#3a3632" property color emojiReactionBackgroundHovered: "#3a3632"
property color emojiReactionActiveBackgroundHovered: "#cbd5f1" property color emojiReactionActiveBackgroundHovered: "#cbd5f1"
property color mentionColor: "#47B6D1" property color mentionColor: "#7BE5FF"
property color mentionBgColor: Qt.rgba(71, 182, 209, 0.1) property color mentionBgColor: Qt.rgba(71, 182, 209, 0.1)
property color mentionMessageColor: "#E5F8FD" property color mentionMessageColor: "#E5F8FD"
property color mentionMessageHoverColor: mentionBgColor property color mentionMessageHoverColor: mentionBgColor
@ -62,8 +62,8 @@ Theme {
property color buttonForegroundColor: blue property color buttonForegroundColor: blue
property color buttonBackgroundColor: secondaryBackground property color buttonBackgroundColor: secondaryBackground
property color buttonSecondaryColor: darkGrey property color buttonSecondaryColor: darkGrey
property color buttonDisabledForegroundColor: buttonSecondaryColor property color buttonDisabledForegroundColor: lightGrey
property color buttonDisabledBackgroundColor: evenDarkerGrey property color buttonDisabledBackgroundColor: darkGrey
property color buttonWarnBackgroundColor: "#FFEAEE" property color buttonWarnBackgroundColor: "#FFEAEE"
property color buttonHoveredWarnBackgroundColor: red property color buttonHoveredWarnBackgroundColor: red
property color buttonHoveredBackgroundColor: blue property color buttonHoveredBackgroundColor: blue

View File

@ -37,6 +37,7 @@ Theme {
property color inputColor: black property color inputColor: black
property color modalBackground: white2 property color modalBackground: white2
property color backgroundHover: grey property color backgroundHover: grey
property color backgroundHoverLight: lightGrey
property color secondaryText: darkGrey property color secondaryText: darkGrey
property color secondaryHover: tenPercentBlack property color secondaryHover: tenPercentBlack
property color primary: blue property color primary: blue
@ -47,7 +48,6 @@ Theme {
property color backgroundTertiary: tenPercentBlue property color backgroundTertiary: tenPercentBlue
property color pillButtonTextColor: white property color pillButtonTextColor: white
property color chatReplyCurrentUser: darkGrey property color chatReplyCurrentUser: darkGrey
property color topBarChatInfoColor: grey
property color codeBackground: "#2E386B" property color codeBackground: "#2E386B"
property color primarySelectionColor: "#b4c8ff" property color primarySelectionColor: "#b4c8ff"
property color emojiReactionBackground: "#e2e6e9" property color emojiReactionBackground: "#e2e6e9"

View File

@ -31,6 +31,7 @@ QtObject {
property color background property color background
property color backgroundHover property color backgroundHover
property color backgroundHoverLight
property color border property color border
property color textColor property color textColor
property color secondaryText property color secondaryText

View File

@ -1,5 +1,6 @@
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import "../imports" import "../imports"
import "../shared/status" import "../shared/status"
@ -20,6 +21,13 @@ Rectangle {
source: "./img/copy-to-clipboard-icon.svg" source: "./img/copy-to-clipboard-icon.svg"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
ColorOverlay {
anchors.fill: parent
antialiasing: true
source: parent
color: Style.current.primary
}
} }
MouseArea { MouseArea {

View File

@ -16,7 +16,7 @@ Popup {
property alias footer: footerContent.children property alias footer: footerContent.children
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
color: "#60000000" color: Qt.rgba(0, 0, 0, 0.4)
} }
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
parent: Overlay.overlay parent: Overlay.overlay

View File

@ -15,7 +15,7 @@ Menu {
bottomPadding: paddingSize bottomPadding: paddingSize
delegate: MenuItem { delegate: MenuItem {
property color textColor: (this.action.icon.color != "#00000000" ? this.action.icon.color : Style.current.textColor) property color textColor: this.action.icon.color.toString() !== "#00000000" ? this.action.icon.color : Style.current.textColor
property int subMenuIndex: { property int subMenuIndex: {
if (!this.subMenu) { if (!this.subMenu) {
return -1 return -1
@ -62,7 +62,7 @@ Menu {
ColorOverlay { ColorOverlay {
anchors.fill: parent anchors.fill: parent
source: parent source: parent
color: popupMenuItem.highlighted ? Style.current.white : popupMenuItem.textColor color: popupMenuItem.textColor
} }
} }
@ -89,9 +89,7 @@ Menu {
anchors.fill: menuIcon anchors.fill: menuIcon
source: menuIcon source: menuIcon
smooth: true smooth: true
color: popupMenuItem.highlighted ? color: (popupMenuItem.action.icon.color != "#00000000" ? popupMenuItem.action.icon.color : Style.current.primaryMenuItemHover)
Style.current.primaryMenuItemTextHover :
(popupMenuItem.action.icon.color != "#00000000" ? popupMenuItem.action.icon.color : Style.current.primaryMenuItemHover)
} }
} }
@ -100,7 +98,7 @@ Menu {
anchors.leftMargin: popupMenu.paddingSize anchors.leftMargin: popupMenu.paddingSize
text: popupMenuItem.text text: popupMenuItem.text
font: popupMenuItem.font font: popupMenuItem.font
color: popupMenuItem.highlighted ? Style.current.primaryMenuItemTextHover : popupMenuItem.textColor color: popupMenuItem.textColor
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
opacity: enabled ? 1.0 : 0.3 opacity: enabled ? 1.0 : 0.3
@ -110,7 +108,7 @@ Menu {
background: Rectangle { background: Rectangle {
implicitWidth: 220 implicitWidth: 220
implicitHeight: 24 implicitHeight: 24
color: popupMenuItem.highlighted ? popupMenuItem.icon.color : "transparent" color: popupMenuItem.highlighted ? Style.current.backgroundHover : "transparent"
} }
} }

View File

@ -20,7 +20,7 @@ Item {
text: infoText.label text: infoText.label
font.weight: Font.Medium font.weight: Font.Medium
font.pixelSize: 13 font.pixelSize: 13
color: Style.current.darkGrey color: Style.current.secondaryText
} }
StyledTextEdit { StyledTextEdit {

View File

@ -107,7 +107,7 @@ Item {
StyledText { StyledText {
id: chatInfo id: chatInfo
color: Style.current.darkGrey color: Style.current.secondaryText
text: { text: {
switch(root.chatType){ switch(root.chatType){
//% "Public chat" //% "Public chat"

View File

@ -37,7 +37,7 @@ Button {
} }
background: Rectangle { background: Rectangle {
color: control.hovered ? Style.current.topBarChatInfoColor : "transparent" color: control.hovered ? Style.current.backgroundHover : "transparent"
radius: Style.current.radius radius: Style.current.radius
} }

View File

@ -13,7 +13,7 @@ CheckBox {
x: control.leftPadding x: control.leftPadding
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
radius: 3 radius: 3
color: (control.down || control.checked) ? Style.current.blue : Style.current.grey color: (control.down || control.checked) ? Style.current.primary : Style.current.inputBackground
Image { Image {
source: "../img/checkmark.svg" source: "../img/checkmark.svg"

View File

@ -91,7 +91,7 @@ Rectangle {
ColorOverlay { ColorOverlay {
anchors.fill: caret anchors.fill: caret
source: caret source: caret
color: Style.current.darkGrey color: Style.current.secondaryText
} }
} }

View File

@ -14,7 +14,7 @@ Switch {
x: control.leftPadding x: control.leftPadding
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
radius: 14 radius: 14
color: control.checked ? Style.current.blue : Style.current.grey color: control.checked ? Style.current.primary : Style.current.inputBackground
Rectangle { Rectangle {
id: circle id: circle