readonly property string userName: "QtForTizen"
titleBar.text: qsTr("Tweets")
titleBar.subText: userName
+ ListView {
+ id: listView
+ clip: true
+ anchors.fill: parent
+ delegate: ListDelegate {}
- contents: ListView {
- id: listView
- clip: true
-
- delegate: ListDelegate {}
-
- //model: TwitterModel {
- model: TwitterMockModel {
- user: userName
- }
- ScrollDecorator {
- flickableItem: listView
- }
+ //model: TwitterModel {
+ model: TwitterMockModel {
+ user: userName
+ }
+ ScrollDecorator {
+ flickableItem: listView
}
+ }
}
width: Utils.appWidth * Utils.appScale
height: Utils.appHeight * Utils.appScale
- StackView {
- id: pageStack
+ Item {
anchors.fill: parent
-
- initialItem: TwitterView {}
+ StackView {
+ anchors.centerIn: parent // used to get autoscale
+ scale: Math.min(parent.width / width, parent.height / height)
+ width: Utils.appWidth
+ height: Utils.appHeight
+ initialItem: TwitterView {}
+ }
}
}
--- /dev/null
+/*
+ * Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Private 1.0
+
+Control {
+ id: root
+ property Item view
+
+ /*! \internal */
+ style: Qt.createComponent(Settings.style + "/ToolBarStyle.qml", root)
+
+ Loader {
+ id: styleLoader
+ property Item __control: root
+ sourceComponent: style
+ }
+
+ Loader {
+ id: toolBarLoader
+ sourceComponent: styleLoader.item.toolBar
+ }
+}
-/****************************************************************************
-**
-** Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
-** Contact: http://www.qt-project.org/legal
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
+/*
+ * Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
import QtQuick 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Tizen 1.0
-import "utils.js" as Utils
-Item {
- readonly property alias titleBar: __titleBar
- property Component contents
- Rectangle {
- width: Utils.appWidth
- height: Utils.appHeight
- anchors.centerIn: parent
- scale: Math.min(parent.width / width, parent.height / height)
- color: "#f8f6ef"
+Control {
+ id: root
+ readonly property alias titleBar: prvTitleBar
+ readonly property alias toolBar: prvToolBar
+ property alias backAction: prvBackAction
+
+ // all View's children go to content
+ default property alias data: content.data
+
+ property alias __content: content
+
+ /*! \internal */
+ style: Qt.createComponent(Settings.style + "/ViewStyle.qml", root)
+
+ Loader {
+ id: styleLoader
+ property alias __titleBar: prvTitleBar
+ property alias __toolBar: prvToolBar
+ property Item __control: root
+ property Action __backAction: prvBackAction
+ sourceComponent: style
+ }
+ Loader {
+ id: viewLoader
+ sourceComponent: styleLoader.item && styleLoader.item.view
+ }
- TitleBar {
- id: __titleBar
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- }
- Loader {
- id: contentsLoader
- sourceComponent: contents
- anchors.top: titleBar.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- }
+ TitleBar { id: prvTitleBar }
+ Item { id: content }
+ ToolBar { id: prvToolBar; view: root }
+ Action {
+ id: prvBackAction
+ onTriggered: { console.debug("Quit!"); Qt.quit(); }
}
}
Popup.qml\
BusyIndicator.qml \
ScrollDecorator.qml \
- TitleBar.qml
+ TitleBar.qml \
+ ToolBar.qml \
+ View.qml
CONFIG += force_independent
Popup 1.0 Popup.qml
BusyIndicator 1.0 BusyIndicator.qml
TitleBar 1.0 TitleBar.qml
+ToolBar 1.0 ToolBar.qml
+View 1.0 View.qml
font:{pixelSize:36, minimumPixelSize: 28}
}
+var toolBar = {
+ backgroundColor: colors.background,
+ iconColor: {
+ normal: colors.F032L1,
+ disabled: colors.F032L1,
+ pressed: colors.F011L12
+ },
+ back: {
+ source: images.img_00_icon_Back,
+ effectSource: {
+ normal: images.img_00_icon_Back_ef
+ //disabled:images.img_00_circle_bg_ef_dim
+ }
+ },
+ more: {
+ source: images.img_00_icon_more,
+ effectSource: {
+ normal: images.img_00_icon_more_ef
+ //disabled:images.img_00_circle_bg_ef_dim
+ }
+
+ }
+}
+
var checkBox = {
indicator: {
iconColor: {
normal: colors.F032L1,
disabled: colors.F032L1,
- pressed: colors.F032L1P
+ pressed: colors.B041
//highlighted: colors.F032L1P,
}
}
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
-** Contact: http://www.qt-project.org/legal
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.1
-
-Item {
- property string defaultFont: 'TizenSans'
- FontLoader {
- id: loader
- source: "TizenSansRegular.ttf"
- }
-}
property TitleBar control: __control
property Component titleBar: Rectangle {
- color: "#f8f6ef"
- width: control.width
+ color: Theme.titleBar.backgroundColor
+ width: 720
Binding { target: control; property: "implicitWidth"; value: width }
height: header.height + header2.height + 30 + 30
Binding { target: control; property: "implicitHeight"; value: height }
anchors.leftMargin: 30
anchors.rightMargin: 30
anchors.topMargin: 30
+ height: contentHeight
color: "#3b73b6"
font.family: Theme.fonts.defaultFamily
font.capitalization: Font.AllUppercase
text: control.text
font.pixelSize: 36
- //Binding { target: control; property: "text"; value: header.text }
}
Text {
id: header2
font.family: header.font.family
text: control.subText
font.pixelSize: 24
- //Binding { target: control; property: "subText"; value: header2.text }
}
}
}
--- /dev/null
+/*
+ * Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls.Tizen 1.0
+import "DefaultSettings.js" as Theme
+
+TizenBorderImage {
+ id: root
+ signal clicked
+
+ backgroundColor: mouseArea.pressed ? Theme.toolBar.iconColor.pressed : Theme.toolBar.iconColor.normal
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 15
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: root.clicked()
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2013 Jarosław Staniek <staniek@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Private 1.0
+import QtQuick.Controls.Tizen 1.0
+import "DefaultSettings.js" as Theme
+
+Style {
+ id: style
+ property ToolBar control: __control
+
+ property Component toolBar: Rectangle {
+ color: Theme.toolBar.backgroundColor
+ width: 720
+ Binding { target: control; property: "implicitWidth"; value: width }
+ height: 98
+ Binding { target: control; property: "implicitHeight"; value: height }
+
+ ToolBarButton {
+ id: moreButton
+ source: Theme.toolBar.more.source
+ effectSource: Theme.toolBar.more.effectSource.normal
+ anchors.left: parent.left
+ anchors.leftMargin: 26
+ }
+ ToolBarButton {
+ id: backButton
+ source: Theme.toolBar.back.source
+ effectSource: Theme.toolBar.back.effectSource.normal
+ anchors.right: parent.right
+ anchors.rightMargin: 26
+ onClicked: { /*console.log("back clicked");*/ view.backAction.trigger(); }
+ }
+ }
+}
Style {
id: style
property View control: __control
- //readonly property alias titleBar: __titleBar
- property Component view: //Item {
- Rectangle {
- width: 720 // TODO Utils.appWidth
- //width: control.width
- Binding { target: control; property: "implicitWidth"; value: width }
- height: 1280 // TODO Utils.appHeight
- //height: header.height + header2.height + 30 + 30
- Binding { target: control; property: "implicitHeight"; value: height }
- property Component contents: control.view
- Binding { target: control; property: "contents"; value: contents }
+ property Component view: Rectangle {
+ y: __titleBar.height
+ Binding { target: __titleBar; property: "anchors.top"; value: control.top }
+ Binding { target: __titleBar; property: "anchors.left"; value: control.left }
+ Binding { target: __titleBar; property: "anchors.right"; value: control.right }
- //anchors.centerIn: parent
- //scale: Math.min(parent.width / width, parent.height / height)
- color: "#f8f6ef"
+ Binding { target: control.__content; property: "anchors.top"; value: __titleBar.bottom }
+ Binding { target: control.__content; property: "anchors.bottom"; value: __toolBar.top }
+ Binding { target: control.__content; property: "anchors.left"; value: control.left }
+ Binding { target: control.__content; property: "anchors.right"; value: control.right }
- TitleBar {
- id: __titleBar
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- }
- Binding { target: control; property: "titleBar"; value: __titleBar }
+ Binding { target: __toolBar; property: "anchors.bottom"; value: control.bottom }
+ Binding { target: __toolBar; property: "anchors.left"; value: control.left }
+ Binding { target: __toolBar; property: "anchors.right"; value: control.right }
-/* Loader {
- id: contentsLoader
- sourceComponent: contents
- anchors.top: titleBar.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- }*/
- }
- // }
+ width: 720 // TODO Utils.appWidth
+ implicitWidth: width
+ implicitHeight: height
+
+ Binding { target: control; property: "implicitWidth"; value: width }
+ height: 1280 - __titleBar.height - __toolBar.height // TODO Utils.appHeight
+
+ Binding { target: control; property: "implicitHeight"; value: height }
+ color: Theme.colors.background
+ }
}
BusyIndicatorStyle 1.0 BusyIndicatorStyle.qml
Theme 1.0 DefaultSettings.js
TitleBarStyle 1.0 TitleBarStyle.qml
+ToolBarStyle 1.0 ToolBarStyle.qml
+ToolBarButton 1.0 ToolBarButton.qml
+ViewStyle 1.0 ViewStyle.qml
ContextMenuStyle.qml\
PopupStyle.qml\
BusyIndicatorStyle.qml \
- TitleBarStyle.qml
+ TitleBarStyle.qml \
+ ViewStyle.qml \
+ ToolBarStyle.qml \
+ ToolBarButton.qml
# Images
QML_FILES += \