From 0cfadeb6de542548c45ef485a4452e820cefb401 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 17 Nov 2016 22:23:30 +0100 Subject: Contact List: tweak the section header Replace the old-fashioned gradient with a ToolBar. It stands out more than well enough, and is fully style-agnostic. Also, give descriptive IDs for better designer integration/preview. Change-Id: Ib2d4404e3c0fa769ac661645046a25e578f62d37 Reviewed-by: Mitch Curtis --- .../quickcontrols2/contactlist/MainForm.ui.qml | 4 ++-- .../contactlist/SectionDelegate.ui.qml | 25 ++++++---------------- 2 files changed, 8 insertions(+), 21 deletions(-) (limited to 'examples/quickcontrols2/contactlist') diff --git a/examples/quickcontrols2/contactlist/MainForm.ui.qml b/examples/quickcontrols2/contactlist/MainForm.ui.qml index fdc6dd91..1639ecc8 100644 --- a/examples/quickcontrols2/contactlist/MainForm.ui.qml +++ b/examples/quickcontrols2/contactlist/MainForm.ui.qml @@ -69,11 +69,11 @@ Page { focus: true anchors.fill: parent - section.criteria: ViewSection.FirstCharacter - section.property: "fullName" snapMode: ListView.SnapToItem boundsBehavior: Flickable.StopAtBounds + section.property: "fullName" + section.criteria: ViewSection.FirstCharacter section.delegate: SectionDelegate { width: listView.width } diff --git a/examples/quickcontrols2/contactlist/SectionDelegate.ui.qml b/examples/quickcontrols2/contactlist/SectionDelegate.ui.qml index 3b9f7dc5..fa64ffbf 100644 --- a/examples/quickcontrols2/contactlist/SectionDelegate.ui.qml +++ b/examples/quickcontrols2/contactlist/SectionDelegate.ui.qml @@ -51,27 +51,14 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 -Rectangle { - height: 20 - width: 120 - gradient: Gradient { - GradientStop { - position: 0 - color: "#dddddd" - } - - GradientStop { - position: 1 - color: "blue" - } - } +ToolBar { + id: background Label { - x: 12 - color: "white" + id: label text: section - style: Text.Raised - font.pixelSize: 18 - font.bold: true + anchors.fill: parent + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter } } -- cgit v1.2.3