From dbf42fc0028acc0170bb0d0dad966c74b86a456e Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 27 May 2013 15:51:08 +0200 Subject: Make GroupBox size respect anchor margins and update Gallery We now implicitly add the margins to GroupBox so that you can easily add them to a layout. This also gets rid of the silly Sidebar example and adds a much more useful Layout tab for effective testing. Change-Id: I6026c32b2a198062d9b11a67245df0529aa61f8a Reviewed-by: J-P Nurmi --- examples/quick/controls/gallery/main.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/quick/controls/gallery/main.qml') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 7da74031..e34858cd 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -281,8 +281,8 @@ ApplicationWindow { Styles { anchors.fill: parent } } Tab { - title: "Sidebar" - Panel { anchors.fill:parent } + title: "Layouts" + Layouts { anchors.fill:parent } } } } -- cgit v1.2.1 From 44be216fda6590225dd45fb565361d6328a482f4 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Tue, 28 May 2013 11:08:48 +0200 Subject: Gallery example: Increase minimumWidth Change-Id: I3f97de79c8afed44f7b01778d94cc40bed8cc603 Reviewed-by: Jens Bache-Wiig Reviewed-by: Caroline Chao --- examples/quick/controls/gallery/main.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/quick/controls/gallery/main.qml') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index e34858cd..93502423 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -51,10 +51,11 @@ import "content" ApplicationWindow { title: "Component Gallery" - width: 580 + width: 600 height: 400 minimumHeight: 400 - minimumWidth: 340 + minimumWidth: 570 + property string loremIpsum: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ -- cgit v1.2.1 From 8beda08087effd684cfcb325855c9f4b47186135 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 30 May 2013 16:51:34 +0200 Subject: Cleaning up some examples and removing clutter We want to use more layouts in our examples as it is the recommended way to create tool bars etc. Change-Id: Ib3b1e8e907cc5277d522557a19d2c294a7d251b1 Reviewed-by: J-P Nurmi --- examples/quick/controls/gallery/main.qml | 216 +++++++++++++------------------ 1 file changed, 89 insertions(+), 127 deletions(-) (limited to 'examples/quick/controls/gallery/main.qml') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 93502423..86dddbe2 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -70,150 +70,112 @@ ApplicationWindow { onAccepted: imageViewer.open(fileUrl) } - toolBar: ToolBar { - id: toolbar - RowLayout { - spacing: 2 - anchors.verticalCenter: parent.verticalCenter - ToolButton { - iconSource: "images/window-new.png" - anchors.verticalCenter: parent.verticalCenter - onClicked: window1.visible = !window1.visible - Accessible.name: "New window" - tooltip: "Toggle visibility of the second window" - } - ToolButton { - action: openAction - } - ToolButton { - iconSource: "images/document-save-as.png" - anchors.verticalCenter: parent.verticalCenter - tooltip: "(Pretend to) save as..." - } - } + Action { + id: openAction + text: "&Open" + shortcut: "Ctrl+O" + iconSource: "images/document-open.png" + onTriggered: fileDialog.open() + tooltip: "open an image" + } - ChildWindow { id: window1 } + Action { + id: copyAction + text: "&Copy" + shortcut: "Ctrl+C" + iconName: "edit-copy" + enabled: (!!activeFocusItem && !!activeFocusItem["copy"]) + onTriggered: activeFocusItem.copy() + } - Action { - id: openAction - text: "&Open" - shortcut: "Ctrl+O" - iconSource: "images/document-open.png" - onTriggered: fileDialog.open() - tooltip: "open an image" - } + Action { + id: cutAction + text: "Cu&t" + shortcut: "Ctrl+X" + iconName: "edit-cut" + enabled: (!!activeFocusItem && !!activeFocusItem["cut"]) + onTriggered: activeFocusItem.cut() + } + + Action { + id: pasteAction + text: "&Paste" + shortcut: "Ctrl+V" + iconName: "edit-paste" + enabled: (!!activeFocusItem && !!activeFocusItem["paste"]) + onTriggered: activeFocusItem.paste() + } + + ExclusiveGroup { + id: textFormatGroup Action { - id: copyAction - text: "&Copy" - shortcut: "Ctrl+C" - iconName: "edit-copy" - enabled: (!!activeFocusItem && !!activeFocusItem["copy"]) - onTriggered: activeFocusItem.copy() + id: a1 + text: "Align Left" + checkable: true + Component.onCompleted: checked = true } Action { - id: cutAction - text: "Cu&t" - shortcut: "Ctrl+X" - iconName: "edit-cut" - enabled: (!!activeFocusItem && !!activeFocusItem["cut"]) - onTriggered: activeFocusItem.cut() + id: a2 + text: "Center" + checkable: true } Action { - id: pasteAction - text: "&Paste" - shortcut: "Ctrl+V" - iconName: "edit-paste" - enabled: (!!activeFocusItem && !!activeFocusItem["paste"]) - onTriggered: activeFocusItem.paste() + id: a3 + text: "Align Right" + checkable: true } + } - ExclusiveGroup { - id: textFormatGroup - - Action { - id: a1 - text: "Align Left" - checkable: true - Component.onCompleted: checked = true - } - - Action { - id: a2 - text: "Center" - checkable: true - } - - Action { - id: a3 - text: "Align Right" - checkable: true - } - } + ChildWindow { id: window1 } + Menu { + id: editmenu + MenuItem { action: cutAction } + MenuItem { action: copyAction } + MenuItem { action: pasteAction } + MenuSeparator {} Menu { - id: editmenu - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator {} - Menu { - title: "Text Format" - MenuItem { action: a1 } - MenuItem { action: a2 } - MenuItem { action: a3 } - MenuSeparator { } - MenuItem { text: "Allow Hyphenation"; checkable: true } - MenuSeparator { } - Menu { - title: "More Stuff" - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator { } - Menu { - title: "More Stuff" - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator { } - Menu { - title: "More Stuff" - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator { } - Menu { - title: "More Stuff" - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - } - } - } - } - } - Menu { - title: "Font Style" - MenuItem { text: "Bold"; checkable: true } - MenuItem { text: "Italic"; checkable: true } - MenuItem { text: "Underline"; checkable: true } - } + title: "Text Format" + MenuItem { action: a1 } + MenuItem { action: a2 } + MenuItem { action: a3 } + MenuSeparator { } + MenuItem { text: "Allow Hyphenation"; checkable: true } } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onPressed: editmenu.popup() + Menu { + title: "Font Style" + MenuItem { text: "Bold"; checkable: true } + MenuItem { text: "Italic"; checkable: true } + MenuItem { text: "Underline"; checkable: true } } + } - CheckBox { - id: enabledCheck - text: "Enabled" - checked: true - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter + toolBar: ToolBar { + id: toolbar + RowLayout { + id: toolbarLayout + spacing: 0 + width: parent.width + ToolButton { + iconSource: "images/window-new.png" + onClicked: window1.visible = !window1.visible + Accessible.name: "New window" + tooltip: "Toggle visibility of the second window" + } + ToolButton { action: openAction } + ToolButton { + iconSource: "images/document-save-as.png" + tooltip: "(Pretend to) save as..." + } + Item { Layout.fillWidth: true } + CheckBox { + id: enabledCheck + text: "Enabled" + checked: true + } } } -- cgit v1.2.1 From eeb3c959334d1e6b4ea9f7538b603a711f8a8262 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 14:05:26 +0200 Subject: Buttons: Allow overriding of visual properties when 'action' is set Those properties are, text, tooltip, iconName, and iconSource. Also, properly capitalized gallery's tooltips. Change-Id: I1995a85565edd7aaa420279821d7c1a31ef18253 Reviewed-by: J-P Nurmi Reviewed-by: Jens Bache-Wiig --- examples/quick/controls/gallery/main.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/quick/controls/gallery/main.qml') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 86dddbe2..8ea3cf9e 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -76,7 +76,7 @@ ApplicationWindow { shortcut: "Ctrl+O" iconSource: "images/document-open.png" onTriggered: fileDialog.open() - tooltip: "open an image" + tooltip: "Open an image" } Action { @@ -168,7 +168,7 @@ ApplicationWindow { ToolButton { action: openAction } ToolButton { iconSource: "images/document-save-as.png" - tooltip: "(Pretend to) save as..." + tooltip: "(Pretend to) Save as..." } Item { Layout.fillWidth: true } CheckBox { -- cgit v1.2.1 From aa4ddfd8443f07badc0899d835027e46c6e0dfd8 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jun 2013 14:05:56 +0200 Subject: Adapt to Qt.platform.os rename ("mac" -> "osx") Change-Id: I089a01bee10b92f85dcdd338c695a3b796b0ecd1 Reviewed-by: Jens Bache-Wiig Reviewed-by: Jake Petroules --- examples/quick/controls/gallery/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/quick/controls/gallery/main.qml') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 8ea3cf9e..ec00627b 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -228,7 +228,7 @@ ApplicationWindow { enabled: enabledCheck.checked tabPosition: controlPage.item ? controlPage.item.tabPosition : Qt.TopEdge anchors.fill: parent - anchors.margins: Qt.platform.os === "mac" ? 12 : 2 + anchors.margins: Qt.platform.os === "osx" ? 12 : 2 Tab { id: controlPage -- cgit v1.2.1