WelcomePage: Taking text sizes into account for layout

Buttons do not have a fixed width of 160px anymore
and the sidebar layout becomes dynamic.

Task-number: QTCREATORBUG-12108
Task-number: QTCREATORBUG-12091
Change-Id: I940b4b7c9c79a312766501559147abb85833b78f
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
This commit is contained in:
Thomas Hartmann
2014-06-17 15:04:40 +02:00
parent cc68534e06
commit 6f51d76cd4
2 changed files with 21 additions and 12 deletions

View File

@@ -38,7 +38,10 @@ Button {
Component { Component {
id: touchStyle id: touchStyle
ButtonStyle { ButtonStyle {
padding.left: button.iconSource != "" ? 38 : 14
padding.right: 14
background: Item { background: Item {
anchors.fill: parent
Image { Image {
id: icon id: icon
@@ -51,8 +54,8 @@ Button {
visible: button.iconSource != "" visible: button.iconSource != ""
} }
implicitHeight: 30
implicitWidth: 160 implicitWidth: 160
implicitHeight: 30
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@@ -117,7 +120,6 @@ Button {
} }
label: Text { label: Text {
x: button.iconSource != "" ? 38 : 14
renderType: Text.NativeRendering renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: button.text text: button.text

View File

@@ -28,6 +28,7 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Window 2.1
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
ColumnLayout { ColumnLayout {
@@ -37,13 +38,13 @@ ColumnLayout {
property alias model: tabs.model property alias model: tabs.model
property int __width: tabs.width + 16 * 2
id: root id: root
Item { Item {
z: 1 z: 1
width: __width width: tabs.width + 16 * 2
height: tabs.height + 51 * 2 height: tabs.height + 51 * 2
Layout.fillWidth: true
Image { Image {
fillMode: Image.Tile fillMode: Image.Tile
@@ -87,13 +88,14 @@ ColumnLayout {
Rectangle { Rectangle {
color: "#ebebeb" color: "#ebebeb"
width: root.__width Layout.fillWidth: true
Layout.minimumHeight: 320 Layout.minimumHeight: 320
Layout.fillHeight: true Layout.fillHeight: true
Layout.minimumWidth: innerColumn.width
Column { ColumnLayout {
id: innerColumn
spacing: 14 spacing: 14
width: parent.width - 16 * 2
x: 12 x: 12
Item { Item {
@@ -111,7 +113,7 @@ ColumnLayout {
text: qsTr("Learn how to develop your own applications and explore Qt Creator.") text: qsTr("Learn how to develop your own applications and explore Qt Creator.")
font.pixelSize: 12 font.pixelSize: 12
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width Layout.maximumWidth: Screen.pixelDensity * 60
} }
Item { Item {
@@ -119,9 +121,14 @@ ColumnLayout {
width: parent.width width: parent.width
} }
Button { Item {
text: qsTr("Get Started Now") width: gettingStartedButton.width + 24
onClicked: gettingStarted.openHelp("qthelp://org.qt-project.qtcreator/doc/index.html") Button {
x: 4
id: gettingStartedButton
text: qsTr("Get Started Now")
onClicked: gettingStarted.openHelp("qthelp://org.qt-project.qtcreator/doc/index.html")
}
} }
Item { Item {
@@ -129,7 +136,7 @@ ColumnLayout {
width: parent.width width: parent.width
} }
Column { ColumnLayout {
x: 14 x: 14
spacing: 16 spacing: 16
IconAndLink { IconAndLink {