From 17963f47081fe7559854e633635f10d4b6062a58 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 18 Sep 2015 11:30:13 -0400 Subject: Turn off a bunch of debugging for the lumina-desktop, and adjust the desktopview plugin a bit more. --- lumina-desktop/LSession.cpp | 4 ++-- lumina-desktop/LXcbEventFilter.cpp | 4 ++-- .../desktop-plugins/desktopview/DesktopViewPlugin.cpp | 12 +++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 4d631bc9..d1dc54e5 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -641,7 +641,7 @@ QSettings* LSession::DesktopPluginSettings(){ WId LSession::activeWindow(){ //Check the last active window pointer first WId active = XCB->ActiveWindow(); - qDebug() << "Check Active Window:" << active << lastActiveWin; + //qDebug() << "Check Active Window:" << active << lastActiveWin; if(RunningApps.contains(active)){ lastActiveWin = active; } else if(RunningApps.contains(lastActiveWin) && XCB->WindowState(lastActiveWin) >= LXCB::VISIBLE){} //no change needed else{ @@ -653,7 +653,7 @@ WId LSession::activeWindow(){ break; } } - qDebug() << " -- New Last Active Window:" << lastActiveWin; + //qDebug() << " -- New Last Active Window:" << lastActiveWin; } return lastActiveWin; } diff --git a/lumina-desktop/LXcbEventFilter.cpp b/lumina-desktop/LXcbEventFilter.cpp index aa38002b..f7a11dad 100644 --- a/lumina-desktop/LXcbEventFilter.cpp +++ b/lumina-desktop/LXcbEventFilter.cpp @@ -96,9 +96,9 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag //============================== default: if(TrayDmgFlag!=0){ - //if( (ev->response_type & ~0x80)==TrayDmgFlag){ + if( (ev->response_type & ~0x80)==TrayDmgFlag){ session->WindowDamageEvent( ((xcb_damage_notify_event_t*)ev)->drawable ); - //} + } }/*else{ qDebug() << "Default Event:" << (ev->response_type & ~0x80); }*/ diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index 585f6531..b1300ec8 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -13,11 +13,12 @@ DesktopViewPlugin::DesktopViewPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){ this->setLayout( new QVBoxLayout()); this->layout()->setContentsMargins(0,0,0,0); + list = new QListWidget(this); list->setViewMode(QListView::IconMode); list->setFlow(QListWidget::TopToBottom); //Qt bug workaround - need the opposite flow in the widget constructor list->setWrapping(true); - list->setSpacing(2); + list->setSpacing(4); list->setSelectionBehavior(QAbstractItemView::SelectItems); list->setSelectionMode(QAbstractItemView::ExtendedSelection); list->setContextMenuPolicy(Qt::CustomContextMenu); @@ -131,7 +132,7 @@ void DesktopViewPlugin::updateContents(){ list->clear(); int icosize = this->readSetting("IconSize",64).toInt(); - QSize gridSZ = QSize(2*icosize,icosize+4+(2*this->fontMetrics().height()) ); + QSize gridSZ = QSize(qRound(1.8*icosize),icosize+4+(2*this->fontMetrics().height()) ); //qDebug() << "Icon Size:" << icosize <<"Grid Size:" << gridSZ.width() << gridSZ.height(); list->setGridSize(gridSZ); list->setIconSize(QSize(icosize,icosize)); @@ -140,6 +141,7 @@ void DesktopViewPlugin::updateContents(){ for(int i=0; isetSizeHint(gridSZ); //ensure uniform item sizes + //it->setForeground(QBrush(Qt::black, Qt::Dense2Pattern)); //Try to use a font color which will always be visible it->setTextAlignment(Qt::AlignCenter); it->setWhatsThis(files[i].absoluteFilePath()); QString txt; @@ -170,18 +172,18 @@ void DesktopViewPlugin::updateContents(){ } //Now adjust the visible text as necessary based on font/grid sizing it->setToolTip(txt); - if(this->fontMetrics().width(txt) > (gridSZ.width()-2) ){ + if(this->fontMetrics().width(txt) > (gridSZ.width()-4) ){ //int dash = this->fontMetrics().width("-"); //Text too long, try to show it on two lines txt = txt.section(" ",0,2).replace(" ","\n"); //First take care of any natural breaks if(txt.contains("\n")){ //need to check each line QStringList txtL = txt.split("\n"); - for(int i=0; ifontMetrics().elidedText(txtL[i], Qt::ElideRight, gridSZ.width()); } + for(int i=0; ifontMetrics().elidedText(txtL[i], Qt::ElideRight, gridSZ.width()-4); } txt = txtL.join("\n"); if(txtL.length()>2){ txt = txt.section("\n",0,1); } //only keep the first two lines }else{ - txt = this->fontMetrics().elidedText(txt,Qt::ElideRight, 2*gridSZ.width()); + txt = this->fontMetrics().elidedText(txt,Qt::ElideRight, 2*(gridSZ.width()-4)); //Now split the line in half for the two lines txt.insert( (txt.count()/2), "\n"); } -- cgit