From 6e1cdc70deb0d94808e57c9a85c6964bcdef776b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 31 Oct 2016 13:53:47 +0100 Subject: [PATCH] refactoring (in progress) --- tests/ui/modules/Common/Colors.qml | 5 ++--- tests/ui/modules/Common/ForceScrollBar.qml | 5 ++++- tests/ui/modules/Common/Styles/ForceScrollBarStyle.qml | 6 ++---- tests/ui/modules/Linphone/Contact/Contact.qml | 3 ++- tests/ui/modules/Linphone/Styles/TimelineStyle.qml | 9 ++++++++- tests/ui/modules/Linphone/Timeline.qml | 7 ++++++- tests/ui/views/App/MainWindow/MainWindow.qml | 2 +- tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml | 1 - 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/ui/modules/Common/Colors.qml b/tests/ui/modules/Common/Colors.qml index 65f5693e6..175c9822d 100644 --- a/tests/ui/modules/Common/Colors.qml +++ b/tests/ui/modules/Common/Colors.qml @@ -4,7 +4,6 @@ import QtQuick 2.7 QtObject { property color a: 'transparent' property color b: '#5E5E5F' // Pressed toolbar. - property color c: '#C5C5C5' // Released toolbar. property color d: '#5A585B' // Text color. @@ -12,8 +11,6 @@ QtObject { property color f: '#808080' // Popup shadow. - - property color l: '#000000' // Text color. property color m: '#D1D1D1' // SmallButton Normal. @@ -35,6 +32,8 @@ QtObject { // ----------------------------------------------------------------- property color g: '#6B7A86' + property color g10: '#1A6b7a86' + property color g20: '#336b7a86' property color h: '#687680' property color i: '#FE5E00' property color j: '#4B5964' diff --git a/tests/ui/modules/Common/ForceScrollBar.qml b/tests/ui/modules/Common/ForceScrollBar.qml index 591c3fd42..26d4ef388 100644 --- a/tests/ui/modules/Common/ForceScrollBar.qml +++ b/tests/ui/modules/Common/ForceScrollBar.qml @@ -10,7 +10,10 @@ import Common.Styles 1.0 ScrollBar { id: scrollBar - background: ForceScrollBarStyle.background + background: Rectangle { + anchors.fill: parent + color: ForceScrollBarStyle.backgroundColor + } contentItem: Rectangle { color: scrollBar.pressed ? ForceScrollBarStyle.color.pressed diff --git a/tests/ui/modules/Common/Styles/ForceScrollBarStyle.qml b/tests/ui/modules/Common/Styles/ForceScrollBarStyle.qml index 784ea8100..2e8042ce9 100644 --- a/tests/ui/modules/Common/Styles/ForceScrollBarStyle.qml +++ b/tests/ui/modules/Common/Styles/ForceScrollBarStyle.qml @@ -6,9 +6,7 @@ import Common 1.0 // =================================================================== QtObject { - property Rectangle background: Rectangle { - color: Colors.a - } + property color backgroundColor: Colors.g20 property Rectangle contentItem: Rectangle { implicitHeight: 100 @@ -18,7 +16,7 @@ QtObject { property QtObject color: QtObject { property color hovered: Colors.h - property color normal: Colors.c + property color normal: Colors.g20 property color pressed: Colors.b } } diff --git a/tests/ui/modules/Linphone/Contact/Contact.qml b/tests/ui/modules/Linphone/Contact/Contact.qml index 0ff05d0a4..16ffd5d5c 100644 --- a/tests/ui/modules/Linphone/Contact/Contact.qml +++ b/tests/ui/modules/Linphone/Contact/Contact.qml @@ -7,13 +7,14 @@ import Linphone.Styles 1.0 // =================================================================== -Item { +Rectangle { property alias actions: actionBar.data property alias sipAddressColor: description.sipAddressColor property alias usernameColor: description.usernameColor property var contact + color: 'transparent' // No color by default. height: ContactStyle.height RowLayout { diff --git a/tests/ui/modules/Linphone/Styles/TimelineStyle.qml b/tests/ui/modules/Linphone/Styles/TimelineStyle.qml index 7c75ee38e..73d2ef6b3 100644 --- a/tests/ui/modules/Linphone/Styles/TimelineStyle.qml +++ b/tests/ui/modules/Linphone/Styles/TimelineStyle.qml @@ -3,11 +3,18 @@ import QtQuick 2.7 import Common 1.0 +// =================================================================== + QtObject { + property QtObject contact: QtObject { + property color colorA: Colors.g10 + property color colorB: Colors.a + property int height: 60 + } + property QtObject legend: QtObject { property color backgroundColor: Colors.u property color color: Colors.k - property int bottomMargin: 10 property int fontSize: 12 property int height: 30 property int iconSize: 10 diff --git a/tests/ui/modules/Linphone/Timeline.qml b/tests/ui/modules/Linphone/Timeline.qml index 8459a2da1..49b3287c2 100644 --- a/tests/ui/modules/Linphone/Timeline.qml +++ b/tests/ui/modules/Linphone/Timeline.qml @@ -9,8 +9,9 @@ import Linphone.Styles 1.0 ColumnLayout { property alias model: view.model + spacing: 0 + Rectangle { - Layout.bottomMargin: TimelineStyle.legend.bottomMargin Layout.fillWidth: true Layout.preferredHeight: TimelineStyle.legend.height color: TimelineStyle.legend.backgroundColor @@ -48,7 +49,11 @@ ColumnLayout { Layout.fillWidth: true delegate: Contact { + color: index % 2 == 0 + ? TimelineStyle.contact.colorA + : TimelineStyle.contact.colorB contact: $contact + height: TimelineStyle.contact.height width: parent.width } } diff --git a/tests/ui/views/App/MainWindow/MainWindow.qml b/tests/ui/views/App/MainWindow/MainWindow.qml index dbdbc0b88..6e7c7282b 100644 --- a/tests/ui/views/App/MainWindow/MainWindow.qml +++ b/tests/ui/views/App/MainWindow/MainWindow.qml @@ -100,7 +100,7 @@ ApplicationWindow { Layout.fillHeight: true Layout.maximumWidth: MainWindowStyle.menu.width Layout.preferredWidth: MainWindowStyle.menu.width - spacing: MainWindowStyle.menu.spacing + spacing: 0 Menu { entryHeight: MainWindowStyle.menu.entryHeight diff --git a/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml index 1d424d616..089708b23 100644 --- a/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml +++ b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml @@ -14,7 +14,6 @@ QtObject { property QtObject menu: QtObject { property int entryHeight: 50 - property int spacing: 0 property int width: 250 }