From 9482acb96095a6e6c236a72f60995e43d590b75f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 27 Oct 2014 15:03:38 -0400 Subject: Make sure to put a max length on the text in the user button items (180 pixels - auto-scale does not work unless the widget is visible). Also remove the custom stylesheet for the systemwindow (so it uses the theme). Also start working on the new desktopview plugin (not integrated yet) --- .../desktopview/DesktopViewPlugin.cpp | 87 ---------------------- 1 file changed, 87 deletions(-) delete mode 100644 lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp (limited to 'lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp') diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp deleted file mode 100644 index 4c70d19f..00000000 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//=========================================== -// Lumina-DE source code -// Copyright (c) 2014, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#include "DesktopViewPlugin.h" - -DesktopViewPlugin::DesktopViewPlugin(QWidget *parent) : LDPlugin(parent, "desktopview"){ - watcher = new QFileSystemWatcher(this); - deskDir = QDir::homePath(); - if(QFile::exists(deskDir+"/Desktop") ){ - deskDir = deskDir+"/Desktop"; - }else if(QFile::exists(deskDir+"/desktop") ){ - deskDir = deskDir+"/desktop"; - } - watcher->addPath(deskDir); - icoSize = 0; //temporary placeholder - spacing = 0; //temporary placeholder - ITEMS.clear(); - layout = new QGridLayout(this); - layout->setContentsMargins(1,1,1,1); - this->setLayout(layout); - - //Connect the signals/slots - connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(UpdateDesktop()) ); - connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(UpdateDesktop()) ); - - //Now launch the update mechanisms in a new thread - QTimer::singleShot(10, this, SLOT(UpdateDesktop()) ); -} - -DesktopViewPlugin::~DesktopViewPlugin(){ - -} - -void DesktopViewPlugin::UpdateDesktop(){ - //Calculate available rows/columns - int oldSize = icoSize; - icoSize = 64; //64x64 default icons for now (make dynamic later) - int oldspacing = spacing; - spacing = 4; // 4 pixel space between items (make dynamic later); - if(icoSize != oldSize || spacing != oldspacing){ - //Re-create all the items with the proper size - for(int i=0; isetSpacing(spacing); - - int rmax = (this->height()-2)/(icoSize+spacing); - int cmax = (this->width()-2)/(icoSize+spacing); - //Now get the current items in the folder - QDir dir(deskDir); - QStringList items = dir.entryList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Type | QDir::LocaleAware | QDir::DirsFirst); - //iterate over all current items - for(int i=0; iwhatsThis().section("/",-1) ); - if( index == -1 ){ - //item no longer exists - remove it - delete ITEMS.takeAt(i); - i--; - }else{ - //Item still exists - remove it from the "new" list - ITEMS[i]->updateItem(); - items.removeAt(index); - } - } - //Now iterate over the spaces in the widget and create items as necessary - for(int r=0; rsetRowMinimumHeight(r,icoSize); - for(int c=0; c 0; c++){ - if(r==0){ layout->setColumnMinimumWidth(c,icoSize); } - if(layout->itemAtPosition(r,c)==0 && items.length() > 0){ - //Empty spot, put the first new item here - DeskItem *it = new DeskItem(this, deskDir+"/"+items[0], icoSize); - items.removeAt(0); - layout->addWidget(it, r,c); - ITEMS << it; - } - } - } - if(layout->itemAtPosition(rmax,cmax)==0){ - layout->addWidget(new QWidget(this), rmax, cmax); //put an empty widget here as a placeholder - } -} \ No newline at end of file -- cgit