2
// #include "customwidgets.h"
3
#include <plasma/applet.h>
4
#include "widgetsexplorer/widgetexplorer.h"
5
#include <plasma/containment.h>
6
#include <QDesktopWidget>
7
#include <plasma/corona.h>
8
#include <plasma/view.h>
9
#include <plasma/containment.h>
11
int main(int argc, char *argv[])
13
QApplication app(argc, argv);
15
Plasma::Containment *containment = new Plasma::Containment();
17
Plasma::WidgetExplorer *appletBrowser;
19
Qt::Orientation orientation = Qt::Vertical;
20
// Qt::Orientation orientation = Qt::Horizontal;
22
appletBrowser = new Plasma::WidgetExplorer();
23
appletBrowser->setContainment(containment);
24
appletBrowser->setLocation(Plasma::BottomEdge);
25
appletBrowser->populateWidgetList();
27
Plasma::Corona *scene = new Plasma::Corona();
28
scene->addItem(appletBrowser);
29
scene->setSceneRect(QRectF(0, 0, appletBrowser->minimumWidth(), appletBrowser->minimumHeight()));
31
Plasma::View *view = new Plasma::View(appletBrowser->containment(), 0);
32
view->setScene(scene);
33
view->setWindowFlags(Qt::FramelessWindowHint);
34
view->setAttribute(Qt::WA_TranslucentBackground, true);
35
view->setStyleSheet("background: transparent");
37
QDesktopWidget *screen = new QDesktopWidget();
39
view->setMinimumWidth(appletBrowser->minimumWidth());
40
view->setMaximumWidth(appletBrowser->minimumWidth());
41
view->setMinimumHeight(appletBrowser->minimumHeight());
42
view->setMaximumHeight(appletBrowser->minimumHeight());
44
if(orientation == Qt::Horizontal) {
45
view->move(0, screen->height() - view->maximumHeight());
52
view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
53
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);