mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
kdeplasma-addons: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
cbc029d43c
commit
1c8b53127e
2 changed files with 37 additions and 41 deletions
|
@ -41,10 +41,6 @@ ShowDesktop::ShowDesktop(QObject *parent, const QVariantList &args)
|
|||
connect(&m_timer, SIGNAL(timeout()), this, SLOT(minimizeAll()));
|
||||
}
|
||||
|
||||
ShowDesktop::~ShowDesktop()
|
||||
{
|
||||
}
|
||||
|
||||
void ShowDesktop::init()
|
||||
{
|
||||
connect(this, SIGNAL(activate()), this, SLOT(minimizeAll()));
|
||||
|
@ -68,12 +64,17 @@ void ShowDesktop::init()
|
|||
|
||||
#ifndef MINIMIZE_ONLY
|
||||
if (m_wm2ShowingDesktop) {
|
||||
connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(reset()));
|
||||
connect(
|
||||
KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)),
|
||||
this, SLOT(reset())
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)),
|
||||
this, SLOT(iconSizeChanged(int)));
|
||||
connect(
|
||||
KGlobalSettings::self(), SIGNAL(iconChanged(int)),
|
||||
this, SLOT(iconSizeChanged(int))
|
||||
);
|
||||
}
|
||||
|
||||
void ShowDesktop::minimizeAll()
|
||||
|
@ -103,8 +104,8 @@ void ShowDesktop::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
|
|||
{
|
||||
m_timer.stop();
|
||||
}
|
||||
#ifndef MINIMIZE_ONLY
|
||||
|
||||
#ifndef MINIMIZE_ONLY
|
||||
void ShowDesktop::delay()
|
||||
{
|
||||
m_goingDown = false;
|
||||
|
@ -120,23 +121,21 @@ void ShowDesktop::reset()
|
|||
QSizeF ShowDesktop::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
|
||||
{
|
||||
if (which == Qt::PreferredSize) {
|
||||
int iconSize;
|
||||
|
||||
int iconSize = 0;
|
||||
switch (formFactor()) {
|
||||
case Plasma::Planar:
|
||||
case Plasma::MediaCenter:
|
||||
case Plasma::MediaCenter: {
|
||||
iconSize = IconSize(KIconLoader::Desktop);
|
||||
break;
|
||||
|
||||
}
|
||||
case Plasma::Horizontal:
|
||||
case Plasma::Vertical:
|
||||
case Plasma::Vertical: {
|
||||
iconSize = IconSize(KIconLoader::Panel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return QSizeF(iconSize, iconSize);
|
||||
}
|
||||
|
||||
return Plasma::Applet::sizeHint(which, constraint);
|
||||
}
|
||||
|
||||
|
@ -146,7 +145,6 @@ void ShowDesktop::iconSizeChanged(int group)
|
|||
updateGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // MINIMIZE_ONLY
|
||||
|
||||
#include "moc_showdesktop.cpp"
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SHOWDESKTOP_HEADER
|
||||
#define SHOWDESKTOP_HEADER
|
||||
#ifndef SHOWDESKTOP_H
|
||||
#define SHOWDESKTOP_H
|
||||
|
||||
//#define MINIMIZE_ONLY
|
||||
|
||||
|
@ -27,37 +27,35 @@
|
|||
class ShowDesktop : public Plasma::Applet
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ShowDesktop(QObject *parent, const QVariantList &args);
|
||||
~ShowDesktop();
|
||||
public:
|
||||
ShowDesktop(QObject *parent, const QVariantList &args);
|
||||
|
||||
virtual void init();
|
||||
void init() final;
|
||||
|
||||
public slots:
|
||||
void minimizeAll();
|
||||
public slots:
|
||||
void minimizeAll();
|
||||
#ifndef MINIMIZE_ONLY
|
||||
void reset();
|
||||
void delay();
|
||||
void reset();
|
||||
void delay();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
|
||||
|
||||
private slots:
|
||||
void iconSizeChanged(int group);
|
||||
|
||||
private:
|
||||
bool m_wm2ShowingDesktop;
|
||||
protected:
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
|
||||
|
||||
private slots:
|
||||
void iconSizeChanged(int group);
|
||||
|
||||
private:
|
||||
bool m_wm2ShowingDesktop;
|
||||
#ifndef MINIMIZE_ONLY
|
||||
bool m_down;
|
||||
bool m_goingDown;
|
||||
bool m_down;
|
||||
bool m_goingDown;
|
||||
#endif
|
||||
QTimer m_timer;
|
||||
QTimer m_timer;
|
||||
};
|
||||
|
||||
K_EXPORT_PLASMA_APPLET(showdesktop, ShowDesktop)
|
||||
|
||||
#endif
|
||||
#endif // SHOWDESKTOP_H
|
||||
|
|
Loading…
Add table
Reference in a new issue