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

WelcomeScreen: Clean up tag browser

- Always show tag browser button
- Make tag browser button a toggle (popup semantics)
- Remove "Clear" Button

Change-Id: Ic1f6894103fdc14973c230764ffb06574dd1897b
Reviewed-on: http://codereview.qt.nokia.com/2048

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Molkentin <daniel.molkentin@nokia.com>
parent 26851ec3
......@@ -21,5 +21,6 @@ OTHER_FILES = develop.qml \
widgets/FeaturedAndNewsListing.qml \
widgets/NewsListing.qml \
widgets/TabWidget.qml \
widgets/TagBrowser.qml \
examples_fallback.xml \
qtcreator_tutorials.xml
......@@ -36,12 +36,12 @@ import "../components/custom" as Custom
Custom.Button {
id: button
width: Math.max(100, labelItem.contentsWidth+20)
width: Math.max(50, labelItem.contentsWidth+20)
height: 32
background: BorderImage {
source: {
if (pressed)
if (pressed || checked )
return "qrc:/welcome/images/btn_26_pressed.png"
else
if (containsMouse)
......
......@@ -64,7 +64,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin:4
anchors.verticalCenter: parent.verticalCenter
width: Math.max(lineEditRoot.width - checkBox.width - 28 - tagFilterButton.width, 100)
width: Math.max(lineEditRoot.width - checkBox.width - 21 - tagFilterButton.width, 100)
onTextChanged: examplesModel.parseSearchString(text)
}
......@@ -82,15 +82,25 @@ Item {
Button {
id: tagFilterButton
property string tag
property Item browser;
onTagChanged: exampleBrowserRoot.appendTag(tag)
anchors.left: checkBox.right
anchors.leftMargin: 6
anchors.verticalCenter: lineEdit.verticalCenter
visible: !examplesModel.showTutorialsOnly
text: qsTr("Tag List")
onClicked: {
tagBrowserLoader.source = "TagBrowser.qml"
tagBrowserLoader.item.visible = true
checkable: true
Connections {
target: tagBrowserLoader.item
onVisibleChanged: tagFilterButton.checked = tagBrowserLoader.item.visible
}
onCheckedChanged: {
if (checked) {
tagBrowserLoader.source = "TagBrowser.qml"
var item = tagBrowserLoader.item;
item.bottomMargin = lineEditRoot.height
item.visible = true
} else { tagBrowserLoader.item.visible = false }
}
}
}
......
......@@ -33,9 +33,10 @@
import QtQuick 1.0
Rectangle {
property int bottomMargin : 0
id: tagChooser
anchors.fill: parent
anchors.bottomMargin: bottomMargin
color: "darkgrey"
opacity: 0.95
radius: 6
......@@ -74,36 +75,6 @@ Rectangle {
font.bold: true
}
Item {
width: rect.width
height: rect.height
anchors.margins: 6;
anchors.top: parent.top;
anchors.right: parent.right
Rectangle {
color: "red"
id: rect
radius: 4
opacity: 0.3
width: clearText.width+4
height: clearText.height+4
x: clearText.x-2
y: clearText.y-2
}
Text { id: clearText; text: qsTr("Clear"); color: "white"; anchors.centerIn: parent }
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: {
tagChooser.visible = false;
tagFilterButton.tag = "";
}
}
}
Flickable {
id: flickable
anchors.fill: parent
......@@ -137,34 +108,17 @@ Rectangle {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: { tagChooser.visible = false; tagFilterButton.tag = model.value }
}
states: [
State {
name: "selected"
when: mouseArea.pressed
},
State {
name: "hovered"
when: mouseArea.containsMouse
PropertyChanges {
target: btnRect
color: "darkblue"
opacity: 0.3
}
}
]
transitions: [
Transition {
from: "hovered"
to: "selected"
ParallelAnimation {
PropertyAction { target: tagFilterButton; property: "tag"; value: model.value }
PropertyAction { target: tagChooser; property: "visible"; value: false }
ColorAnimation { to: "#00000000"; duration: 0 }
}
PropertyChanges { target: btnRect; color: "darkblue"; opacity: 0.3 }
}
]
}
}
}
......
......@@ -412,7 +412,6 @@ bool ExamplesListModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex
wordMatch |= (bool)name.contains(subString, Qt::CaseInsensitive);
if (wordMatch)
continue;
// TODO: match substring
wordMatch |= containsSubString(tags, subString, Qt::CaseInsensitive);
if (wordMatch)
continue;
......
......@@ -38,8 +38,6 @@
#include <QtCore/QXmlStreamReader>
#include <QtGui/QSortFilterProxyModel>
#include <qdebug.h>
namespace QtSupport {
namespace Internal {
......
......@@ -63,7 +63,7 @@
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
enum { debug = 1 };
enum { debug = 0 };
using namespace ExtensionSystem;
......
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