From bf4c5e1358ce687ab9ad82fa1980077ca7028288 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 26 May 2017 17:22:18 -0400 Subject: Adjust a couple size measurements so they work better across both normal and high-DPI screens. --- src-qt5/core/lumina-desktop/BootSplash.cpp | 2 ++ .../lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp | 13 +++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src-qt5/core/lumina-desktop/BootSplash.cpp b/src-qt5/core/lumina-desktop/BootSplash.cpp index 1a648973..d2850aee 100644 --- a/src-qt5/core/lumina-desktop/BootSplash.cpp +++ b/src-qt5/core/lumina-desktop/BootSplash.cpp @@ -7,6 +7,8 @@ BootSplash::BootSplash() : QWidget(0, Qt::SplashScreen | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::WindowDoesNotAcceptFocus), ui(new Ui::BootSplash){ ui->setupUi(this); + this->setMinimumHeight( this->fontMetrics().height() * 12); + this->setMinimumWidth( this->minimumHeight() * 1.5); this->setObjectName("LuminaBootSplash"); //for theme styling //Center the window on the primary screen QPoint ctr = QApplication::desktop()->screenGeometry().center(); diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp index bdc54212..f4382ffc 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp @@ -165,7 +165,7 @@ void ItemWidget::createWidget(){ actButton->setPopupMode(QToolButton::InstantPopup); actButton->setArrowType(Qt::DownArrow); icon = new QLabel(this); - int H = 64; //(2.3*this->fontMetrics().height() ) -4; //make sure the height is large enough for two lines + int H = (2.5*this->fontMetrics().height() ) -4; //make sure the height is large enough for two lines icon->setFixedSize( QSize(H,H) ); name = new QLabel(this); name->setWordWrap(true); @@ -230,7 +230,7 @@ void ItemWidget::setupActions(XDGDesktop *app){ void ItemWidget::updateItems(){ //update the text/icon to match sizes - int H = 64; //(2.3*name->fontMetrics().height() ) -4; //make sure the height is large enough for two lines + int H = (2.5*name->fontMetrics().height() ) -4; //make sure the height is large enough for two lines icon->setFixedSize(QSize(H, H)); actButton->setFixedSize( QSize( H/2, H) ); QStringList newname = text.split("
"); @@ -238,23 +238,20 @@ void ItemWidget::updateItems(){ name->setText( newname.join("
") ); //Now reload the icon if necessary if(icon->pixmap()!=0){ - if(icon->pixmap()->size().height() < (H-4) ){ + if(icon->pixmap()->size().height() < H ){ if(iconPath.isEmpty()){ //Use item path (thumbnail or mimetype) if(LUtils::imageExtensions().contains(icon->whatsThis().section("/",-1).section(".",-1).toLower()) ){ ICONS->loadIcon(icon, icon->whatsThis()); - //icon->setPixmap( QIcon(icon->whatsThis()).pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); }else{ ICONS->loadIcon(icon, LXDG::findAppMimeForFile(icon->whatsThis()).replace("/","-") ); - //icon->setPixmap( LXDG::findMimeIcon(icon->whatsThis().section("/",-1)).pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); } }else{ if(ICONS->exists(iconPath)){ ICONS->loadIcon(icon, iconPath); } else{ ICONS->loadIcon(icon, "preferences-system-windows-actions"); } - //icon->setPixmap( LXDG::findIcon(iconPath,"preferences-system-windows-actions").pixmap(H-4,H-4).scaledToHeight(H-4,Qt::SmoothTransformation) ); } - }else if(icon->pixmap()->size().height() > (H-4) ){ - icon->setPixmap( icon->pixmap()->scaled(H-4, H-4, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) ); + }else if(icon->pixmap()->size().height() > H ){ + icon->setPixmap( icon->pixmap()->scaled(H, H, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) ); } } } -- cgit From b965b3af0f375e314904dd7a64895ac154a869a0 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 26 May 2017 18:15:19 -0400 Subject: Cleanup how the QtConcurrent thread is run in the Browser class a bit - no real difference, just more formally-correct. --- src-qt5/desktop-utils/lumina-fm/Browser.cpp | 12 ++++++------ src-qt5/desktop-utils/lumina-fm/Browser.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp index d3e1b453..2fb7c533 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp +++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp @@ -39,7 +39,7 @@ bool Browser::showingHiddenFiles(){ } // PRIVATE -void Browser::loadItem(QString info){ +void Browser::loadItem(QString info, Browser *obj){ //qDebug() << "LoadItem:" << info; //FileItem item; //itemame = info; @@ -58,7 +58,7 @@ void Browser::loadItem(QString info){ }*/ } //qDebug() << " - done with item:" << info; - this->emit threadDone(info, bytes); + obj->emit threadDone(info, bytes); } QIcon Browser::loadIcon(QString icon){ @@ -73,14 +73,14 @@ QIcon Browser::loadIcon(QString icon){ // PRIVATE SLOTS void Browser::fileChanged(QString file){ if(file.startsWith(currentDir+"/") ){ - if(QFile::exists(file) ){ QtConcurrent::run(this, &Browser::loadItem, file ); } //file modified but not removed + if(QFile::exists(file) ){ QtConcurrent::run(this, &Browser::loadItem, file, this); } //file modified but not removed else{ QTimer::singleShot(0, this, SLOT(loadDirectory()) ); } //file removed - need to update entire dir }else if(file==currentDir){ QTimer::singleShot(0, this, SLOT(loadDirectory()) ); } } void Browser::dirChanged(QString dir){ if(dir==currentDir){ QTimer::singleShot(500, this, SLOT(loadDirectory()) ); } - else if(dir.startsWith(currentDir)){ QtConcurrent::run(this, &Browser::loadItem, dir ); } + else if(dir.startsWith(currentDir)){ QtConcurrent::run(this, &Browser::loadItem, dir, this ); } } void Browser::futureFinished(QString name, QByteArray icon){ @@ -133,11 +133,11 @@ void Browser::loadDirectory(QString dir){ if(old.contains(path)){ old.removeAll(path); } oldFiles << path; //add to list for next time if(imageFormats.contains(path.section(".",-1).toLower()) || path.endsWith(".desktop")){ - QtConcurrent::run(this, &Browser::loadItem, path ); + QtConcurrent::run(this, &Browser::loadItem, path, this); //QCoreApplication::sendPostedEvents(); }else{ //No special icon loading - do it in-line here - loadItem(path); + loadItem(path, this); } } watcher->addPath(directory.absolutePath()); diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.h b/src-qt5/desktop-utils/lumina-fm/Browser.h index c4641277..b5c7c038 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.h +++ b/src-qt5/desktop-utils/lumina-fm/Browser.h @@ -45,7 +45,7 @@ private: QHash mimeIcons; //cache for quickly re-using QIcons - void loadItem(QString info); //this is the main loader class - multiple instances each run in a separate thread + void loadItem(QString info, Browser *obj); //this is the main loader class - multiple instances each run in a separate thread QIcon loadIcon(QString icon); //simplification for using/populating the mimIcons cache private slots: -- cgit From 68819db4434b36888bc3b821fb51e9b7c8ca7911 Mon Sep 17 00:00:00 2001 From: q5sys Date: Mon, 29 May 2017 17:47:30 -0400 Subject: prototype autoextract function (currently disabled) --- src-qt5/desktop-utils/lumina-archiver/MainUI.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index 2972550c..ab2b4651 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -70,7 +70,16 @@ void MainUI::LoadArguments(QStringList args){ bool burnIMG = false; for(int i=0; istartExtract(newdir, true, archivefile); + qApp->exit();} +*/ + if(QFile::exists(args[i])){ ui->label_progress->setText(tr("Opening Archive...")); BACKEND->loadFile(args[i]); ui->actionUSB_Image->setEnabled(args[i].simplified().endsWith(".img")); -- cgit