diff options
-rw-r--r-- | share/qtcreator/welcomescreen/welcomescreen.pro | 1 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/Button.qml | 75 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/CheckBox.qml | 39 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml | 6 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/Feedback.qml | 6 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/LineEdit.qml | 33 | ||||
-rw-r--r-- | share/qtcreator/welcomescreen/widgets/RatingBar.qml | 4 | ||||
-rw-r--r-- | src/plugins/welcome/images/checked.png | bin | 0 -> 395 bytes | |||
-rw-r--r-- | src/plugins/welcome/images/draw-star.png (renamed from share/qtcreator/welcomescreen/widgets/img/draw-star.png) | bin | 1009 -> 1009 bytes | |||
-rw-r--r-- | src/plugins/welcome/images/face-star.png (renamed from share/qtcreator/welcomescreen/widgets/img/face-star.png) | bin | 1088 -> 1088 bytes | |||
-rw-r--r-- | src/plugins/welcome/images/lineedit.png (renamed from share/qtcreator/welcomescreen/widgets/img/lineedit.png) | bin | 724 -> 724 bytes | |||
-rw-r--r-- | src/plugins/welcome/welcome.qrc | 4 |
12 files changed, 102 insertions, 66 deletions
diff --git a/share/qtcreator/welcomescreen/welcomescreen.pro b/share/qtcreator/welcomescreen/welcomescreen.pro index 17ffa68911..2da616f48b 100644 --- a/share/qtcreator/welcomescreen/welcomescreen.pro +++ b/share/qtcreator/welcomescreen/welcomescreen.pro @@ -8,6 +8,7 @@ OTHER_FILES = develop.qml \ newssupport.qml \ welcomescreen.qml \ widgets/Button.qml \ + widgets/CheckBox.qml \ widgets/Feedback.qml \ widgets/RatingBar.qml \ widgets/ExampleBrowser.qml \ diff --git a/share/qtcreator/welcomescreen/widgets/Button.qml b/share/qtcreator/welcomescreen/widgets/Button.qml index e23428d5f4..a60bc1a340 100644 --- a/share/qtcreator/welcomescreen/widgets/Button.qml +++ b/share/qtcreator/welcomescreen/widgets/Button.qml @@ -31,47 +31,50 @@ **************************************************************************/ import Qt 4.7 +import "../components/custom" as Custom -BorderImage { - property string text - property string image - property int iconSize : innerImg.sourceSize.height - signal clicked; - id: root - source: "qrc:/welcome/images/btn_26.png" - height: innerImg.height + 16 +Custom.Button { + id: button - border.left: 5; border.top: 5 - border.right: 5; border.bottom: 5 + width: Math.max(100, labelItem.contentsWidth+20) + height: 32 - Image{ - id: innerImg - height: root.iconSize - width: root.iconSize - anchors.verticalCenter: label.verticalCenter - anchors.right: label.left - anchors.rightMargin: 4 - visible: root.image != "" - source: root.image - } + background: BorderImage { + source: { + if (pressed) + return "qrc:/welcome/images/btn_26_pressed.png" + else + if (containsMouse) + return "qrc:/welcome/images/btn_26_hover.png" + else + return "qrc:/welcome/images/btn_26.png" + } - Text { - id: label; - anchors.left: innerImg.right - anchors.right: parent.right - text: root.text + border { left: 5; right: 5; top: 5; bottom: 5 } } - MouseArea { id: mouseArea; anchors.fill: parent; hoverEnabled: true; onClicked: root.clicked() } - - states: [ - State { - id: pressedState; when: mouseArea.pressed; - PropertyChanges { target: root; source: "qrc:/welcome/images/btn_26_pressed.png" } - }, - State { - id: hoverState; when: mouseArea.containsMouse - PropertyChanges { target: root; source: "qrc:/welcome/images/btn_26_hover.png" } + label: Item { + property int contentsWidth : row.width + Row { + id: row + spacing: 4 + anchors.centerIn: parent + property int contentsWidth : row.width + Image { + id: image + source: iconSource + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.Stretch //mm Image should shrink if button is too small, depends on QTBUG-14957 + } + Text { + id:text + color: textColor + anchors.verticalCenter: parent.verticalCenter + text: button.text + horizontalAlignment: Text.Center + } } - ] + } + + Keys.onSpacePressed:clicked() } diff --git a/share/qtcreator/welcomescreen/widgets/CheckBox.qml b/share/qtcreator/welcomescreen/widgets/CheckBox.qml new file mode 100644 index 0000000000..e61299b018 --- /dev/null +++ b/share/qtcreator/welcomescreen/widgets/CheckBox.qml @@ -0,0 +1,39 @@ +import QtQuick 1.0 +import "../components/custom" as Custom + +Custom.CheckBox{ + id:checkbox + property string text + property string hint + height:20 + width: Math.max(110, backgroundItem.rowWidth) + + background: Item { + property int rowWidth: row.width + Row { + id: row + anchors.verticalCenter: parent.verticalCenter + spacing: 4 + BorderImage { + source: "qrc:welcome/images/lineedit.png"; + width: 16; + height: 16; + border.left: 4; + border.right: 4; + border.top: 4; + border.bottom: 4 + Image { + source: "qrc:welcome/images/checked.png"; + width: 10; height: 10 + anchors.centerIn: parent + visible: checkbox.checked + } + } + Text { + text: checkbox.text + } + } + Keys.onSpacePressed:checked = !checked + + } +} diff --git a/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml b/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml index 104fb52b91..4b0c157764 100644 --- a/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml +++ b/share/qtcreator/welcomescreen/widgets/ExampleBrowser.qml @@ -40,7 +40,7 @@ Item { width: parent.width height: lineEdit.height - Components.TextField { + LineEdit { Behavior on width { NumberAnimation{} } placeholderText: !checkBox.checked ? qsTr("Search in Tutorials") : qsTr("Search in Tutorials, Examples and Demos") focus: true @@ -49,7 +49,7 @@ Item { onTextChanged: examplesModel.filterRegExp = RegExp('.*'+text, "im") } - Components.CheckBox { + CheckBox { id: checkBox text: qsTr("Show Examples and Demos") checked: false @@ -60,7 +60,7 @@ Item { onCheckedChanged: examplesModel.showTutorialsOnly = !checked; } - Components.Button { + Button { id: tagFilterButton property string tag Behavior on width { NumberAnimation{} } diff --git a/share/qtcreator/welcomescreen/widgets/Feedback.qml b/share/qtcreator/welcomescreen/widgets/Feedback.qml index 0b623473cb..1bca1ee78b 100644 --- a/share/qtcreator/welcomescreen/widgets/Feedback.qml +++ b/share/qtcreator/welcomescreen/widgets/Feedback.qml @@ -47,7 +47,7 @@ BorderImage { // whitelist property bool _hasDesktopTheme: welcomeMode.platform() === "linux" - Components.Button { + Button { id: openProjectButton text: qsTr("Open Project...") iconSource: _hasDesktopTheme ? "image://desktoptheme/document-open" : "" @@ -58,7 +58,7 @@ BorderImage { anchors.verticalCenter: parent.verticalCenter } - Components.Button { + Button { id: createProjectButton text: qsTr("Create Project...") iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : "" @@ -70,7 +70,7 @@ BorderImage { } - Components.Button { + Button { id: feedbackButton text: qsTr("Feedback") iconSource: "qrc:welcome/images/feedback_arrow.png" diff --git a/share/qtcreator/welcomescreen/widgets/LineEdit.qml b/share/qtcreator/welcomescreen/widgets/LineEdit.qml index aedd1d34e4..b6e30e96f7 100644 --- a/share/qtcreator/welcomescreen/widgets/LineEdit.qml +++ b/share/qtcreator/welcomescreen/widgets/LineEdit.qml @@ -31,32 +31,21 @@ **************************************************************************/ import QtQuick 1.0 +import "../components/custom" as Custom -FocusScope { + +Custom.TextField { id: root - signal textChanged - property alias text : input.text - height:input.font.pixelSize*1.8 - BorderImage { + leftMargin: 6 + rightMargin: 6 + topMargin: 6 + bottomMargin: 6 + + background: BorderImage { anchors.fill: parent - source: "img/lineedit.png" + source: "qrc:welcome/images/lineedit.png" border.left: 5; border.top: 5 border.right: 5; border.bottom: 5 - TextInput { - id: input - property string defaultText - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 4 - anchors.rightMargin: 4 - color: "grey" - text: defaultText - font.pointSize: 12 - clip: true - onActiveFocusChanged: activeFocus ? state = 'active' : state = '' - onTextChanged: if (text != defaultText) root.textChanged(); - states: [ State { name: "active"; PropertyChanges { target: input; color: "black"; text: "" } } ] - } + } } diff --git a/share/qtcreator/welcomescreen/widgets/RatingBar.qml b/share/qtcreator/welcomescreen/widgets/RatingBar.qml index ff371df62c..18d5483f74 100644 --- a/share/qtcreator/welcomescreen/widgets/RatingBar.qml +++ b/share/qtcreator/welcomescreen/widgets/RatingBar.qml @@ -36,6 +36,6 @@ Row { property int rating : 2 property int totalRating: 3 - Repeater { id: rep1; model: rating; Image { source: "img/face-star.png"; width: 22 } } - Repeater { id: rep2; model: totalRating-rating; Image { source: "img/draw-star.png"; width: 22 } } + Repeater { id: rep1; model: rating; Image { source: "qrc:welcome/images/face-star.png"; width: 22 } } + Repeater { id: rep2; model: totalRating-rating; Image { source: "qrc:welcome/images/draw-star.png"; width: 22 } } } diff --git a/src/plugins/welcome/images/checked.png b/src/plugins/welcome/images/checked.png Binary files differnew file mode 100644 index 0000000000..68617b2f50 --- /dev/null +++ b/src/plugins/welcome/images/checked.png diff --git a/share/qtcreator/welcomescreen/widgets/img/draw-star.png b/src/plugins/welcome/images/draw-star.png Binary files differindex bde01565d8..bde01565d8 100644 --- a/share/qtcreator/welcomescreen/widgets/img/draw-star.png +++ b/src/plugins/welcome/images/draw-star.png diff --git a/share/qtcreator/welcomescreen/widgets/img/face-star.png b/src/plugins/welcome/images/face-star.png Binary files differindex 7455f9dcc2..7455f9dcc2 100644 --- a/share/qtcreator/welcomescreen/widgets/img/face-star.png +++ b/src/plugins/welcome/images/face-star.png diff --git a/share/qtcreator/welcomescreen/widgets/img/lineedit.png b/src/plugins/welcome/images/lineedit.png Binary files differindex 1f15c4fcaa..1f15c4fcaa 100644 --- a/share/qtcreator/welcomescreen/widgets/img/lineedit.png +++ b/src/plugins/welcome/images/lineedit.png diff --git a/src/plugins/welcome/welcome.qrc b/src/plugins/welcome/welcome.qrc index 5215da8293..10e450960d 100644 --- a/src/plugins/welcome/welcome.qrc +++ b/src/plugins/welcome/welcome.qrc @@ -26,5 +26,9 @@ <file>images/background_center_frame_v2.png</file> <file>images/tab_hover.png</file> <file>images/rc_combined_transparent.png</file> + <file>images/checked.png</file> + <file>images/lineedit.png</file> + <file>images/draw-star.png</file> + <file>images/face-star.png</file> </qresource> </RCC> |