From 52e933ce2b10b0e1b48afa9ce048552830309da7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 22 Oct 2016 21:18:52 +0200 Subject: Add QQuickDialog::title Dialog is incomplete without built-in support for title. All dialogs in the examples, screenshots, webinars, and blog posts have had a custom title. The Material and Universal designs both have specs for dialog titles. This commit adds support for dialog titles with appropriate looks (padding & font) out of the box. Task-number: QTBUG-56711 Change-Id: I248150313f1ce629a7105fdbe1c70c8fcd69e1cc Reviewed-by: Mitch Curtis --- src/imports/controls/Dialog.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/imports/controls/Dialog.qml') diff --git a/src/imports/controls/Dialog.qml b/src/imports/controls/Dialog.qml index 3322a6ea..a26928c1 100644 --- a/src/imports/controls/Dialog.qml +++ b/src/imports/controls/Dialog.qml @@ -59,6 +59,19 @@ T.Dialog { border.color: Default.frameDarkColor } + header: Label { + text: control.title + visible: control.title + elide: Label.ElideRight + font.bold: true + padding: 12 + background: Rectangle { + x: 1; y: 1 + width: parent.width - 2 + height: parent.height - 1 + } + } + footer: DialogButtonBox { visible: count > 0 } -- cgit v1.2.3