diff options
author | Tomasz Olszak <olszak.tomasz@gmail.com> | 2013-08-11 20:03:49 +0000 |
---|---|---|
committer | Tomasz Olszak <olszak.tomasz@gmail.com> | 2013-08-11 22:07:49 +0200 |
commit | c9fc910416426b34b613934dd9517a67e97318d4 (patch) | |
tree | 837e3eecdb3302c3e9473747b9478c4d84fdb8f6 | |
parent | a7463f4beadd406ae9b672e0c190c5116ecf723c (diff) | |
download | qtquickcontrols-tizen-c9fc910416426b34b613934dd9517a67e97318d4.tar.gz qtquickcontrols-tizen-c9fc910416426b34b613934dd9517a67e97318d4.tar.bz2 qtquickcontrols-tizen-c9fc910416426b34b613934dd9517a67e97318d4.zip |
Panel moved to Controls.Tizen plugin.
Examples fixed. Now there is no need to import
QtQuick.Controls.Styles.Tizen in application
Change-Id: I0a31087a7974dd829385bdbf28169fb0de4e7c6b
Reviewed-by: Jarosław Staniek <staniek@kde.org>
-rw-r--r-- | examples/touch/content/CheckBoxPage.qml | 2 | ||||
-rw-r--r-- | examples/touch/content/ConfigurationPage.qml | 20 | ||||
-rw-r--r-- | examples/touch/main.qml | 2 | ||||
-rw-r--r-- | src/controls/Panel.qml | 28 | ||||
-rw-r--r-- | src/controls/controls.pro | 3 | ||||
-rw-r--r-- | src/controls/private/TizenControls.qml | 1 | ||||
-rw-r--r-- | src/controls/qmldir | 1 | ||||
-rw-r--r-- | src/styles/CheckBoxStyle.qml | 3 | ||||
-rw-r--r-- | src/styles/PanelStyle.qml | 38 | ||||
-rw-r--r-- | src/styles/TabViewStyle.qml | 3 | ||||
-rw-r--r-- | src/styles/TizenBorderImage.qml | 10 | ||||
-rw-r--r-- | src/styles/private/PrivatePanel.qml (renamed from src/styles/Panel.qml) | 6 | ||||
-rw-r--r-- | src/styles/qmldir | 2 | ||||
-rw-r--r-- | src/styles/styles.pro | 6 |
14 files changed, 105 insertions, 20 deletions
diff --git a/examples/touch/content/CheckBoxPage.qml b/examples/touch/content/CheckBoxPage.qml index 80f51ef..bdaa585 100644 --- a/examples/touch/content/CheckBoxPage.qml +++ b/examples/touch/content/CheckBoxPage.qml @@ -97,7 +97,7 @@ Item { x:100 width:root.width/2 height: root.height/10 - styleHints: {"color": "yellow","pressedColor": "red"} + styleHints: {"color": "orange","pressedColor": "red"} LayoutMirroring.enabled: true LayoutMirroring.childrenInherit: true diff --git a/examples/touch/content/ConfigurationPage.qml b/examples/touch/content/ConfigurationPage.qml index 83f3106..63e5406 100644 --- a/examples/touch/content/ConfigurationPage.qml +++ b/examples/touch/content/ConfigurationPage.qml @@ -29,7 +29,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Tizen 1.0 -import QtQuick.Controls.Styles.Tizen 1.0 import QtQuick.Layouts 1.0 Item { @@ -70,8 +69,9 @@ Item { id: themePanel x:15 width: root.width-30 - onPressedChanged: { - if (pressed) + active: false + onActiveChanged: { + if (active) themeCheckBoxPanel.show() else themeCheckBoxPanel.hide() @@ -91,7 +91,7 @@ Item { fontSizeMode: Text.Fit MouseArea { anchors.fill: parent - onClicked: themePanel.pressed = !themePanel.pressed + onClicked: themePanel.active = !themePanel.active } } } @@ -107,7 +107,6 @@ Item { name:"visible" PropertyChanges { target: themeCheckBoxPanel - //visible: true width: root.width -30 height: checkBoxWhite.implicitHeight + spacing + checkBoxBlack.implicitHeight } @@ -117,10 +116,12 @@ Item { Transition { from: "*" to: "*" - NumberAnimation { - target: themeCheckBoxPanel - properties: "width,height" - duration: 200 + ParallelAnimation { + NumberAnimation { + target: themeCheckBoxPanel + properties: "width,height" + duration: 200 + } } } ] @@ -132,6 +133,7 @@ Item { } property string theme: TizenControls.currentTheme + onThemeChanged: { checkBoxWhite.checked = TizenControls.currentTheme === "white" checkBoxBlack.checked = TizenControls.currentTheme === "black" diff --git a/examples/touch/main.qml b/examples/touch/main.qml index 1f6b799..a07537c 100644 --- a/examples/touch/main.qml +++ b/examples/touch/main.qml @@ -54,7 +54,7 @@ ApplicationWindow { contentOrientation: Screen.orientation property bool pageCurlEffectEnabled: false - + Component.onCompleted: TizenControls.changeTheme("white") Item { id: rotatedItem anchors.fill: parent diff --git a/src/controls/Panel.qml b/src/controls/Panel.qml new file mode 100644 index 0000000..c474f01 --- /dev/null +++ b/src/controls/Panel.qml @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com> + * + * 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.Private 1.0 + +Control { + id: root + property color color + property bool active: false + style: Qt.createComponent(Settings.style + "/PanelStyle.qml", root) +} diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 792cc10..d25044d 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -17,7 +17,8 @@ QML_FILES += \ TimeEdit.qml \ TitleBar.qml \ ToolBar.qml \ - View.qml + View.qml \ + Panel.qml CONFIG += force_independent diff --git a/src/controls/private/TizenControls.qml b/src/controls/private/TizenControls.qml index 6aa8e96..11e507a 100644 --- a/src/controls/private/TizenControls.qml +++ b/src/controls/private/TizenControls.qml @@ -37,6 +37,7 @@ QtObject { property QtObject pal: QtObject { readonly property color foreground: TizenConfig.colors.foreground readonly property color background: TizenConfig.colors.background + readonly property color active: TizenConfig.panel.color.pressed } } diff --git a/src/controls/qmldir b/src/controls/qmldir index 03e779d..164a704 100644 --- a/src/controls/qmldir +++ b/src/controls/qmldir @@ -14,3 +14,4 @@ TitleBar 1.0 TitleBar.qml TimeEdit 1.0 TimeEdit.qml ToolBar 1.0 ToolBar.qml View 1.0 View.qml +Panel 1.0 Panel.qml diff --git a/src/styles/CheckBoxStyle.qml b/src/styles/CheckBoxStyle.qml index 6e118c8..8d9659e 100644 --- a/src/styles/CheckBoxStyle.qml +++ b/src/styles/CheckBoxStyle.qml @@ -21,6 +21,7 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles.Tizen 1.0 +import "private" CheckBoxStyle { id: checkboxStyle @@ -49,7 +50,7 @@ CheckBoxStyle { } - background: Panel { + background: PrivatePanel { id:panel pressed: control.pressed property var pressedColor: control.styleHints && control.styleHints["pressedColor"] ? control.styleHints["pressedColor"]: TizenConfig.panel.color.pressed diff --git a/src/styles/PanelStyle.qml b/src/styles/PanelStyle.qml new file mode 100644 index 0000000..706265f --- /dev/null +++ b/src/styles/PanelStyle.qml @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com> + * + * 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.Private 1.0 +import QtQuick.Controls.Styles.Tizen 1.0 +import "private" + +Style { + id:style + + property Component panel: PrivatePanel { + anchors.fill: parent + Binding { + target: control + property: "color" + value: control.active ? TizenConfig.panel.color.pressed : TizenConfig.panel.color.normal + } + backgroundColor: control.color + } + +} diff --git a/src/styles/TabViewStyle.qml b/src/styles/TabViewStyle.qml index e2d4e13..4d3e3df 100644 --- a/src/styles/TabViewStyle.qml +++ b/src/styles/TabViewStyle.qml @@ -21,13 +21,14 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles.Tizen 1.0 +import "private" TabViewStyle { id:root tabsAlignment: Qt.AlignLeft tabOverlap: 0 frameOverlap: 0 - frame: Panel { + frame: PrivatePanel { anchors.fill: parent } diff --git a/src/styles/TizenBorderImage.qml b/src/styles/TizenBorderImage.qml index aa65a60..d0c668a 100644 --- a/src/styles/TizenBorderImage.qml +++ b/src/styles/TizenBorderImage.qml @@ -50,6 +50,11 @@ Item { } " } + onStatusChanged: { + if (status == BorderImage.Error) { + console.log("Error while loading BorderImage:"+source) + } + } } BorderImage { id:effect @@ -74,6 +79,11 @@ Item { } " } + onStatusChanged: { + if (status == BorderImage.Error) { + console.log("Error while loading BorderImage:"+source) + } + } } } diff --git a/src/styles/Panel.qml b/src/styles/private/PrivatePanel.qml index 0335e50..01541f9 100644 --- a/src/styles/Panel.qml +++ b/src/styles/private/PrivatePanel.qml @@ -23,8 +23,8 @@ import QtQuick.Controls.Styles.Tizen 1.0 TizenBorderImage { implicitWidth: 200 implicitHeight: 100 - property bool pressed:false - source: pressed ? TizenConfig.panel.source.pressed : TizenConfig.panel.source.normal - effectSource: pressed ? TizenConfig.panel.effectSource.pressed : (activeFocus ? TizenConfig.panel.effectSource.selected : TizenConfig.panel.effectSource.normal) + property bool pressed: false + source: "../" + (pressed ? TizenConfig.panel.source.pressed : TizenConfig.panel.source.normal) + effectSource: "../" + (pressed ? TizenConfig.panel.effectSource.pressed : (activeFocus ? TizenConfig.panel.effectSource.selected : TizenConfig.panel.effectSource.normal)) backgroundColor: pressed ? TizenConfig.panel.color.pressed: TizenConfig.panel.color.normal } diff --git a/src/styles/qmldir b/src/styles/qmldir index 0b7f32d..7362221 100644 --- a/src/styles/qmldir +++ b/src/styles/qmldir @@ -7,7 +7,7 @@ CheckBoxStyle 1.0 CheckBoxStyle.qml ButtonStyle 1.0 ButtonStyle.qml SliderStyle 1.0 SliderStyle.qml TizenBorderImage 1.0 TizenBorderImage.qml -Panel 1.0 Panel.qml +PanelStyle 1.0 PanelStyle.qml Floater 1.0 Floater.qml SwitchStyle 1.0 SwitchStyle.qml DetailButtonStyle 1.0 DetailButtonStyle.qml diff --git a/src/styles/styles.pro b/src/styles/styles.pro index 6bd0785..29c4c38 100644 --- a/src/styles/styles.pro +++ b/src/styles/styles.pro @@ -26,11 +26,13 @@ QML_FILES = \ DateEditStyle.qml\ TimeEditStyle.qml \ ToolBarStyle.qml \ - ToolBarButton.qml + ToolBarButton.qml \ + PanelStyle.qml QML_FILES += \ private/DateEditField.qml\ - private/DateEditBarPicker.qml + private/DateEditBarPicker.qml \ + private/PrivatePanel.qml # Images QML_FILES += \ |