From 26b7d59e2040d72980afed497fa99501ed98af85 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 7 Jan 2010 02:44:04 +0000 Subject: [PATCH 01/24] onwards and upwards svn path=/trunk/KDE/kdelibs/; revision=1070947 --- version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.h b/version.h index dfefb8b60..00d487e5f 100644 --- a/version.h +++ b/version.h @@ -28,12 +28,12 @@ * String version of libplasma version, suitable for use in * file formats or network protocols */ -#define PLASMA_VERSION_STRING "3.2.0" +#define PLASMA_VERSION_STRING "3.3.0" /// @brief Major version of libplasma, at compile time #define PLASMA_VERSION_MAJOR 3 /// @brief Minor version of libplasma, at compile time -#define PLASMA_VERSION_MINOR 2 +#define PLASMA_VERSION_MINOR 3 /// @brief Release version of libplasma, at compile time #define PLASMA_VERSION_RELEASE 0 From 291b11f8a2875654a23aed2e56450adfc6e93e9a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:44:20 +0000 Subject: [PATCH 02/24] -update geometry when the text changes -return a good size hint based on svg margins svn path=/trunk/KDE/kdelibs/; revision=1071052 --- widgets/toolbutton.cpp | 24 ++++++++++++++++++++---- widgets/toolbutton.h | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 86e2ec3d8..1e3ba12fa 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -170,6 +170,11 @@ ToolButton::ToolButton(QGraphicsWidget *parent) : QGraphicsProxyWidget(parent), d(new ToolButtonPrivate(this)) { + d->background = new FrameSvg(this); + d->background->setImagePath("widgets/button"); + d->background->setCacheAllRenderedFrames(true); + d->background->setElementPrefix("normal"); + QToolButton *native = new QToolButton; connect(native, SIGNAL(clicked()), this, SIGNAL(clicked())); connect(native, SIGNAL(pressed()), this, SIGNAL(pressed())); @@ -178,10 +183,6 @@ ToolButton::ToolButton(QGraphicsWidget *parent) native->setAttribute(Qt::WA_NoSystemBackground); native->setAutoRaise(true); - d->background = new FrameSvg(this); - d->background->setImagePath("widgets/button"); - d->background->setCacheAllRenderedFrames(true); - d->background->setElementPrefix("normal"); d->syncBorders(); setAcceptHoverEvents(true); connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(syncBorders())); @@ -215,6 +216,7 @@ bool ToolButton::autoRaise() const void ToolButton::setText(const QString &text) { static_cast(widget())->setText(text); + updateGeometry(); } QString ToolButton::text() const @@ -430,6 +432,20 @@ void ToolButton::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } +QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const +{ + QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + + //replace the native margin with the Svg one + QStyleOption option; + option.initFrom(nativeWidget()); + int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); + qreal left, top, right, bottom; + d->background->getMargins(left, top, right, bottom); + hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); + return hint; +} + } // namespace Plasma #include diff --git a/widgets/toolbutton.h b/widgets/toolbutton.h index 9a6a5d81d..0e1222589 100644 --- a/widgets/toolbutton.h +++ b/widgets/toolbutton.h @@ -172,6 +172,7 @@ protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void changeEvent(QEvent *event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const; private: Q_PRIVATE_SLOT(d, void syncBorders()) From a1d1b126241bb1f0894658990e6fd3d79f5c26e4 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:50:56 +0000 Subject: [PATCH 03/24] like toolbutton, base on the svg margins for the size hint svn path=/trunk/KDE/kdelibs/; revision=1071054 --- widgets/pushbutton.cpp | 19 +++++++++++++++++++ widgets/pushbutton.h | 1 + 2 files changed, 20 insertions(+) diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 3b9bfac5c..cd97e1d47 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -196,6 +196,7 @@ PushButton::~PushButton() void PushButton::setText(const QString &text) { static_cast(widget())->setText(text); + updateGeometry(); } QString PushButton::text() const @@ -509,6 +510,24 @@ void PushButton::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) QGraphicsProxyWidget::hoverLeaveEvent(event); } +QSizeF PushButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const +{ + QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + + if (hint.isEmpty()) { + return hint; + } + + //replace the native margin with the Svg one + QStyleOption option; + option.initFrom(nativeWidget()); + int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); + qreal left, top, right, bottom; + d->background->getMargins(left, top, right, bottom); + hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); + return hint; +} + } // namespace Plasma #include diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 214edb6d1..093e89849 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -217,6 +217,7 @@ protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void changeEvent(QEvent *event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const; private: Q_PRIVATE_SLOT(d, void syncBorders()) From 81e9c74cd330cbf0f60b838caae411ed61a13c87 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 12:53:54 +0000 Subject: [PATCH 04/24] don't change margins if the hint is empty svn path=/trunk/KDE/kdelibs/; revision=1071059 --- widgets/toolbutton.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 1e3ba12fa..b522eb937 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -436,6 +436,10 @@ QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); + if (hint.isEmpty()) { + return hint; + } + //replace the native margin with the Svg one QStyleOption option; option.initFrom(nativeWidget()); From 35d8587114be99a56c395f0c213bef2a0e7e3ab7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 19:21:57 +0000 Subject: [PATCH 05/24] the fact that the toolbutton is using qstyle for the label painting makes reimplementation of the size hint really problematic, just use the native one for now svn path=/trunk/KDE/kdelibs/; revision=1071247 --- widgets/toolbutton.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index b522eb937..e72884542 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -436,17 +436,6 @@ QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint); - if (hint.isEmpty()) { - return hint; - } - - //replace the native margin with the Svg one - QStyleOption option; - option.initFrom(nativeWidget()); - int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget()); - qreal left, top, right, bottom; - d->background->getMargins(left, top, right, bottom); - hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom); return hint; } From c1e947a76848107bc0d355a5b1014042ab383eab Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Jan 2010 21:58:51 +0000 Subject: [PATCH 06/24] when the icon is horizontal and there is no text take the min between width and height as icon size. among other things fixes the unhide arrow of the systray svn path=/trunk/KDE/kdelibs/; revision=1071365 --- widgets/iconwidget.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 98f8aba75..5abc579fd 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -546,9 +546,12 @@ void IconWidgetPrivate::layoutIcons(const QStyleOptionGraphicsItem *option) //if there is text resize the icon in order to make room for the text if (text.isEmpty() && infoText.isEmpty()) { // with no text, we just take up the whole geometry - iconWidth = currentSize.height() - - horizontalMargin[IconWidgetPrivate::IconMargin].left - - horizontalMargin[IconWidgetPrivate::IconMargin].right; + iconWidth = qMin(currentSize.height() - + horizontalMargin[IconWidgetPrivate::IconMargin].left - + horizontalMargin[IconWidgetPrivate::IconMargin].right, + currentSize.width() - + horizontalMargin[IconWidgetPrivate::IconMargin].left - + horizontalMargin[IconWidgetPrivate::IconMargin].right); } else { iconWidth = currentSize.height() - verticalMargin[IconWidgetPrivate::IconMargin].top - From d302d838d5de7fd51593e6e52acc7021392f843b Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 7 Jan 2010 22:13:43 +0000 Subject: [PATCH 07/24] SVN_SILENT: hush svn path=/trunk/KDE/kdelibs/; revision=1071383 --- private/internaltoolbox.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/private/internaltoolbox.cpp b/private/internaltoolbox.cpp index bbf750903..3055f0f39 100644 --- a/private/internaltoolbox.cpp +++ b/private/internaltoolbox.cpp @@ -228,10 +228,8 @@ bool InternalToolBox::isShowing() const void InternalToolBox::setShowing(const bool show) { if (show) { - kDebug() << "showing"; showToolBox(); } else { - kDebug() << "hiding"; hideToolBox(); } d->showing = show; From 4246f430ecaaaa0a18c88373d02cb904dd790b34 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 7 Jan 2010 22:14:19 +0000 Subject: [PATCH 08/24] fix positioning svn path=/trunk/KDE/kdelibs/; revision=1071385 --- private/desktoptoolbox.cpp | 44 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 1c2745e9a..1ff60130d 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -558,37 +558,37 @@ void DesktopToolBox::showToolBox() const int iconWidth = KIconLoader::SizeMedium; switch (corner()) { case TopRight: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().top() + 10; + x = (int)boundingRect().left() - d->toolBacker->size().width(); + y = (int)boundingRect().top(); break; case Top: - x = (int)boundingRect().center().x() - iconWidth - (d->toolBacker->size().width() / 2); - y = (int)boundingRect().top() + iconWidth + 10; + x = (int)boundingRect().center().x() - (d->toolBacker->size().width() / 2); + y = (int)boundingRect().bottom(); break; case TopLeft: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().top() + 10; + x = (int)boundingRect().right(); + y = (int)boundingRect().top(); break; case Left: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().center().y() - iconWidth; + x = (int)boundingRect().left() + iconWidth; + y = (int)boundingRect().y(); break; case Right: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().center().y() - iconWidth; + x = (int)boundingRect().right() - iconWidth - d->toolBacker->size().width(); + y = (int)boundingRect().y(); break; case BottomLeft: - x = (int)boundingRect().left() + iconWidth + 5; - y = (int)boundingRect().bottom() - 5; + x = (int)boundingRect().left() + iconWidth; + y = (int)boundingRect().bottom(); break; case Bottom: - x = (int)boundingRect().center().x() - iconWidth - (d->toolBacker->size().width() / 2); - y = (int)boundingRect().bottom() - iconWidth - 5; + x = (int)boundingRect().center().x() - (d->toolBacker->size().width() / 2); + y = (int)boundingRect().top(); break; case BottomRight: default: - x = (int)boundingRect().right() - iconWidth - 5 - d->toolBacker->size().width(); - y = (int)boundingRect().bottom() - iconWidth - 5; + x = (int)boundingRect().right() - iconWidth - d->toolBacker->size().width(); + y = (int)boundingRect().top(); break; } @@ -611,19 +611,16 @@ void DesktopToolBox::showToolBox() QRectF backerRect = mapToParent(d->toolBacker->geometry()).boundingRect(); QSizeF parentSize = parentWidget()->size(); if (backerRect.x() < 5) { - d->toolBacker->setPos(5, y); + d->toolBacker->setPos(mapFromParent(QPointF(5, 0)).x(), y); } else if (backerRect.right() > parentSize.width() - 5) { - d->toolBacker->setPos(parentSize.width() - 5 - backerRect.width(), y); + d->toolBacker->setPos(mapFromParent(QPointF(parentSize.width() - 5 - backerRect.width(), 0)).x(), y); } if (backerRect.y() < 5) { - d->toolBacker->setPos(x, 5); + d->toolBacker->setPos(x, mapFromParent(QPointF(0, 5)).y()); } else if (backerRect.bottom() > parentSize.height() - 5) { - d->toolBacker->setPos(x, parentSize.height() - 5 - backerRect.height()); + d->toolBacker->setPos(x, mapFromParent(QPointF(0, parentSize.height() - 5 - backerRect.height())).y()); } - - // re-map our starting points back to our coordinate system - backerRect = mapFromParent(backerRect).boundingRect(); } d->toolBacker->setOpacity(0); @@ -658,7 +655,6 @@ void DesktopToolBox::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void DesktopToolBox::hideToolBox() { - Plasma::Animator *animdriver = Plasma::Animator::self(); foreach (QGraphicsItem *tool, tools()) { const int height = static_cast(tool->boundingRect().height()); if (isToolbar()) { From 30ec5b73bba72b191d5a6b8624b5338eb36d6874 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 02:02:43 +0000 Subject: [PATCH 09/24] if the Applet requests config() before being added to a containment, but is nested in another Applet, it should still use the nest-Applet's config. i doubt it is a fix for 218064, but this is at least accurate and may address comment #15. CCBUG:218064 svn path=/trunk/KDE/kdelibs/; revision=1071437 --- applet.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index 10af395fc..46bdd4c5c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2749,17 +2749,16 @@ KConfigGroup *AppletPrivate::mainConfigGroup() } else { KConfigGroup appletConfig; - if (Containment *c = q->containment()) { - Plasma::Applet *parentApplet = qobject_cast(q->parent()); - if (parentApplet && parentApplet != static_cast(c)) { - // this applet is nested inside another applet! use it's config - // as the parent group in the config - appletConfig = parentApplet->config(); - } else { - // applet directly in a Containment, as usual - appletConfig = c->config(); - } - + Containment *c = q->containment(); + Applet *parentApplet = qobject_cast(q->parent()); + if (parentApplet && parentApplet != static_cast(c)) { + // this applet is nested inside another applet! use it's config + // as the parent group in the config + appletConfig = parentApplet->config(); + appletConfig = KConfigGroup(&appletConfig, "Applets"); + } else if (c) { + // applet directly in a Containment, as usual + appletConfig = c->config(); appletConfig = KConfigGroup(&appletConfig, "Applets"); } else { kWarning() << "requesting config for" << q->name() << "without a containment!"; From c856db301c5efb54e2bed5d43c8841c06da95f81 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 02:11:58 +0000 Subject: [PATCH 10/24] only do the work if the file exists svn path=/trunk/KDE/kdelibs/; revision=1071440 --- applet.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/applet.cpp b/applet.cpp index 46bdd4c5c..70b4e5c83 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2772,12 +2772,14 @@ KConfigGroup *AppletPrivate::mainConfigGroup() mainConfig = new KConfigGroup(&appletConfig, QString::number(appletId)); } - if (newGroup && q->package()) { + if (newGroup && package) { //see if we have a default configuration in our package - kDebug() << "copying default config: " << q->package()->filePath("defaultconfig"); - KConfigGroup defaultConfig(KSharedConfig::openConfig(q->package()->filePath("config", - "default-configrc"))->group("Configuration")); - defaultConfig.copyTo(mainConfig); + const QString defaultConfigFile = q->package()->filePath("defaultconfig"); + if (!defaultConfigFile.isEmpty()) { + kDebug() << "copying default config: " << q->package()->filePath("defaultconfig"); + KConfigGroup defaultConfig(KSharedConfig::openConfig(defaultConfigFile)->group("Configuration")); + defaultConfig.copyTo(mainConfig); + } } return mainConfig; From e52aebe20ebd136b871bec5373720ae32052916f Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 02:13:52 +0000 Subject: [PATCH 11/24] don't both with checking if it's a new group unless we have a package svn path=/trunk/KDE/kdelibs/; revision=1071441 --- applet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applet.cpp b/applet.cpp index 70b4e5c83..70214fc1f 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2741,7 +2741,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup() containmentConfig = KConfigGroup(KGlobal::config(), "Containments"); } - if (!containmentConfig.hasGroup(QString::number(appletId))) { + if (package && !containmentConfig.hasGroup(QString::number(appletId))) { newGroup = true; } @@ -2765,14 +2765,14 @@ KConfigGroup *AppletPrivate::mainConfigGroup() appletConfig = KConfigGroup(KGlobal::config(), "Applets"); } - if (!appletConfig.hasGroup(QString::number(appletId))) { + if (package && !appletConfig.hasGroup(QString::number(appletId))) { newGroup = true; } mainConfig = new KConfigGroup(&appletConfig, QString::number(appletId)); } - if (newGroup && package) { + if (newGroup) { //see if we have a default configuration in our package const QString defaultConfigFile = q->package()->filePath("defaultconfig"); if (!defaultConfigFile.isEmpty()) { From e23b884920995ec693d9a49e519ed5cca96e8273 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 05:07:00 +0000 Subject: [PATCH 12/24] some diagnostic debug for Jon svn path=/trunk/KDE/kdelibs/; revision=1071451 --- applet.cpp | 3 +++ popupapplet.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/applet.cpp b/applet.cpp index 70214fc1f..425d87b50 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2751,6 +2751,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup() Containment *c = q->containment(); Applet *parentApplet = qobject_cast(q->parent()); + kDebug() << "going to make the appletConfig" << parentApplet << c; if (parentApplet && parentApplet != static_cast(c)) { // this applet is nested inside another applet! use it's config // as the parent group in the config @@ -2769,7 +2770,9 @@ KConfigGroup *AppletPrivate::mainConfigGroup() newGroup = true; } + kDebug() << "appletConfig is" << (appletConfig.isValid() ? "valid" : "not valid"); mainConfig = new KConfigGroup(&appletConfig, QString::number(appletId)); + kDebug() << "mainConfig is" << (mainConfig->isValid() ? "valid" : "not valid"); } if (newGroup) { diff --git a/popupapplet.cpp b/popupapplet.cpp index 5d9322c03..aae19b9ad 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -702,6 +702,7 @@ void PopupAppletPrivate::updateDialogPosition() preferredHeight = dialog->graphicsWidget()->preferredSize().height(); } + kDebug() << "about to use sizeGroup which is" << (sizeGroup.isValid() ? "valid" : "not valid"); const int width = qMin(sizeGroup.readEntry("DialogWidth", preferredWidth), corona->screenGeometry(-1).width() - 50); const int height = qMin(sizeGroup.readEntry("DialogHeight", preferredHeight), From ae239eed3fff04216e8c967f236ddc4463ba5391 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 21:58:04 +0000 Subject: [PATCH 13/24] it is possible to not be on the scene yet svn path=/trunk/KDE/kdelibs/; revision=1071841 --- popupapplet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/popupapplet.cpp b/popupapplet.cpp index aae19b9ad..e6e43d2e6 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -690,10 +690,13 @@ void PopupAppletPrivate::updateDialogPosition() return; } - KConfigGroup sizeGroup = popupConfigGroup(); Corona *corona = qobject_cast(q->scene()); - Q_ASSERT(corona); + if (!corona) { + return; + } + + KConfigGroup sizeGroup = popupConfigGroup(); int preferredWidth = 0; int preferredHeight = 0; From 9685752853b86fc83c9ff89f375ea55779f79f6d Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 8 Jan 2010 22:12:35 +0000 Subject: [PATCH 14/24] debug no longer needed, problem solved. svn path=/trunk/KDE/kdelibs/; revision=1071845 --- applet.cpp | 3 --- popupapplet.cpp | 1 - 2 files changed, 4 deletions(-) diff --git a/applet.cpp b/applet.cpp index 425d87b50..70214fc1f 100644 --- a/applet.cpp +++ b/applet.cpp @@ -2751,7 +2751,6 @@ KConfigGroup *AppletPrivate::mainConfigGroup() Containment *c = q->containment(); Applet *parentApplet = qobject_cast(q->parent()); - kDebug() << "going to make the appletConfig" << parentApplet << c; if (parentApplet && parentApplet != static_cast(c)) { // this applet is nested inside another applet! use it's config // as the parent group in the config @@ -2770,9 +2769,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup() newGroup = true; } - kDebug() << "appletConfig is" << (appletConfig.isValid() ? "valid" : "not valid"); mainConfig = new KConfigGroup(&appletConfig, QString::number(appletId)); - kDebug() << "mainConfig is" << (mainConfig->isValid() ? "valid" : "not valid"); } if (newGroup) { diff --git a/popupapplet.cpp b/popupapplet.cpp index e6e43d2e6..7af4ed52a 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -705,7 +705,6 @@ void PopupAppletPrivate::updateDialogPosition() preferredHeight = dialog->graphicsWidget()->preferredSize().height(); } - kDebug() << "about to use sizeGroup which is" << (sizeGroup.isValid() ? "valid" : "not valid"); const int width = qMin(sizeGroup.readEntry("DialogWidth", preferredWidth), corona->screenGeometry(-1).width() - 50); const int height = qMin(sizeGroup.readEntry("DialogHeight", preferredHeight), From 8f19e5f9cb012579881f632304bca683d41d1117 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 8 Jan 2010 23:36:43 +0000 Subject: [PATCH 15/24] don't reposition over and over again svn path=/trunk/KDE/kdelibs/; revision=1071890 --- private/internaltoolbox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/private/internaltoolbox.cpp b/private/internaltoolbox.cpp index 3055f0f39..35666bee7 100644 --- a/private/internaltoolbox.cpp +++ b/private/internaltoolbox.cpp @@ -409,6 +409,12 @@ InternalToolBox::Corner InternalToolBox::corner() const void InternalToolBox::setViewTransform(const QTransform &transform) { + if (d->viewTransform == transform) { + return; + } + + d->viewTransform = transform; + if (transform.isScaling()) { d->toolbar = true; showToolBox(); @@ -418,7 +424,6 @@ void InternalToolBox::setViewTransform(const QTransform &transform) hideToolBox(); } } - d->viewTransform = transform; } void InternalToolBox::save(KConfigGroup &cg) const From d9a0865c3bdcb71744c84c373ab3e1e2e21bb871 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 9 Jan 2010 13:41:54 +0000 Subject: [PATCH 16/24] fix the toolbox positioning when zoomed out svn path=/trunk/KDE/kdelibs/; revision=1072152 --- private/desktoptoolbox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/private/desktoptoolbox.cpp b/private/desktoptoolbox.cpp index 1ff60130d..02315dd0f 100644 --- a/private/desktoptoolbox.cpp +++ b/private/desktoptoolbox.cpp @@ -597,13 +597,12 @@ void DesktopToolBox::showToolBox() //could that cast ever fail? if (d->containment) { - topRight = viewTransform().map(mapFromParent(d->containment->boundingRect().bottomRight())); + topRight = d->containment->geometry().bottomRight(); } else { topRight = boundingRect().topRight(); } - - d->toolBacker->setPos(topRight.x() - d->toolBacker->size().width(), topRight.y()); + d->toolBacker->setPos(viewTransform().map(mapFromScene(topRight))-QPoint(d->toolBacker->size().width(), 0)); } else { //kDebug() << "starting at" << x << startY; d->toolBacker->setPos(x, y); From 1aac8cb29397a844f87bbaf294cb6711b4b3ce42 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 9 Jan 2010 17:30:40 +0000 Subject: [PATCH 17/24] set the proper values for the 3d vector svn path=/trunk/KDE/kdelibs/; revision=1072233 --- animations/rotation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/animations/rotation.cpp b/animations/rotation.cpp index 797e6ae86..99430e47a 100644 --- a/animations/rotation.cpp +++ b/animations/rotation.cpp @@ -89,12 +89,15 @@ void RotationAnimation::updateState(QAbstractAnimation::State newState, QAbstrac if (axis() == Qt::XAxis) { switch (reference()) { case Center: + vector.setX(widgetWidth/2); vector.setY(widgetHeight/2); break; case Up: + vector.setX(widgetWidth/2); vector.setY(0); break; case Down: + vector.setX(widgetWidth/2); vector.setY(widgetHeight); break; } @@ -103,12 +106,15 @@ void RotationAnimation::updateState(QAbstractAnimation::State newState, QAbstrac switch (reference()) { case Center: vector.setX(widgetWidth/2); + vector.setY(widgetHeight/2); break; case Left: vector.setX(0); + vector.setY(widgetHeight/2); break; case Right: vector.setX(widgetWidth); + vector.setY(widgetHeight/2); break; } From 8ee524d172efc1dcf6da439079d4e3c64026b9b9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sun, 10 Jan 2010 19:34:33 +0000 Subject: [PATCH 18/24] IconAction refuses to display and to be activated if the underlying QAction is invisible or disabled svn path=/trunk/KDE/kdelibs/; revision=1072708 --- widgets/iconwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 5abc579fd..5098f1432 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -225,6 +225,10 @@ void IconAction::rebuildPixmap() bool IconAction::event(QEvent::Type type, const QPointF &pos) { + if (!m_action->isVisible() || !m_action->isEnabled()) { + return false; + } + if (m_icon->size().width() < m_rect.width() * 2.0 || m_icon->size().height() < m_rect.height() * 2.0) { return false; @@ -289,6 +293,10 @@ QAction *IconAction::action() const void IconAction::paint(QPainter *painter) const { + if (!m_action->isVisible() || !m_action->isEnabled()) { + return; + } + if (m_icon->size().width() < m_rect.width() * 2.0 || m_icon->size().height() < m_rect.height() * 2.0) { return; From a51ab88ce0c8d49e5faabf6a5c5126c2ace4f93c Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Mon, 11 Jan 2010 17:26:36 +0000 Subject: [PATCH 19/24] Add support to custom animations svn path=/trunk/KDE/kdelibs/; revision=1073131 --- CMakeLists.txt | 1 + animations/customanimation.cpp | 114 +++++++++++++++++++++++++++++++++ animations/customanimation_p.h | 65 +++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 animations/customanimation.cpp create mode 100644 animations/customanimation_p.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 722938df8..8308cfd24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ set(plasma_LIB_SRCS animations/stackedlayout.cpp animations/geometry.cpp animations/zoom.cpp + animations/customanimation.cpp applet.cpp configloader.cpp containment.cpp diff --git a/animations/customanimation.cpp b/animations/customanimation.cpp new file mode 100644 index 000000000..80f20c408 --- /dev/null +++ b/animations/customanimation.cpp @@ -0,0 +1,114 @@ +///////////////////////////////////////////////////////////////////////// +// customanimation.cpp // +// // +// Copyright (C) 2010 Igor Oliveira // +// Copyright (C) 2010 Adenilson Cavalcanti + +namespace Plasma +{ + +CustomAnimation::CustomAnimation(QObject *parent) + : Animation(parent) +{ +} + +QString CustomAnimation::callback() const +{ + return m_method; +} + +void CustomAnimation::setCallback(const QString &slot) +{ + m_method = slot; +} + +QVariant CustomAnimation::startValue() const +{ + return m_startValue; +} + +void CustomAnimation::setStartValue(const QVariant &value) +{ + m_startValue = value; +} + +QVariant CustomAnimation::endValue() const +{ + return m_endValue; +} + +void CustomAnimation::setEndValue(const QVariant &value) +{ + m_endValue = value; +} + +void CustomAnimation::updateCurrentTime(int currentTime) +{ + QGraphicsWidget *obj = targetWidget(); + if (obj) { + qreal delta = currentTime / qreal(duration()); + delta = Animation::easingCurve().valueForProgress(delta); + + const QVariant retValue = interpolate(startValue(), endValue(), delta); + QMetaObject::invokeMethod(obj, m_method.toUtf8().data(), Q_ARG(QVariant, retValue)); + } + + Animation::updateCurrentTime(currentTime); +} + +QVariant CustomAnimation::interpolate(const QVariant &start, const QVariant &end, qreal delta) +{ + QVariant retValue; + + if (start.type() != end.type()) { + return retValue; + } + + if (start.type() == QVariant::Double) { + qreal realStartValue = start.toReal(); + qreal realEndValue = end.toReal(); + + qreal retRealValue = (realStartValue - realEndValue) * delta; + + retValue = QVariant(retRealValue); + } else if (start.type() == QVariant::Int) { + int intStartValue = start.toInt(); + int intEndValue = end.toInt(); + + int retIntValue = (intStartValue - intEndValue) * delta; + retValue = QVariant(retIntValue); + } else if (start.type() == QVariant::RectF) { + QRectF rectfStartValue = start.toRectF(); + QRectF rectfEndValue = end.toRectF(); + + QRectF retRectfValue = QRectF((rectfStartValue.x() - rectfEndValue.x()) * delta, + (rectfStartValue.y() - rectfEndValue.x()) * delta, + (rectfStartValue.width() - rectfEndValue.width()) * delta, + (rectfStartValue.height() - rectfEndValue.height()) * delta); + retValue = QVariant(retRectfValue); + } + + return retValue; +} + +} diff --git a/animations/customanimation_p.h b/animations/customanimation_p.h new file mode 100644 index 000000000..3ceb07c7f --- /dev/null +++ b/animations/customanimation_p.h @@ -0,0 +1,65 @@ +/*********************************************************************/ +/* */ +/* Copyright (C) 2010 Igor Oliveira */ +/* Copyright (C) 2010 Adenilson Cavalcanti */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ +/* 02110-1301, USA. */ +/*********************************************************************/ + +#ifndef PLASMA_ANIMATIONS_CUSTOMANIMATION_H +#define PLASMA_ANIMATIONS_CUSTOMANIMATION_H + +#include +#include + +class QString; + +namespace Plasma +{ + +class CustomAnimation : public Animation +{ + Q_OBJECT + Q_PROPERTY(QString callback READ callback WRITE setCallback) + Q_PROPERTY(QVariant startValue READ startValue WRITE setStartValue) + Q_PROPERTY(QVariant endValue READ endValue WRITE setEndValue) + +public: + CustomAnimation(QObject *parent); + + QString callback() const; + void setCallback(const QString &method); + + QVariant startValue() const; + void setStartValue(const QVariant &value); + + QVariant endValue() const; + void setEndValue(const QVariant &value); + +protected: + void updateCurrentTime(int currentTime); + +private: + QVariant interpolate(const QVariant &start, const QVariant &end, qreal delta); + +private: + QString m_method; + QVariant m_startValue; + QVariant m_endValue; +}; +} + +#endif From 196172bc191019c64148e86f27c01be43752051d Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Mon, 11 Jan 2010 17:53:35 +0000 Subject: [PATCH 20/24] add custom animation in animator factory svn path=/trunk/KDE/kdelibs/; revision=1073140 --- animations/customanimation_p.h | 2 +- animator.cpp | 6 ++++++ animator.h | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/animations/customanimation_p.h b/animations/customanimation_p.h index 3ceb07c7f..f3292b967 100644 --- a/animations/customanimation_p.h +++ b/animations/customanimation_p.h @@ -38,7 +38,7 @@ class CustomAnimation : public Animation Q_PROPERTY(QVariant endValue READ endValue WRITE setEndValue) public: - CustomAnimation(QObject *parent); + CustomAnimation(QObject *parent = 0); QString callback() const; void setCallback(const QString &method); diff --git a/animator.cpp b/animator.cpp index f2f5ef608..ea0c38741 100644 --- a/animator.cpp +++ b/animator.cpp @@ -29,6 +29,8 @@ #include "animations/rotationstacked_p.h" #include "animations/geometry_p.h" #include "animations/zoom_p.h" +#include "animations/woobly_p.h" +#include "animations/customanimation_p.h" namespace Plasma { @@ -70,6 +72,10 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent) result = new Plasma::ZoomAnimation(parent); break; + case CustomAnimation: + result = new Plasma::CustomAnimation(parent); + break; + default: kDebug() << "Unsupported animation type."; } diff --git a/animator.h b/animator.h index ca9fd922d..15ae0e8a3 100644 --- a/animator.h +++ b/animator.h @@ -65,7 +65,8 @@ public: RotationStackedAnimation, /*<< for flipping one object with another */ SlideAnimation, /*<< Move the position of animated object */ GeometryAnimation, /*<< Geometry animation*/ - ZoomAnimation /*< Date: Mon, 11 Jan 2010 18:24:44 +0000 Subject: [PATCH 21/24] build svn path=/trunk/KDE/kdelibs/; revision=1073148 --- animator.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/animator.cpp b/animator.cpp index ea0c38741..a1ad3a10f 100644 --- a/animator.cpp +++ b/animator.cpp @@ -29,7 +29,6 @@ #include "animations/rotationstacked_p.h" #include "animations/geometry_p.h" #include "animations/zoom_p.h" -#include "animations/woobly_p.h" #include "animations/customanimation_p.h" namespace Plasma From e2cf011103fb74502995b7a41a7151be2c8f4249 Mon Sep 17 00:00:00 2001 From: Igor Trindade Oliveira Date: Mon, 11 Jan 2010 20:06:14 +0000 Subject: [PATCH 22/24] plasma animations: removing custom animation. the animations done by custom can be done adding a property and using qpropertyanimation svn path=/trunk/KDE/kdelibs/; revision=1073191 --- CMakeLists.txt | 1 - animations/customanimation.cpp | 114 --------------------------------- animations/customanimation_p.h | 65 ------------------- animator.cpp | 5 -- animator.h | 3 +- 5 files changed, 1 insertion(+), 187 deletions(-) delete mode 100644 animations/customanimation.cpp delete mode 100644 animations/customanimation_p.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8308cfd24..722938df8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,6 @@ set(plasma_LIB_SRCS animations/stackedlayout.cpp animations/geometry.cpp animations/zoom.cpp - animations/customanimation.cpp applet.cpp configloader.cpp containment.cpp diff --git a/animations/customanimation.cpp b/animations/customanimation.cpp deleted file mode 100644 index 80f20c408..000000000 --- a/animations/customanimation.cpp +++ /dev/null @@ -1,114 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// customanimation.cpp // -// // -// Copyright (C) 2010 Igor Oliveira // -// Copyright (C) 2010 Adenilson Cavalcanti - -namespace Plasma -{ - -CustomAnimation::CustomAnimation(QObject *parent) - : Animation(parent) -{ -} - -QString CustomAnimation::callback() const -{ - return m_method; -} - -void CustomAnimation::setCallback(const QString &slot) -{ - m_method = slot; -} - -QVariant CustomAnimation::startValue() const -{ - return m_startValue; -} - -void CustomAnimation::setStartValue(const QVariant &value) -{ - m_startValue = value; -} - -QVariant CustomAnimation::endValue() const -{ - return m_endValue; -} - -void CustomAnimation::setEndValue(const QVariant &value) -{ - m_endValue = value; -} - -void CustomAnimation::updateCurrentTime(int currentTime) -{ - QGraphicsWidget *obj = targetWidget(); - if (obj) { - qreal delta = currentTime / qreal(duration()); - delta = Animation::easingCurve().valueForProgress(delta); - - const QVariant retValue = interpolate(startValue(), endValue(), delta); - QMetaObject::invokeMethod(obj, m_method.toUtf8().data(), Q_ARG(QVariant, retValue)); - } - - Animation::updateCurrentTime(currentTime); -} - -QVariant CustomAnimation::interpolate(const QVariant &start, const QVariant &end, qreal delta) -{ - QVariant retValue; - - if (start.type() != end.type()) { - return retValue; - } - - if (start.type() == QVariant::Double) { - qreal realStartValue = start.toReal(); - qreal realEndValue = end.toReal(); - - qreal retRealValue = (realStartValue - realEndValue) * delta; - - retValue = QVariant(retRealValue); - } else if (start.type() == QVariant::Int) { - int intStartValue = start.toInt(); - int intEndValue = end.toInt(); - - int retIntValue = (intStartValue - intEndValue) * delta; - retValue = QVariant(retIntValue); - } else if (start.type() == QVariant::RectF) { - QRectF rectfStartValue = start.toRectF(); - QRectF rectfEndValue = end.toRectF(); - - QRectF retRectfValue = QRectF((rectfStartValue.x() - rectfEndValue.x()) * delta, - (rectfStartValue.y() - rectfEndValue.x()) * delta, - (rectfStartValue.width() - rectfEndValue.width()) * delta, - (rectfStartValue.height() - rectfEndValue.height()) * delta); - retValue = QVariant(retRectfValue); - } - - return retValue; -} - -} diff --git a/animations/customanimation_p.h b/animations/customanimation_p.h deleted file mode 100644 index f3292b967..000000000 --- a/animations/customanimation_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/*********************************************************************/ -/* */ -/* Copyright (C) 2010 Igor Oliveira */ -/* Copyright (C) 2010 Adenilson Cavalcanti */ -/* */ -/* This program is free software; you can redistribute it and/or */ -/* modify it under the terms of the GNU General Public License */ -/* as published by the Free Software Foundation; either version 2 */ -/* of the License, or (at your option) any later version. */ -/* */ -/* This program is distributed in the hope that it will be useful, */ -/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* GNU General Public License for more details. */ -/* */ -/* You should have received a copy of the GNU General Public License */ -/* along with this program; if not, write to the Free Software */ -/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ -/* 02110-1301, USA. */ -/*********************************************************************/ - -#ifndef PLASMA_ANIMATIONS_CUSTOMANIMATION_H -#define PLASMA_ANIMATIONS_CUSTOMANIMATION_H - -#include -#include - -class QString; - -namespace Plasma -{ - -class CustomAnimation : public Animation -{ - Q_OBJECT - Q_PROPERTY(QString callback READ callback WRITE setCallback) - Q_PROPERTY(QVariant startValue READ startValue WRITE setStartValue) - Q_PROPERTY(QVariant endValue READ endValue WRITE setEndValue) - -public: - CustomAnimation(QObject *parent = 0); - - QString callback() const; - void setCallback(const QString &method); - - QVariant startValue() const; - void setStartValue(const QVariant &value); - - QVariant endValue() const; - void setEndValue(const QVariant &value); - -protected: - void updateCurrentTime(int currentTime); - -private: - QVariant interpolate(const QVariant &start, const QVariant &end, qreal delta); - -private: - QString m_method; - QVariant m_startValue; - QVariant m_endValue; -}; -} - -#endif diff --git a/animator.cpp b/animator.cpp index a1ad3a10f..f2f5ef608 100644 --- a/animator.cpp +++ b/animator.cpp @@ -29,7 +29,6 @@ #include "animations/rotationstacked_p.h" #include "animations/geometry_p.h" #include "animations/zoom_p.h" -#include "animations/customanimation_p.h" namespace Plasma { @@ -71,10 +70,6 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent) result = new Plasma::ZoomAnimation(parent); break; - case CustomAnimation: - result = new Plasma::CustomAnimation(parent); - break; - default: kDebug() << "Unsupported animation type."; } diff --git a/animator.h b/animator.h index 15ae0e8a3..ca9fd922d 100644 --- a/animator.h +++ b/animator.h @@ -65,8 +65,7 @@ public: RotationStackedAnimation, /*<< for flipping one object with another */ SlideAnimation, /*<< Move the position of animated object */ GeometryAnimation, /*<< Geometry animation*/ - ZoomAnimation, /*< Date: Mon, 11 Jan 2010 20:08:03 +0000 Subject: [PATCH 23/24] be more careful with setting the id when the data is set svn path=/trunk/KDE/kdelibs/; revision=1073192 --- querymatch.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/querymatch.cpp b/querymatch.cpp index e23fdc1dc..cea0ecfb7 100644 --- a/querymatch.cpp +++ b/querymatch.cpp @@ -40,9 +40,10 @@ class QueryMatchPrivate : public QSharedData : QSharedData(), runner(r), type(QueryMatch::ExactMatch), - enabled(true), relevance(.7), - selAction(0) + selAction(0), + enabled(true), + idSetByData(false) { } @@ -53,9 +54,10 @@ class QueryMatchPrivate : public QSharedData QString subtext; QIcon icon; QVariant data; - bool enabled; qreal relevance; QAction *selAction; + bool enabled : 1; + bool idSetByData : 1; }; QueryMatch::QueryMatch(AbstractRunner *runner) @@ -125,7 +127,14 @@ void QueryMatch::setSubtext(const QString &subtext) void QueryMatch::setData(const QVariant & data) { d->data = data; - setId(data.toString()); + + if (d->id.isEmpty() || d->idSetByData) { + const QString id = data.toString(); + if (!id.isEmpty()) { + setId(data.toString()); + d->idSetByData = true; + } + } } void QueryMatch::setId(const QString &id) @@ -137,6 +146,8 @@ void QueryMatch::setId(const QString &id) if (!id.isEmpty()) { d->id.append('_').append(id); } + + d->idSetByData = false; } void QueryMatch::setIcon(const QIcon &icon) From 4e7fa2f85246d692794232532a836d32d2e486f8 Mon Sep 17 00:00:00 2001 From: Davide Bettio Date: Mon, 11 Jan 2010 22:43:19 +0000 Subject: [PATCH 24/24] Replaced default wallpaper. svn path=/trunk/KDE/kdelibs/; revision=1073285 --- theme.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme.cpp b/theme.cpp index 44adfee8c..cb8620088 100644 --- a/theme.cpp +++ b/theme.cpp @@ -47,8 +47,8 @@ namespace Plasma { -#define DEFAULT_WALLPAPER_THEME "Quadros" -#define DEFAULT_WALLPAPER_SUFFIX ".jpg" +#define DEFAULT_WALLPAPER_THEME "Ethais" +#define DEFAULT_WALLPAPER_SUFFIX ".png" static const int DEFAULT_WALLPAPER_WIDTH = 1920; static const int DEFAULT_WALLPAPER_HEIGHT = 1200;