aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-10-27 15:03:38 -0400
committerKen Moore <ken@pcbsd.org>2014-10-27 15:03:38 -0400
commit9482acb96095a6e6c236a72f60995e43d590b75f (patch)
treef9d5c13c04e69b61bb19107c154d7df2518918d6 /lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp
parentAdd a new menu plugin: (diff)
downloadlumina-9482acb96095a6e6c236a72f60995e43d590b75f.tar.gz
lumina-9482acb96095a6e6c236a72f60995e43d590b75f.tar.bz2
lumina-9482acb96095a6e6c236a72f60995e43d590b75f.zip
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)
Diffstat (limited to 'lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp')
-rw-r--r--lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp b/lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp
deleted file mode 100644
index 21b1d1f6..00000000
--- a/lumina-desktop/desktop-plugins/desktopview/DeskItem.cpp
+++ /dev/null
@@ -1,50 +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 "DeskItem.h"
-
-DeskItem::DeskItem(QWidget *parent, QString itempath, int ssize) : QToolButton(parent){
- this->setFixedSize(ssize, ssize);
- this->setWhatsThis(itempath);
- this->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
- this->setAutoRaise(true);
- int txtheight = this->fontMetrics().height() *2;
- this->setIconSize( QSize(ssize-txtheight, ssize-txtheight));
- connect(this, SIGNAL(clicked()), this, SLOT(RunItem()) );
- updateItem();
-}
-
-DeskItem::~DeskItem(){
-
-}
-
-void DeskItem::updateItem(){
- QFileInfo info(this->whatsThis());
- QIcon ico;
- QString txt;
- if(info.isDir()){
- ico = LXDG::findIcon("folder","");
- txt = info.fileName();
- }else if(info.suffix()=="desktop"){
- bool ok = false;
- XDGDesktop dsk = LXDG::loadDesktopFile(this->whatsThis(), ok);
- if(ok){
- ico = LXDG::findIcon( dsk.icon );
- txt = dsk.name;
- }else{
- ico = LXDG::findIcon("","");
- txt = info.fileName();
- }
- }else{
- ico = LXDG::findIcon("application-x-zerosize","");
- txt = info.fileName();
- }
- this->setIcon(ico);
- //Trim the text size to fit
- txt = this->fontMetrics().elidedText(txt, Qt::ElideRight ,this->width() - 4);
- this->setText(txt);
-
-} \ No newline at end of file
bgstack15