Commit a994a6da authored by Daniel Molkentin's avatar Daniel Molkentin
Browse files

Reapply 0461150b.

After conflict resolution.

Change-Id: I888b0d110d20df88e1cb96424717e914a9a613de
Reviewed-on: http://codereview.qt.nokia.com/1890

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Molkentin <daniel.molkentin@nokia.com>
parent 456263e5
......@@ -31,48 +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"
}
border { left: 5; right: 5; top: 5; bottom: 5 }
}
Text {
id: label;
anchors.left: innerImg.right
anchors.right: parent.right
text: root.text
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()
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" }
}
]
}
......@@ -46,20 +46,20 @@ Item {
anchors.right: parent.right
anchors.bottomMargin: - 8
anchors.leftMargin: - 8
anchors.rightMargin: -8
anchors.rightMargin: scrollArea.verticalScrollBar.visible ? 0 : -8
Components.TextField {
LineEdit {
placeholderText: !checkBox.checked ? qsTr("Search in Tutorials") : qsTr("Search in Tutorials, Examples and Demos")
focus: true
id: lineEdit
anchors.left: parent.left
anchors.leftMargin:4
anchors.verticalCenter: parent.verticalCenter
width: Math.max(lineEditRoot.width - checkBox.width - 24 - tagFilterButton.width, 0)
width: Math.max(lineEditRoot.width - checkBox.width - 28 - tagFilterButton.width, 100)
onTextChanged: examplesModel.filterRegExp = RegExp('.*'+text, "im")
}
Components.CheckBox {
CheckBox {
id: checkBox
text: qsTr("Show Examples and Demos")
checked: false
......@@ -73,11 +73,11 @@ Item {
Button {
id: tagFilterButton
property string tag
Behavior on opacity { NumberAnimation{} }
onTagChanged: { examplesModel.filterTag = tag; examplesModel.updateFilter() }
anchors.left: checkBox.right
anchors.leftMargin: 6
anchors.verticalCenter: lineEdit.verticalCenter
opacity: !examplesModel.showTutorialsOnly ? 1 : 0
visible: !examplesModel.showTutorialsOnly
text: tag === "" ? qsTr("Filter by Tag") : qsTr("Tag Filter: %1").arg(tag)
onClicked: {
tagBrowserLoader.source = "TagBrowser.qml"
......
......@@ -35,7 +35,7 @@ import components 1.0 as Components
Rectangle {
id: inner_background
height: 32
height: 40
gradient: Gradient{
GradientStop{color: "#eee" ; position: 0}
......@@ -48,34 +48,27 @@ Rectangle {
// whitelist
property bool _hasDesktopTheme: welcomeMode.platform() === "linux"
Components.Button {
Button {
id: feedbackButton
text: qsTr("Feedback")
iconSource: "qrc:welcome/images/feedback_arrow.png"
height: 32
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.margins: 5
anchors.rightMargin: 10
onClicked: welcomeMode.sendFeedback()
}
InsetText {
Text {
id: feedbackText
property bool canShow: parent.width > 630
anchors.verticalCenter: parent.verticalCenter
anchors.left: feedbackButton.right
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.margins: 5
opacity: canShow ? 1 : 0
Behavior on opacity{NumberAnimation{easing.type: Easing.OutSine}}
width: canShow ? paintedWidth : 0
mainColor: "#444"
text: qsTr("Help us make Qt Creator even better")
}
Components.Button {
Button {
id: openProjectButton
text: qsTr("Open Project...")
focus: false
......@@ -86,13 +79,15 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
}
Components.Button {
Button {
id: createProjectButton
text: qsTr("Create Project...")
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : ""
onClicked: welcomeMode.newProject();
height: 32
anchors.right: parent.right
anchors.margins: 5
anchors.verticalCenter: parent.verticalCenter
}
}
......@@ -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: "" } } ]
}
}
}
......@@ -36,6 +36,6 @@ Row {
property int rating : 2
property int totalRating: 3
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 } }
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 } }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment