Skip to content
Snippets Groups Projects
Commit 2c7a0e16 authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Sébastien Blin
Browse files

misc: component style fixes

1. JamiSwitch checked,focused color fixes
2. Avoid MaterialButton dashed line on focus
3. Placeholder text color fixes

Change-Id: I9b04f643e3553fc1f493183eb0e30646818362bd
parent 3c7d0322
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,8 @@ Switch { ...@@ -25,6 +25,8 @@ Switch {
id: root id: root
indicator: Rectangle { indicator: Rectangle {
id: handleBackground
implicitWidth: JamiTheme.switchPreferredWidth implicitWidth: JamiTheme.switchPreferredWidth
implicitHeight: JamiTheme.switchPreferredHeight implicitHeight: JamiTheme.switchPreferredHeight
...@@ -33,23 +35,26 @@ Switch { ...@@ -33,23 +35,26 @@ Switch {
radius: JamiTheme.switchIndicatorRadius radius: JamiTheme.switchIndicatorRadius
color: root.checked ? JamiTheme.switchBackgroundCheckedColor : JamiTheme.whiteColor color: root.checked ? JamiTheme.switchBackgroundCheckedColor :
border.color: root.checked ? JamiTheme.switchBackgroundCheckedColor : JamiTheme.switchBackgroundColor
JamiTheme.switchBackgroundBorderColor border.color: handleBackground.color
Rectangle { Rectangle {
id: handle
x: root.checked ? parent.width - width : 0 x: root.checked ? parent.width - width : 0
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
width: JamiTheme.switchIndicatorPreferredWidth width: JamiTheme.switchIndicatorPreferredWidth
height: JamiTheme.switchIndicatorPreferredHeight height: JamiTheme.switchPreferredHeight
radius: JamiTheme.switchIndicatorRadius radius: JamiTheme.switchIndicatorRadius
color: (root.down || root.focus) ? Qt.darker(JamiTheme.switchBackgroundBorderColor, 1.2) : color: root.checked ? JamiTheme.switchHandleCheckedColor :
JamiTheme.whiteColor JamiTheme.switchHandleColor
border.color: root.checked ? JamiTheme.switchBackgroundCheckedColor : border.color: root.focus ? (root.checked ? JamiTheme.switchHandleCheckedBorderColor :
JamiTheme.switchIndicatorBorderColor JamiTheme.switchHandleBorderColor) :
JamiTheme.transparentColor
} }
} }
......
...@@ -25,7 +25,7 @@ import net.jami.Constants 1.1 ...@@ -25,7 +25,7 @@ import net.jami.Constants 1.1
// TODO: this component suffers from excessive responsibility // TODO: this component suffers from excessive responsibility
// and should have fixed width and content width defined variations // and should have fixed width and content width defined variations
// as well as better handling for the animated icon // as well as better handling for the animated icon
Button { AbstractButton {
id: root id: root
property bool outlined: false property bool outlined: false
...@@ -138,7 +138,7 @@ Button { ...@@ -138,7 +138,7 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: hasIcon ? Layout.leftMargin: hasIcon ?
JamiTheme.preferredMarginSize / 2 : JamiTheme.preferredMarginSize :
undefined undefined
sourceComponent: animatedSource_.length !== 0 ? sourceComponent: animatedSource_.length !== 0 ?
animatedIconComponent : animatedIconComponent :
...@@ -168,7 +168,6 @@ Button { ...@@ -168,7 +168,6 @@ Button {
} }
background: Rectangle { background: Rectangle {
anchors.fill: parent
color: { color: {
if (root.outlined) if (root.outlined)
return "transparent" return "transparent"
......
...@@ -40,11 +40,12 @@ TextField { ...@@ -40,11 +40,12 @@ TextField {
wrapMode: Text.Wrap wrapMode: Text.Wrap
readOnly: false readOnly: false
selectByMouse: true selectByMouse: true
selectionColor: JamiTheme.placeHolderTextFontColor selectionColor: JamiTheme.placeholderTextColor
font.pointSize: JamiTheme.materialLineEditPointSize font.pointSize: JamiTheme.materialLineEditPointSize
font.kerning: true font.kerning: true
placeholderTextColor: JamiTheme.placeholderTextColor
color: JamiTheme.textColor color: JamiTheme.textColor
LineEditContextMenu { LineEditContextMenu {
......
...@@ -60,7 +60,6 @@ Item { ...@@ -60,7 +60,6 @@ Item {
property color notificationRed: "#ff3b30" property color notificationRed: "#ff3b30"
property color notificationBlue: "#31b7ff" property color notificationBlue: "#31b7ff"
property color unPresenceOrange: "orange" property color unPresenceOrange: "orange"
property color placeHolderTextFontColor: "#767676"
property color draftTextColor: "#cf5300" property color draftTextColor: "#cf5300"
property color selectedTabColor: primaryForegroundColor property color selectedTabColor: primaryForegroundColor
property color filterBadgeColor: "#eed4d8" property color filterBadgeColor: "#eed4d8"
...@@ -99,9 +98,12 @@ Item { ...@@ -99,9 +98,12 @@ Item {
property color closeButtonLighterBlack: "#4c4c4c" property color closeButtonLighterBlack: "#4c4c4c"
// Jami switch // Jami switch
property color switchBackgroundBorderColor: "#cccccc" property color switchBackgroundColor: darkTheme ? "#373737" : "#9f9f9f"
property color switchBackgroundCheckedColor: primaryBackgroundColor property color switchBackgroundCheckedColor: "#8dbaea"
property color switchIndicatorBorderColor: "#999999" property color switchHandleColor: darkTheme ? Qt.darker(lightGrey_, 2) : whiteColor
property color switchHandleCheckedColor: "#1b76d1"
property color switchHandleBorderColor: darkTheme ? whiteColor : Qt.darker(lightGrey_, 2)
property color switchHandleCheckedBorderColor: Qt.darker(lightGrey_, 3)
// Call buttons // Call buttons
property color acceptButtonGreen: "#4caf50" property color acceptButtonGreen: "#4caf50"
...@@ -158,7 +160,7 @@ Item { ...@@ -158,7 +160,7 @@ Item {
property color fileInTimestampColor: darkTheme ? "#999" : "#555" property color fileInTimestampColor: darkTheme ? "#999" : "#555"
property color chatviewBgColor: darkTheme ? bgDarkMode_ : whiteColor property color chatviewBgColor: darkTheme ? bgDarkMode_ : whiteColor
property color bgInvitationRectColor: darkTheme ? "#222222" : whiteColor property color bgInvitationRectColor: darkTheme ? "#222222" : whiteColor
property color placeholderTextColor: darkTheme ? "#2b2b2b" : "#d3d3d3" property color placeholderTextColor: darkTheme ? "#7a7a7a" : "#767676"
property color inviteHoverColor: darkTheme ? blackColor : whiteColor property color inviteHoverColor: darkTheme ? blackColor : whiteColor
property color chatviewButtonColor: darkTheme ? whiteColor : blackColor property color chatviewButtonColor: darkTheme ? whiteColor : blackColor
property color bgTextInput: darkTheme ? "#060608" : whiteColor property color bgTextInput: darkTheme ? "#060608" : whiteColor
...@@ -270,10 +272,9 @@ Item { ...@@ -270,10 +272,9 @@ Item {
property real lineEditContextMenuSeparatorsHeight: 2 property real lineEditContextMenuSeparatorsHeight: 2
// Jami switch // Jami switch
property real switchIndicatorRadius: 13 property real switchIndicatorRadius: 30
property real switchPreferredHeight: 18 property real switchPreferredHeight: 25
property real switchPreferredWidth: 48 property real switchPreferredWidth: 48
property real switchIndicatorPreferredHeight: 26
property real switchIndicatorPreferredWidth: 26 property real switchIndicatorPreferredWidth: 26
// Modal Popup // Modal Popup
......
...@@ -82,10 +82,10 @@ Rectangle { ...@@ -82,10 +82,10 @@ Rectangle {
font.kerning: true font.kerning: true
selectByMouse: true selectByMouse: true
selectionColor: JamiTheme.placeHolderTextFontColor selectionColor: JamiTheme.placeholderTextColor
placeholderText: JamiStrings.contactSearchConversation placeholderText: JamiStrings.contactSearchConversation
placeholderTextColor: JamiTheme.placeHolderTextFontColor placeholderTextColor: JamiTheme.placeholderTextColor
background: Rectangle { background: Rectangle {
id: searchBarBackground id: searchBarBackground
......
...@@ -84,9 +84,9 @@ JamiFlickable { ...@@ -84,9 +84,9 @@ JamiFlickable {
renderType: Text.NativeRendering renderType: Text.NativeRendering
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
selectByMouse: true selectByMouse: true
selectionColor: JamiTheme.placeHolderTextFontColor selectionColor: JamiTheme.placeholderTextColor
textFormat: TextEdit.PlainText textFormat: TextEdit.PlainText
placeholderTextColor: JamiTheme.placeHolderTextFontColor placeholderTextColor: JamiTheme.placeholderTextColor
cursorDelegate: Rectangle { cursorDelegate: Rectangle {
visible: textArea.cursorVisible visible: textArea.cursorVisible
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment