From 06bbb405c55d8bb9afd0e5bedf4048a62985d75c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 7 Nov 2011 18:06:18 +0100 Subject: [PATCH] install tablet specific components in platformcomponents --- .../plasmacomponents/CMakeLists.txt | 22 ++++++ .../plasmacomponentsplugin.cpp | 4 +- .../platformcomponents/touch/ButtonShadow.qml | 74 +++++++++++++++++++ .../platformcomponents/touch/RoundShadow.qml | 65 ++++++++++++++++ .../platformcomponents/touch/qmldir | 38 ++++++++++ 5 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 declarativeimports/plasmacomponents/platformcomponents/touch/ButtonShadow.qml create mode 100644 declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml create mode 100644 declarativeimports/plasmacomponents/platformcomponents/touch/qmldir diff --git a/declarativeimports/plasmacomponents/CMakeLists.txt b/declarativeimports/plasmacomponents/CMakeLists.txt index a8605950a..882bb3907 100644 --- a/declarativeimports/plasmacomponents/CMakeLists.txt +++ b/declarativeimports/plasmacomponents/CMakeLists.txt @@ -24,3 +24,25 @@ target_link_libraries(plasmacomponentsplugin ${QT_QTCORE_LIBRARY} ${QT_QTDECLARA install(TARGETS plasmacomponentsplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/components) install(DIRECTORY qml/ DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/components) + + + +ADD_DEFINITIONS(-DTOUCH) + +set(plasmacomponentstouch_SRCS + plasmacomponentsplugin.cpp + qrangemodel.cpp + enums.cpp + qmenu.cpp + qmenuitem.cpp + kdialogproxy.cpp + ) + + + +add_library(plasmacomponentstouchplugin SHARED ${plasmacomponentstouch_SRCS}) +target_link_libraries(plasmacomponentstouchplugin ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBRARY}) + +install(TARGETS plasmacomponentstouchplugin DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) +install(DIRECTORY qml/ DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) +install(DIRECTORY platformcomponents/touch/ DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components) diff --git a/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp b/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp index 87c1cca0c..3e1d1fab6 100644 --- a/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp +++ b/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp @@ -20,6 +20,7 @@ #include "plasmacomponentsplugin.h" #include +#include #include "qrangemodel.h" @@ -28,7 +29,6 @@ #include "qmenuitem.h" #include "kdialogproxy.h" - void PlasmaComponentsPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.components")); @@ -38,7 +38,9 @@ void PlasmaComponentsPlugin::registerTypes(const char *uri) qmlRegisterType(uri, 0, 1, "ContextMenu"); qmlRegisterType(uri, 0, 1, "MenuItem"); +#ifndef TOUCH qmlRegisterType(uri, 0, 1, "QueryDialog"); +#endif qmlRegisterType(uri, 0, 1, "RangeModel"); diff --git a/declarativeimports/plasmacomponents/platformcomponents/touch/ButtonShadow.qml b/declarativeimports/plasmacomponents/platformcomponents/touch/ButtonShadow.qml new file mode 100644 index 000000000..9e55aaa7e --- /dev/null +++ b/declarativeimports/plasmacomponents/platformcomponents/touch/ButtonShadow.qml @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2011 by Daker Fernandes Pinheiro + * Copyright (C) 2011 by Marco Martin + * + * This program 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, or + * (at your option) any later version. + * + * This program 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 program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 1.0 +import org.kde.plasma.core 0.1 as PlasmaCore + +Item { + id: main + state: parent.state + + + PlasmaCore.FrameSvgItem { + id: shadow + + anchors { + fill: parent + leftMargin: -margins.left + topMargin: -margins.top + rightMargin: -margins.right + bottomMargin: -margins.bottom + } + imagePath: "widgets/button" + prefix: "shadow" + } + + states: [ + State { + name: "shadow" + PropertyChanges { + target: shadow + opacity: 1 + } + PropertyChanges { + target: hover + opacity: 0 + prefix: "hover" + } + }, + State { + name: "hidden" + PropertyChanges { + target: shadow + opacity: 0 + } + } + ] + + transitions: [ + Transition { + PropertyAnimation { + properties: "opacity" + duration: 250 + easing.type: Easing.OutQuad + } + } + ] +} diff --git a/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml b/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml new file mode 100644 index 000000000..12b53f4a7 --- /dev/null +++ b/declarativeimports/plasmacomponents/platformcomponents/touch/RoundShadow.qml @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 by Daker Fernandes Pinheiro + * Copyright (C) 2011 by Marco Martin + * + * This program 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, or + * (at your option) any later version. + * + * This program 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 program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 1.0 +import org.kde.plasma.core 0.1 as PlasmaCore + +Item { + id: main + state: parent.state + + PlasmaCore.SvgItem { + id: shadow + svg: PlasmaCore.Svg { + id: shadowSvg + imagePath: "widgets/actionbutton" + } + elementId: "shadow" + + anchors.fill: parent + } + + states: [ + State { + name: "shadow" + PropertyChanges { + target: shadow + opacity: 1 + } + }, + State { + name: "hidden" + PropertyChanges { + target: shadow + opacity: 0 + } + } + ] + + transitions: [ + Transition { + PropertyAnimation { + properties: "opacity" + duration: 250 + easing.type: Easing.OutQuad + } + } + ] +} diff --git a/declarativeimports/plasmacomponents/platformcomponents/touch/qmldir b/declarativeimports/plasmacomponents/platformcomponents/touch/qmldir new file mode 100644 index 000000000..d8c28a1aa --- /dev/null +++ b/declarativeimports/plasmacomponents/platformcomponents/touch/qmldir @@ -0,0 +1,38 @@ +plugin plasmacomponentstouchplugin + +BusyIndicator 0.1 BusyIndicator.qml +Button 0.1 Button.qml +ButtonColumn 0.1 ButtonColumn.qml +ButtonGroup 0.1 ButtonGroup.js +ButtonRow 0.1 ButtonRow.qml +CheckBox 0.1 CheckBox.qml +FlashingLabel 0.1 FlashingLabel.qml +Frame 0.1 Frame.qml +Highlight 0.1 Highlight.qml +IconWidget 0.1 IconWidget.qml +Label 0.1 Label.qml +ProgressBar 0.1 ProgressBar.qml +PushButton 0.1 PushButton.qml +RadioButton 0.1 RadioButton.qml +ScrollBar 0.1 ScrollBar.qml +ScrollDecorator 0.1 ScrollDecorator.qml +Slider 0.1 Slider.qml +Switch 0.1 Switch.qml +TextArea 0.1 TextArea.qml +TextField 0.1 TextField.qml +ToolBar 0.1 ToolBar.qml +ToolButton 0.1 ToolButton.qml +ListItem 0.1 ListItem.qml + +CommonDialog 0.1 CommonDialog.qml +QueryDialog 0.1 QueryDialog.qml +SelectionDialog 0.1 SelectionDialog.qml +Window 0.1 Window.qml + +Page 0.1 Page.qml +PageStack 0.1 PageStack.qml + +TabBar 0.1 TabBar.qml +TabButton 0.1 TabButton.qml +TabGroup 0.1 TabGroup.qml +SectionScroller 0.1 SectionScroller.qml