various improvements and fixes to widgetexplorer
This commit is contained in:
parent
f9b52427e7
commit
b2e2cff847
@ -24,7 +24,6 @@
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickView>
|
||||
#include <QTimer>
|
||||
|
||||
#include <KLocalizedString>
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <QQmlContext>
|
||||
#include <QQmlError>
|
||||
#include <QQuickItem>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <KWindowSystem>
|
||||
@ -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<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