Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
plasmoid-quickaccess
quickaccess.cpp.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File quickaccess.cpp.diff of Package plasmoid-quickaccess
--- quickaccess.cpp 2009-05-27 21:02:59.000000000 +0200 +++ quickaccess.cpp 2010-09-11 06:47:36.000000000 +0200 @@ -33,6 +33,7 @@ #include <KConfigDialog> #include <konq_operations.h> #include <KMessageBox> +#include <KGlobalSettings> //Plasma #include <Plasma/ToolTipManager> @@ -84,7 +85,7 @@ connect(m_icon, SIGNAL(clicked()), this, SLOT(slot_iconClicked())); layout->addItem(m_icon); - + Plasma::ToolTipManager::self()->registerWidget(this); //read the config @@ -101,6 +102,9 @@ setAspectRatioMode(Plasma::ConstrainedSquare); connect(m_saveTimer, SIGNAL(timeout()), this, SLOT(saveSettings())); + + connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), + this, SLOT(iconSizeChanged(int))); } void QuickAccess::popupEvent(bool show) @@ -338,4 +342,34 @@ } } +QSizeF QuickAccess::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const +{ + if (which == Qt::PreferredSize) { + int iconSize; + + switch (formFactor()) { + case Plasma::Planar: + case Plasma::MediaCenter: + iconSize = IconSize(KIconLoader::Desktop); + break; + + case Plasma::Horizontal: + case Plasma::Vertical: + iconSize = IconSize(KIconLoader::Panel); + break; + } + + return QSizeF(iconSize, iconSize); + } + + return Plasma::Applet::sizeHint(which, constraint); +} + +void QuickAccess::iconSizeChanged(int group) +{ + if (group == KIconLoader::Desktop || group == KIconLoader::Panel) { + updateGeometry(); + } +} + #include "quickaccess.moc"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor