aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lumina-desktop/LDesktop.cpp6
-rw-r--r--lumina-desktop/LDesktopPluginSpace.cpp4
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp16
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h2
4 files changed, 18 insertions, 10 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 5563164f..241302a4 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -374,7 +374,10 @@ void LDesktop::RemoveDeskPlugin(QString ID){
void LDesktop::IncreaseDesktopPluginIcons(){
int cur = settings->value(DPREFIX+"IconSize",64).toInt();
cur+=16;
+ issyncing=true; //don't let the change cause a refresh
settings->setValue(DPREFIX+"IconSize",cur);
+ settings->sync();
+ QTimer::singleShot(200, this, SLOT(UnlockSettings()) );
bgDesktop->SetIconSize(cur);
}
@@ -382,7 +385,10 @@ void LDesktop::DecreaseDesktopPluginIcons(){
int cur = settings->value(DPREFIX+"IconSize",64).toInt();
if(cur<32){ return; } //cannot get smaller than 16x16
cur-=16;
+ issyncing=true; //don't let the change cause a refresh
settings->setValue(DPREFIX+"IconSize",cur);
+ settings->sync();
+ QTimer::singleShot(200, this, SLOT(UnlockSettings()) );
bgDesktop->SetIconSize(cur);
}
diff --git a/lumina-desktop/LDesktopPluginSpace.cpp b/lumina-desktop/LDesktopPluginSpace.cpp
index 5668843a..3b1c97ba 100644
--- a/lumina-desktop/LDesktopPluginSpace.cpp
+++ b/lumina-desktop/LDesktopPluginSpace.cpp
@@ -73,7 +73,7 @@ QSize LDesktopPluginSpace::calculateItemSize(int icosize){
QSize sz;
sz.setWidth(1.8*icosize);
sz.setWidth( RoundUp(sz.width()/GRIDSIZE)); //always round up to cell numbers
- sz.setHeight(icosize+ 2.1*this->fontMetrics().height() );
+ sz.setHeight(icosize+ 2.3*this->fontMetrics().height() );
sz.setHeight( RoundUp(sz.height()/GRIDSIZE)); //always round up to cell number
return sz;
}
@@ -98,7 +98,7 @@ void LDesktopPluginSpace::addDesktopPlugin(QString plugID){
geom.moveTo( findOpenSpot(geom.width(), geom.height()) );
}else if(!ValidGeometry(plugID, gridToGeom(geom)) ){
//Find a new location for the plugin (saved location is invalid)
- QPoint pt = findOpenSpot(geom.width(), geom.height(), geom.y()-2, geom.x()-2); //try to get it within the same general area
+ QPoint pt = findOpenSpot(geom.width(), geom.height(), geom.y()-1, geom.x()-1); //try to get it within the same general area
geom.moveTo(pt);
}
if(geom.x() < 0 || geom.y() < 0){
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index f2fd2206..e1f55771 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -57,12 +57,12 @@ void AppLauncherPlugin::loadButton(){
XDGDesktop file = LXDG::loadDesktopFile(path, ok);
if(path.isEmpty() || !QFile::exists(path) || !ok){
button->setWhatsThis("");
- button->setIcon( LXDG::findIcon("quickopen-file","") );
+ button->setIcon( QIcon(LXDG::findIcon("quickopen-file","").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
txt = tr("Click to Set");
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
}else{
button->setWhatsThis(file.filePath);
- button->setIcon( LXDG::findIcon(file.icon,"quickopen") );
+ button->setIcon( QIcon(LXDG::findIcon(file.icon,"quickopen").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
txt = file.name;
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
watcher->addPath(file.filePath); //make sure to update this shortcut if the file changes
@@ -75,7 +75,7 @@ void AppLauncherPlugin::loadButton(){
}else if(LUtils::imageExtensions().contains(info.suffix().toLower()) ){
button->setIcon( QIcon(QPixmap(path).scaled(256,256)) ); //max size for thumbnails in memory
}else{
- button->setIcon( LXDG::findMimeIcon(path) );
+ button->setIcon( QIcon(LXDG::findMimeIcon(path).pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
}
txt = info.fileName();
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
@@ -83,18 +83,20 @@ void AppLauncherPlugin::loadButton(){
}else{
//InValid File
button->setWhatsThis("");
- button->setIcon( LXDG::findIcon("quickopen","") );
+ button->setIcon( QIcon(LXDG::findIcon("quickopen","").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
button->setText( tr("Click to Set") );
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
}
//Now adjust the visible text as necessary based on font/grid sizing
button->setToolTip(txt);
//Double check that the visual icon size matches the requested size - otherwise upscale the icon
- if(button->icon().actualSize(button->iconSize()) != button->iconSize()){
+ /*if(button->icon().actualSize(QSize(icosize,icosize)).height() < icosize){
+ qDebug() << "Scale Up Icon:" << button->iconSize() << icosize << button->icon().actualSize(QSize(icosize,icosize));
QIcon ico = button->icon();
- ico.addPixmap( ico.pixmap(button->iconSize()).scaled(button->iconSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
+ ico.addPixmap( ico.pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) );
+ qDebug() << " - New Icon Size:" << ico.actualSize(QSize(icosize,icosize));
button->setIcon(ico);
- }
+ }*/
//int icosize = this->readSetting("iconsize",64).toInt();
//int bwid = qRound(1.1*icosize);
//this->setFixedSize(bwid, icosize+qRound(2.5*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
index d6e75fec..a0f6a7cd 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
@@ -53,7 +53,7 @@ public slots:
protected:
void resizeEvent(QResizeEvent *ev){
LDPlugin::resizeEvent(ev);
- QTimer::singleShot(10, this, SLOT(loadButton()) );
+ QTimer::singleShot(100, this, SLOT(loadButton()) );
}
};
#endif
bgstack15