From b2e2cff847d3ff1a38ca82f4aa7307fd5d344057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 26 Mar 2013 03:54:35 +0100 Subject: [PATCH] various improvements and fixes to widgetexplorer --- src/shell/desktopcorona.cpp | 3 +-- .../contents/explorer/AppletDelegate.qml | 25 ++++++++----------- .../contents/explorer/WidgetExplorer.qml | 8 +----- .../widgetexplorer/plasmaappletitemmodel.cpp | 2 +- .../widgetexplorer/widgetexplorerview.cpp | 15 +++++++++++ 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/shell/desktopcorona.cpp b/src/shell/desktopcorona.cpp index 4b567939c..0f33b368a 100644 --- a/src/shell/desktopcorona.cpp +++ b/src/shell/desktopcorona.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -229,7 +228,7 @@ void DesktopCorona::checkViews() //check every containment is in proper view for (int i = 0; i < m_desktopWidget->screenCount(); ++i) { - + qDebug() << "TODO: Implement loading containments into the views"; } } diff --git a/src/shell/qmlpackages/desktop/contents/explorer/AppletDelegate.qml b/src/shell/qmlpackages/desktop/contents/explorer/AppletDelegate.qml index 1faa195a7..7a58f8c91 100644 --- a/src/shell/qmlpackages/desktop/contents/explorer/AppletDelegate.qml +++ b/src/shell/qmlpackages/desktop/contents/explorer/AppletDelegate.qml @@ -19,6 +19,7 @@ import QtQuick 2.0 import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.draganddrop 2.0 import org.kde.qtextracomponents 2.0 @@ -33,17 +34,10 @@ PlasmaCore.FrameSvgItem { property string description: model.description property string author: model.author property string email: model.email - //property string license: model.license - property string license: "GPL" // FIXME + property string license: model.license property string pluginName: model.pluginName property bool local: model.local - function i18n(inp) { // FIXME: HACK! - return inp; - - } - - ListView.onRemove: SequentialAnimation { PropertyAction { target: background @@ -133,14 +127,15 @@ PlasmaCore.FrameSvgItem { leftMargin: background.margins.left rightMargin: background.margins.right } - - PlasmaComponents.Label { + spacing: 4 + PlasmaExtras.Heading { id: titleText + level: 4 text: title - font { - weight: Font.Bold - pointSize: theme.smallestFont.pointSize - } +// font { +// weight: Font.Bold +// pointSize: theme.smallestFont.pointSize +// } anchors { left: parent.left right: parent.right @@ -173,7 +168,7 @@ PlasmaCore.FrameSvgItem { left: parent.left right: parent.right } - elide: Text.ElideRight + //elide: Text.ElideRight wrapMode: Text.WordWrap verticalAlignment: Text.AlignTop maximumLineCount: 3 diff --git a/src/shell/qmlpackages/desktop/contents/explorer/WidgetExplorer.qml b/src/shell/qmlpackages/desktop/contents/explorer/WidgetExplorer.qml index 0b488f1c4..a9be3c0be 100644 --- a/src/shell/qmlpackages/desktop/contents/explorer/WidgetExplorer.qml +++ b/src/shell/qmlpackages/desktop/contents/explorer/WidgetExplorer.qml @@ -25,7 +25,7 @@ import org.kde.qtextracomponents 2.0 Item { id: main - width: 400 + width: 240 height: 800 //this is used to perfectly align the filter field and delegates property int cellWidth: theme.defaultFont.pixelSize * 20 @@ -40,12 +40,6 @@ Item { property Item getWidgetsButton property Item categoryButton - - function i18n(inp) { // FIXME: HACK! - return inp; - - } - PlasmaComponents.ContextMenu { id: categoriesDialog visualParent: main.categoryButton diff --git a/src/shell/widgetexplorer/plasmaappletitemmodel.cpp b/src/shell/widgetexplorer/plasmaappletitemmodel.cpp index 72c79ba8c..4ff4214b4 100644 --- a/src/shell/widgetexplorer/plasmaappletitemmodel.cpp +++ b/src/shell/widgetexplorer/plasmaappletitemmodel.cpp @@ -52,7 +52,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole); setData(info.comment(), PlasmaAppletItemModel::DescriptionRole); setData(info.category().toLower(), PlasmaAppletItemModel::CategoryRole); - //setData(info.fullLicense().name(KAboutData::FullName), PlasmaAppletItemModel::LicenseRole); // FIXME + setData(info.license(), PlasmaAppletItemModel::LicenseRole); setData(info.website(), PlasmaAppletItemModel::WebsiteRole); setData(info.version(), PlasmaAppletItemModel::VersionRole); setData(info.author(), PlasmaAppletItemModel::AuthorRole); diff --git a/src/shell/widgetexplorer/widgetexplorerview.cpp b/src/shell/widgetexplorer/widgetexplorerview.cpp index 81be72511..5217e1cff 100644 --- a/src/shell/widgetexplorer/widgetexplorerview.cpp +++ b/src/shell/widgetexplorer/widgetexplorerview.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -69,12 +70,26 @@ void WidgetExplorerView::init() connect(this, &QQuickView::visibleChanged, this, &WidgetExplorerView::widgetExplorerClosed); setResizeMode(QQuickView::SizeRootObjectToView); m_widgetExplorer->setContainment(m_containment); + + + } void WidgetExplorerView::setContainment(Plasma::Containment* c) { m_containment = c; m_widgetExplorer->setContainment(c); + +// QObject *graphicObject = m_containment->property("graphicObject").value(); +// +// if (graphicObject) { +// qDebug() << "using as graphic containment" << graphicObject << m_containment; +// +// rootObject()->setProperty("parent", QVariant::fromValue(graphicObject)); +// //rootObject()->setProperty("containment", QVariant::fromValue(graphicObject)); +// } else { +// qWarning() << "Containment graphic object not valid"; +// } }