various improvements and fixes to widgetexplorer
This commit is contained in:
parent
f9b52427e7
commit
b2e2cff847
@ -24,7 +24,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQuickView>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
@ -229,7 +228,7 @@ void DesktopCorona::checkViews()
|
|||||||
|
|
||||||
//check every containment is in proper view
|
//check every containment is in proper view
|
||||||
for (int i = 0; i < m_desktopWidget->screenCount(); ++i) {
|
for (int i = 0; i < m_desktopWidget->screenCount(); ++i) {
|
||||||
|
qDebug() << "TODO: Implement loading containments into the views";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
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.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.draganddrop 2.0
|
import org.kde.draganddrop 2.0
|
||||||
import org.kde.qtextracomponents 2.0
|
import org.kde.qtextracomponents 2.0
|
||||||
@ -33,17 +34,10 @@ PlasmaCore.FrameSvgItem {
|
|||||||
property string description: model.description
|
property string description: model.description
|
||||||
property string author: model.author
|
property string author: model.author
|
||||||
property string email: model.email
|
property string email: model.email
|
||||||
//property string license: model.license
|
property string license: model.license
|
||||||
property string license: "GPL" // FIXME
|
|
||||||
property string pluginName: model.pluginName
|
property string pluginName: model.pluginName
|
||||||
property bool local: model.local
|
property bool local: model.local
|
||||||
|
|
||||||
function i18n(inp) { // FIXME: HACK!
|
|
||||||
return inp;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ListView.onRemove: SequentialAnimation {
|
ListView.onRemove: SequentialAnimation {
|
||||||
PropertyAction {
|
PropertyAction {
|
||||||
target: background
|
target: background
|
||||||
@ -133,14 +127,15 @@ PlasmaCore.FrameSvgItem {
|
|||||||
leftMargin: background.margins.left
|
leftMargin: background.margins.left
|
||||||
rightMargin: background.margins.right
|
rightMargin: background.margins.right
|
||||||
}
|
}
|
||||||
|
spacing: 4
|
||||||
PlasmaComponents.Label {
|
PlasmaExtras.Heading {
|
||||||
id: titleText
|
id: titleText
|
||||||
|
level: 4
|
||||||
text: title
|
text: title
|
||||||
font {
|
// font {
|
||||||
weight: Font.Bold
|
// weight: Font.Bold
|
||||||
pointSize: theme.smallestFont.pointSize
|
// pointSize: theme.smallestFont.pointSize
|
||||||
}
|
// }
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
@ -173,7 +168,7 @@ PlasmaCore.FrameSvgItem {
|
|||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
elide: Text.ElideRight
|
//elide: Text.ElideRight
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
verticalAlignment: Text.AlignTop
|
verticalAlignment: Text.AlignTop
|
||||||
maximumLineCount: 3
|
maximumLineCount: 3
|
||||||
|
@ -25,7 +25,7 @@ import org.kde.qtextracomponents 2.0
|
|||||||
Item {
|
Item {
|
||||||
id: main
|
id: main
|
||||||
|
|
||||||
width: 400
|
width: 240
|
||||||
height: 800
|
height: 800
|
||||||
//this is used to perfectly align the filter field and delegates
|
//this is used to perfectly align the filter field and delegates
|
||||||
property int cellWidth: theme.defaultFont.pixelSize * 20
|
property int cellWidth: theme.defaultFont.pixelSize * 20
|
||||||
@ -40,12 +40,6 @@ Item {
|
|||||||
property Item getWidgetsButton
|
property Item getWidgetsButton
|
||||||
property Item categoryButton
|
property Item categoryButton
|
||||||
|
|
||||||
|
|
||||||
function i18n(inp) { // FIXME: HACK!
|
|
||||||
return inp;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
PlasmaComponents.ContextMenu {
|
||||||
id: categoriesDialog
|
id: categoriesDialog
|
||||||
visualParent: main.categoryButton
|
visualParent: main.categoryButton
|
||||||
|
@ -52,7 +52,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
|
|||||||
setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole);
|
setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole);
|
||||||
setData(info.comment(), PlasmaAppletItemModel::DescriptionRole);
|
setData(info.comment(), PlasmaAppletItemModel::DescriptionRole);
|
||||||
setData(info.category().toLower(), PlasmaAppletItemModel::CategoryRole);
|
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.website(), PlasmaAppletItemModel::WebsiteRole);
|
||||||
setData(info.version(), PlasmaAppletItemModel::VersionRole);
|
setData(info.version(), PlasmaAppletItemModel::VersionRole);
|
||||||
setData(info.author(), PlasmaAppletItemModel::AuthorRole);
|
setData(info.author(), PlasmaAppletItemModel::AuthorRole);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQmlError>
|
#include <QQmlError>
|
||||||
|
#include <QQuickItem>
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
@ -69,12 +70,26 @@ void WidgetExplorerView::init()
|
|||||||
connect(this, &QQuickView::visibleChanged, this, &WidgetExplorerView::widgetExplorerClosed);
|
connect(this, &QQuickView::visibleChanged, this, &WidgetExplorerView::widgetExplorerClosed);
|
||||||
setResizeMode(QQuickView::SizeRootObjectToView);
|
setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
m_widgetExplorer->setContainment(m_containment);
|
m_widgetExplorer->setContainment(m_containment);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetExplorerView::setContainment(Plasma::Containment* c)
|
void WidgetExplorerView::setContainment(Plasma::Containment* c)
|
||||||
{
|
{
|
||||||
m_containment = c;
|
m_containment = c;
|
||||||
m_widgetExplorer->setContainment(c);
|
m_widgetExplorer->setContainment(c);
|
||||||
|
|
||||||
|
// QObject *graphicObject = m_containment->property("graphicObject").value<QObject *>();
|
||||||
|
//
|
||||||
|
// 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";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user