From 5f98c29ae32568fee913e88573daa5a8d552eb15 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 26 Sep 2016 13:44:12 +0200 Subject: [PATCH] feat(timeline): use style file --- tests/imgs/history.svg | 15 +++++++++++++++ tests/resources.qrc | 1 + tests/ui/components/dialog/DialogDescription.qml | 2 +- tests/ui/components/timeline/Timeline.qml | 16 ++++++++++------ tests/ui/style/components/TimelineStyle.qml | 13 ++++++++++++- tests/ui/style/global/Colors.qml | 4 +++- 6 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 tests/imgs/history.svg diff --git a/tests/imgs/history.svg b/tests/imgs/history.svg new file mode 100644 index 000000000..ef388490a --- /dev/null +++ b/tests/imgs/history.svg @@ -0,0 +1,15 @@ + + + + footer_history + Created with Sketch. + + + + + + + + + + diff --git a/tests/resources.qrc b/tests/resources.qrc index 83bf7c6b2..165e35da2 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -61,6 +61,7 @@ imgs/lost_incoming_call.svg imgs/conference.svg imgs/cam.svg + imgs/history.svg imgs/hangup.svg imgs/chat.svg imgs/chat_attachment.svg diff --git a/tests/ui/components/dialog/DialogDescription.qml b/tests/ui/components/dialog/DialogDescription.qml index c946b613d..1e6be309f 100644 --- a/tests/ui/components/dialog/DialogDescription.qml +++ b/tests/ui/components/dialog/DialogDescription.qml @@ -10,7 +10,7 @@ Item { property alias text: description.text height: (!text && DialogStyle.description.verticalMargin) || undefined - implicitHeight: (text && (description.implicitHeight + DialogStyle.description.verticalMargin)) || + implicitHeight: (text && (description.implicitHeight + DialogStyle.description.verticalMargin * 2)) || 0 Text { diff --git a/tests/ui/components/timeline/Timeline.qml b/tests/ui/components/timeline/Timeline.qml index 3c4d29c34..10bd9afb6 100644 --- a/tests/ui/components/timeline/Timeline.qml +++ b/tests/ui/components/timeline/Timeline.qml @@ -1,5 +1,4 @@ import QtQuick 2.7 -import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 import 'qrc:/ui/components/contact' @@ -8,6 +7,8 @@ import 'qrc:/ui/components/view' import 'qrc:/ui/style/components' +// =================================================================== + ColumnLayout { id: item @@ -15,16 +16,19 @@ ColumnLayout { // Legend. Row { - Layout.preferredHeight: 35 - spacing: 30 + Layout.topMargin: TimelineStyle.legend.topMargin + Layout.bottomMargin: TimelineStyle.legend.bottomMargin + Layout.leftMargin: TimelineStyle.legend.leftMargin + spacing: TimelineStyle.legend.spacing Icon { - iconSize: 20 + icon: TimelineStyle.legend.icon + iconSize: TimelineStyle.legend.iconSize } Text { - color: '#5A585B' - font.pointSize: 13 + color: TimelineStyle.legend.color + font.pointSize: TimelineStyle.legend.fontSize height: parent.height text: qsTr('timelineTitle') verticalAlignment: Text.AlignVCenter diff --git a/tests/ui/style/components/TimelineStyle.qml b/tests/ui/style/components/TimelineStyle.qml index b87514001..a72e2119b 100644 --- a/tests/ui/style/components/TimelineStyle.qml +++ b/tests/ui/style/components/TimelineStyle.qml @@ -4,8 +4,19 @@ import QtQuick 2.7 import 'qrc:/ui/style/global' QtObject { + property QtObject legend: QtObject { + property int bottomMargin: 10 + property int fontSize: 13 + property int iconSize: 26 + property int leftMargin: 18 + property int spacing: 16 + property int topMargin: 10 + property string color: Colors.d + property string icon: 'history' + } + property QtObject separator: QtObject { property int height: 1 - property string color: '#DEDEDE' + property string color: Colors.e } } diff --git a/tests/ui/style/global/Colors.qml b/tests/ui/style/global/Colors.qml index 9764a423f..c34c03935 100644 --- a/tests/ui/style/global/Colors.qml +++ b/tests/ui/style/global/Colors.qml @@ -1,9 +1,11 @@ pragma Singleton import QtQuick 2.7 +// TODO: Mutualize similar colors. QtObject { property string a: '#808080' property string b: '#5E5E5F' property string c: '#C5C5C5' - property string d: '#F4F4F4' + property string d: '#5A585B' + property string e: '#DEDEDE' }