Change in plasma-framework[master]: Consider visualParent rotation in popupPosition

2015-04-02 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/438

Change subject: Consider visualParent rotation in popupPosition
..

Consider visualParent rotation in popupPosition

if there are transforms in the scene, to correctly compute the position the
transform is needed to be accounter for.
QQuickITem::mapRectToScene does consider tranforms.
this adresses bug 345787 where the toolbox may be rotated.

BUG:345787
Change-Id: I13a5509d95a7498382155abf3c3d195708de56a6
---
M src/plasmaquick/dialog.cpp
A tests/dialog_positioning_parentrotated.qml
2 files changed, 102 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/38/438/1

diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp
index cdf78eb..2166880 100644
--- a/src/plasmaquick/dialog.cpp
+++ b/src/plasmaquick/dialog.cpp
@@ -829,19 +829,23 @@
 if (outsideParentWindow) {
 parentGeometryBounds = item->window()->geometry();
 } else {
-parentGeometryBounds = QRect(pos.toPoint(), QSize(item->width(), 
item->height()));
+parentGeometryBounds = 
item->mapRectToScene(item->boundingRect()).toRect();
+if (item->window()) {
+
parentGeometryBounds.moveTopLeft(item->window()->mapToGlobal(parentGeometryBounds.topLeft()));
+pos = parentGeometryBounds.topLeft();
+}
 }
 
-const QPoint topPoint(pos.x() + (item->boundingRect().width() - 
size.width()) / 2,
+const QPoint topPoint(pos.x() + 
(item->mapRectToScene(item->boundingRect()).width() - size.width()) / 2,
   parentGeometryBounds.top() - size.height());
-const QPoint bottomPoint(pos.x() + (item->boundingRect().width() - 
size.width()) / 2,
+const QPoint bottomPoint(pos.x() + 
(item->mapRectToScene(item->boundingRect()).width() - size.width()) / 2,
  parentGeometryBounds.bottom());
 
 const QPoint leftPoint(parentGeometryBounds.left() - size.width(),
-   pos.y() + (item->boundingRect().height() - 
size.height()) / 2);
+   pos.y() + 
(item->mapRectToScene(item->boundingRect()).height() - size.height()) / 2);
 
 const QPoint rightPoint(parentGeometryBounds.right(),
-pos.y() + (item->boundingRect().height() - 
size.height()) / 2);
+pos.y() + 
(item->mapRectToScene(item->boundingRect()).height() - size.height()) / 2);
 
 QPoint dialogPos;
 if (d->location == Plasma::Types::TopEdge) {
diff --git a/tests/dialog_positioning_parentrotated.qml 
b/tests/dialog_positioning_parentrotated.qml
new file mode 100644
index 000..34e95c7
--- /dev/null
+++ b/tests/dialog_positioning_parentrotated.qml
@@ -0,0 +1,93 @@
+/*
+ *   Copyright 2014 Vishesh Handa 
+ *   Copyright 2015 Marco Martin 
+ *
+ *   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,
+ *   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 Library 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.
+ */
+
+import QtQuick 2.0
+
+import QtQuick.Controls 1.1 as Controls
+import QtQuick.Layouts 1.1
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.plasma.extras 2.0 as PlasmaExtras
+
+ColumnLayout
+{
+height: units.gridUnit * 20
+Controls.Label {
+id: label
+text: "Press the buttom and make sure the popup is on the correct 
place"
+wrapMode: Text.WordWrap
+}
+PlasmaComponents.Button {
+id: settingsButton
+iconSource: "configure"
+text: "Press Me"
+Layout.alignment: Qt.AlignHCenter
+rotation: 90
+
+onClicked: {
+contextMenu.visible = !contextMenu.visible;
+}
+}
+
+PlasmaCore.Dialog {
+id: contextMenu
+visualParent: settingsButton
+
+location: PlasmaCore.Types.BottomEdge
+type: PlasmaCore.Dialog.PopupMenu
+flags: Qt.Popup | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
+
+mainItem: ColumnLayout {
+id: menuColumn
+Layout.minimumWidth: menuColumn.implicitWidth
+Layout.minimumHeight: menuColumn.implicitHeight
+spacing: units.smallSpacing
+
+PlasmaExtras.Heading {
+lev

Change in plasma-framework[master]: support for C++ applets

2015-02-12 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/374

Change subject: support for C++ applets
..

support for C++ applets

make possible for an applet to be implemented in c++ but still
have the qml package with the usual api, this was supposed to
be supported from the beginning.

if a c++ applet has been loaded, make available the property
plasmoid.nativeInterface to the qml part, exposing the subclasses
Applet instance with all eventual extra propertiels/slots.

if no c++ plugin is present, appletInterface will be dummy/not available

this (besides limiting a bit the qml import rabbit procreation)
makes available some things not available to normal private imports:
* access to applet config() to save more complex things compared to what 
kconfigxt allows
  or save/load stuff from the c++ part
* access to containment()/corona(), may be useful for containment 
implementations
* easier port for old very big applets such as comics/weather

Change-Id: I65117660043de3a60ad58c77b086f686683d4d8c
---
M src/plasma/pluginloader.cpp
M src/scriptengines/qml/plasmoid/appletinterface.cpp
M src/scriptengines/qml/plasmoid/appletinterface.h
3 files changed, 26 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/74/374/1

diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp
index 48cd46c..7ecdd15 100644
--- a/src/plasma/pluginloader.cpp
+++ b/src/plasma/pluginloader.cpp
@@ -201,8 +201,8 @@
 
 QVariantList allArgs;
 allArgs << offer->storageId() << appletId << args;
-
-if (!offer->property("X-Plasma-API").toString().isEmpty()) {
+if (!offer->property("X-Plasma-API").toString().isEmpty() &&
+offer->property("Library").toString().isEmpty()) {
 #ifndef NDEBUG
 // qDebug() << "we have a script using the"
 // << offer->property("X-Plasma-API").toString() << "API";
diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp 
b/src/scriptengines/qml/plasmoid/appletinterface.cpp
index 0ec2c34..ab8056b 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.cpp
+++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp
@@ -63,6 +63,7 @@
   m_busy(false),
   m_hideOnDeactivate(true),
   m_oldKeyboardShortcut(0),
+  m_dummyNativeInterface(0),
   m_positionBeforeRemoval(QPointF(-1, -1))
 {
 qmlRegisterType();
@@ -118,7 +119,8 @@
   m_appletScriptEngine(0),
   m_backgroundHints(Plasma::Types::StandardBackground),
   m_busy(false),
-  m_hideOnDeactivate(true)
+  m_hideOnDeactivate(true),
+  m_dummyNativeInterface(0)
 {
 qmlRegisterType();
 
@@ -585,6 +587,19 @@
 applet()->setGlobalShortcut(sequence);
 }
 
+QObject *AppletInterface::nativeInterface()
+{
+if (applet()->metaObject()->className() != "Plasma::Applet") {
+return applet();
+} else {
+//This being CONSTANT is guaranteed to be called only once
+if (!m_dummyNativeInterface) {
+m_dummyNativeInterface = new QObject(this);
+}
+return m_dummyNativeInterface;
+}
+}
+
 QString AppletInterface::downloadPath(const QString &file)
 {
 const QString downloadDir = 
QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + "/Plasma/" 
+ applet()->pluginInfo().pluginName() + '/';
diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h 
b/src/scriptengines/qml/plasmoid/appletinterface.h
index 457f5df..32a72ee 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.h
+++ b/src/scriptengines/qml/plasmoid/appletinterface.h
@@ -192,6 +192,11 @@
  */
 Q_PROPERTY(QKeySequence globalShortcut READ globalShortcut WRITE 
setGlobalShortcut NOTIFY globalShortcutChanged)
 
+/**
+ * An interface to the native C++ plasmoid, if implemented
+ */
+Q_PROPERTY(QObject *nativeInterface READ nativeInterface CONSTANT)
+
 public:
 AppletInterface(DeclarativeAppletScript *script, const QVariantList &args 
= QVariantList(), QQuickItem *parent = 0);
 AppletInterface(Plasma::Applet *applet, const QVariantList &args = 
QVariantList(), QQuickItem *parent = 0);
@@ -318,6 +323,8 @@
 QKeySequence globalShortcut() const;
 void setGlobalShortcut(const QKeySequence &keySequence);
 
+QObject *nativeInterface();
+
 Q_SIGNALS:
 /**
  * somebody else, usually the containment sent some data to the applet
@@ -390,6 +397,7 @@
 bool m_hideOnDeactivate : 1;
 //this is used to build an emacs style shortcut
 int m_oldKeyboardShortcut;
+QObject *m_dummyNativeInterface;
 
 friend class ContainmentInterface;
 //This is used by ContainmentInterface

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/374
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65117660043de3a60ad58c77b086f686683d4d8c
Gerrit-PatchSet: 1
Gerrit-Proj

Change in plasma-framework[master]: restore hint-apply-color-scheme support

2015-01-28 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/346

Change subject: restore hint-apply-color-scheme support
..

restore hint-apply-color-scheme support

make hint-apply-color-scheme work (kiconeffect based coloring),
and make sure the kcolorschemes are reloaded when app palette changes
and the theme follows system colors

BUG:343389
Change-Id: I0a7a7eb0f89ed0948e618f1d608521f235aa1959
---
M src/plasma/CMakeLists.txt
M src/plasma/svg.cpp
2 files changed, 24 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/46/346/1

diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt
index 160d09b..1cc9ae3 100644
--- a/src/plasma/CMakeLists.txt
+++ b/src/plasma/CMakeLists.txt
@@ -125,6 +125,7 @@
 KF5::XmlGui   #KActionCollection
 KF5::GlobalAccel #Applet::setGlobalShortcut
 KF5::Notifications
+KF5::IconThemes
 ${PLASMA_EXTRA_LIBS}
 )
 
diff --git a/src/plasma/svg.cpp b/src/plasma/svg.cpp
index 3e609a5..28393e5 100644
--- a/src/plasma/svg.cpp
+++ b/src/plasma/svg.cpp
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "applet.h"
 #include "package.h"
@@ -382,6 +383,13 @@
 
 renderPainter.end();
 
+// Apply current color scheme if the svg asks for it
+if (applyColors) {
+QImage itmp = p.toImage();
+KIconEffect::colorize(itmp, 
cacheAndColorsTheme()->color(Theme::BackgroundColor), 1.0);
+p = p.fromImage(itmp);
+}
+
 if (cacheRendering) {
 cacheAndColorsTheme()->insertIntoCache(id, p, 
QString::number((qint64)q, 16) % QLSEP % actualElementId);
 }
@@ -550,7 +558,10 @@
 
 void SvgPrivate::checkColorHints()
 {
-if (elementRect("current-color-scheme").isValid()) {
+if (elementRect("hint-apply-color-scheme").isValid()) {
+applyColors = true;
+usesColors = true;
+} else if (elementRect("current-color-scheme").isValid()) {
 applyColors = false;
 usesColors = true;
 } else {
@@ -658,6 +669,17 @@
 
 eraseRenderer();
 //qDebug() << "repaint needed from colorsChanged";
+
+// in the case the theme follows the desktop settings, refetch the 
colorschemes
+// and discard the svg pixmap cache
+if (!theme.data()->d->colors) {
+KSharedConfig::openConfig()->reparseConfiguration();
+theme.data()->d->colorScheme = KColorScheme(QPalette::Active, 
KColorScheme::Window);
+theme.data()->d->buttonColorScheme = KColorScheme(QPalette::Active, 
KColorScheme::Button);
+theme.data()->d->viewColorScheme = KColorScheme(QPalette::Active, 
KColorScheme::View);
+theme.data()->d->discardCache(PixmapCache | SvgElementsCache);
+}
+
 emit q->repaintNeeded();
 }
 

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/346
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a7a7eb0f89ed0948e618f1d608521f235aa1959
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: export textFormat for the tooltip

2015-01-27 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/345

Change subject: export textFormat for the tooltip
..

export textFormat for the tooltip

in some cases richtext in the tooltip is not desired, like
in the case of klipper. export a property to set
the text format

Change-Id: Ib4e8e913e060b868188b4f0b46db2162f33d8bb1
---
M src/declarativeimports/core/private/DefaultToolTip.qml
M src/declarativeimports/core/tooltip.cpp
M src/declarativeimports/core/tooltip.h
M src/scriptengines/qml/plasmoid/appletinterface.cpp
M src/scriptengines/qml/plasmoid/appletinterface.h
5 files changed, 62 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/45/345/1

diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml 
b/src/declarativeimports/core/private/DefaultToolTip.qml
index 1e299c3..6010571 100644
--- a/src/declarativeimports/core/private/DefaultToolTip.qml
+++ b/src/declarativeimports/core/private/DefaultToolTip.qml
@@ -83,6 +83,7 @@
 width: Math.min(tooltipSubtext.implicitWidth, preferredTextWidth)
 wrapMode: Text.WordWrap
 text: toolTip ? toolTip.subText : ""
+textFormat: toolTip.textFormat
 opacity: 0.5
 }
 }
diff --git a/src/declarativeimports/core/tooltip.cpp 
b/src/declarativeimports/core/tooltip.cpp
index eb58bca..987dc96 100644
--- a/src/declarativeimports/core/tooltip.cpp
+++ b/src/declarativeimports/core/tooltip.cpp
@@ -35,9 +35,10 @@
 
 ToolTip::ToolTip(QQuickItem *parent)
 : QQuickItem(parent),
+  m_textFormat(0),
   m_tooltipsEnabledGlobally(false),
-  m_containsMouse(false),
   m_location(Plasma::Types::Floating),
+  m_containsMouse(false),
   m_active(true),
   m_interactive(false),
   m_usingDialog(false)
@@ -182,6 +183,21 @@
 emit subTextChanged();
 }
 
+int ToolTip::textFormat() const
+{
+return m_textFormat;
+}
+
+void ToolTip::setTextFormat(int format)
+{
+if (m_textFormat == format) {
+return;
+}
+
+m_textFormat = format;
+emit textFormatChanged();
+}
+
 Plasma::Types::Location ToolTip::location() const
 {
 return m_location;
diff --git a/src/declarativeimports/core/tooltip.h 
b/src/declarativeimports/core/tooltip.h
index 2fc7942..4ab11e7 100644
--- a/src/declarativeimports/core/tooltip.h
+++ b/src/declarativeimports/core/tooltip.h
@@ -83,6 +83,15 @@
 Q_PROPERTY(QString subText READ subText WRITE setSubText NOTIFY 
subTextChanged)
 
 /**
+ * how to handle the text format of the tooltip:
+ * * Text.AutoText (default)
+ * * Text.PlainText
+ * * Text.StyledText
+ * * Text.RichText
+ */
+Q_PROPERTY(int textFormat READ textFormat WRITE setTextFormat NOTIFY 
textFormatChanged)
+
+/**
  * An icon for this tooltip, accepted values are an icon name, a QIcon, 
QImage or QPixmap
  */
 Q_PROPERTY(QVariant icon READ icon WRITE setIcon NOTIFY iconChanged)
@@ -131,6 +140,9 @@
 QString subText() const;
 void setSubText(const QString &subText);
 
+int textFormat() const;
+void setTextFormat(int format);
+
 QVariant icon() const;
 void setIcon(const QVariant &icon);
 
@@ -168,6 +180,7 @@
 void visibleChanged();
 void mainTextChanged();
 void subTextChanged();
+void textFormatChanged();
 void iconChanged();
 void imageChanged();
 void containsMouseChanged();
@@ -187,6 +200,7 @@
 QTimer *m_showTimer;
 QString m_mainText;
 QString m_subText;
+int m_textFormat;
 QVariant m_image;
 QVariant m_icon;
 bool m_active;
diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp 
b/src/scriptengines/qml/plasmoid/appletinterface.cpp
index 7e0dd9f..0ec2c34 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.cpp
+++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp
@@ -55,6 +55,7 @@
 
 AppletInterface::AppletInterface(DeclarativeAppletScript *script, const 
QVariantList &args, QQuickItem *parent)
 : AppletQuickItem(script->applet(), parent),
+  m_toolTipTextFormat(0),
   m_args(args),
   m_actionSignals(0),
   m_appletScriptEngine(script),
@@ -333,6 +334,21 @@
 emit toolTipSubTextChanged();
 }
 
+int AppletInterface::toolTipTextFormat() const
+{
+return m_toolTipTextFormat;
+}
+
+void AppletInterface::setToolTipTextFormat(int format)
+{
+if (m_toolTipTextFormat == format) {
+return;
+}
+
+m_toolTipTextFormat = format;
+emit toolTipTextFormatChanged();
+}
+
 bool AppletInterface::isBusy() const
 {
 return m_busy;
diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h 
b/src/scriptengines/qml/plasmoid/appletinterface.h
index be19a6c..824b3e2 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.h
+++ b/src/scriptengines/qml/plasmoid/appletinterface.h
@@ -91,6 +91,15 @@
 Q_PROPERTY(QString toolTipSub

Change in plasma-framework[master]: Make keyboard shortcuts work

2015-01-23 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/342

Change subject: Make keyboard shortcuts work
..

Make keyboard shortcuts work

QAction keyboard shortcuts cannot work with QML2 (and probably newver will
since in Qt qtquick and qwidgets cannot depend from each other in any way)
so do a simple keyboard shortcut matching here

BUG:336203
Change-Id: I2d7ada7dfcb0e326e63ce7f1e39573709f6fe560
---
M src/scriptengines/qml/plasmoid/appletinterface.cpp
M src/scriptengines/qml/plasmoid/appletinterface.h
2 files changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/42/342/1

diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp 
b/src/scriptengines/qml/plasmoid/appletinterface.cpp
index a27258b..0080b0d 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.cpp
+++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp
@@ -60,6 +60,7 @@
   m_backgroundHints(Plasma::Types::StandardBackground),
   m_busy(false),
   m_hideOnDeactivate(true),
+  m_oldKeyboardShortcut(0),
   m_positionBeforeRemoval(QPointF(-1, -1))
 {
 qmlRegisterType();
@@ -599,6 +600,49 @@
 }
 }
 
+bool AppletInterface::event(QEvent *event)
+{
+// QAction keyboard shortcuts cannot work with QML2 (and probably newver 
will
+// since in Qt qtquick and qwidgets cannot depend from each other in any 
way)
+// so do a simple keyboard shortcut matching here
+if (event->type() == QEvent::KeyPress) {
+QKeyEvent *ke = static_cast(event);
+QKeySequence seq(ke->key()|ke->modifiers());
+
+for (auto a : applet()->actions()->actions()) {
+
+if (a->shortcut().isEmpty()) {
+continue;
+}
+
+//this will happen on a normal, non emacs shortcut
+if (seq.matches(a->shortcut()) == QKeySequence::ExactMatch) {
+event->accept();
+a->trigger();
+m_oldKeyboardShortcut = 0;
+return true;
+
+//first part of an emacs style shortcut?
+} else if (seq.matches(a->shortcut()) == 
QKeySequence::PartialMatch) {
+m_oldKeyboardShortcut = ke->key()|ke->modifiers();
+
+//no match at all, but it can be the second part of an emacs style 
shortcut
+} else {
+QKeySequence seq(m_oldKeyboardShortcut, 
ke->key()|ke->modifiers());
+
+if (seq.matches(a->shortcut()) == QKeySequence::ExactMatch) {
+event->accept();
+a->trigger();
+m_oldKeyboardShortcut = 0;
+return true;
+}
+}
+}
+}
+
+return AppletQuickItem::event(event);
+}
+
 bool AppletInterface::eventFilter(QObject *watched, QEvent *event)
 {
 if (event->type() == QEvent::MouseButtonPress) {
diff --git a/src/scriptengines/qml/plasmoid/appletinterface.h 
b/src/scriptengines/qml/plasmoid/appletinterface.h
index 281a3a0..be19a6c 100644
--- a/src/scriptengines/qml/plasmoid/appletinterface.h
+++ b/src/scriptengines/qml/plasmoid/appletinterface.h
@@ -351,6 +351,7 @@
 virtual void init();
 
 protected:
+bool event(QEvent *event);
 bool eventFilter(QObject *watched, QEvent *event);
 
 private Q_SLOTS:
@@ -372,6 +373,8 @@
 Plasma::Types::BackgroundHints m_backgroundHints;
 bool m_busy : 1;
 bool m_hideOnDeactivate : 1;
+//this is used to build an emacs style shortcut
+int m_oldKeyboardShortcut;
 
 friend class ContainmentInterface;
 //This is used by ContainmentInterface

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/342
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d7ada7dfcb0e326e63ce7f1e39573709f6fe560
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: don't animate icons when they get resized

2015-01-16 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/336

Change subject: don't animate icons when they get resized
..

don't animate icons when they get resized

simplify a bit logic ans
make sure if m_sizeChanged is true, never to animate the change

Change-Id: I552f79b13f7714749137fa90df1f9f30120e6a37
---
M src/declarativeimports/core/iconitem.cpp
1 file changed, 10 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/36/336/1

diff --git a/src/declarativeimports/core/iconitem.cpp 
b/src/declarativeimports/core/iconitem.cpp
index 08bb47d..005e339 100644
--- a/src/declarativeimports/core/iconitem.cpp
+++ b/src/declarativeimports/core/iconitem.cpp
@@ -251,20 +251,16 @@
 QSGTexture *source = 
window()->createTextureFromImage(m_iconPixmap.toImage());
 QSGTexture *target = 
window()->createTextureFromImage(m_oldIconPixmap.toImage());
 animatingNode = new FadingNode(source, target);
-m_sizeChanged = true;
 m_textureChanged = false;
 }
 
 animatingNode->setProgress(m_animValue);
 
-if (m_sizeChanged) {
-const int iconSize = 
Units::roundToIconSize(qMin(boundingRect().size().width(), 
boundingRect().size().height()));
-const QRect destRect(QPointF(boundingRect().center() - 
QPointF(iconSize/2, iconSize/2)).toPoint(),
- QSize(iconSize, iconSize));
+const int iconSize = 
Units::roundToIconSize(qMin(boundingRect().size().width(), 
boundingRect().size().height()));
+const QRect destRect(QPointF(boundingRect().center() - 
QPointF(iconSize/2, iconSize/2)).toPoint(),
+QSize(iconSize, iconSize));
 
-animatingNode->setRect(destRect);
-m_sizeChanged = false;
-}
+animatingNode->setRect(destRect);
 
 return animatingNode;
 } else {
@@ -274,18 +270,15 @@
 delete oldNode;
 textureNode = new ManagedTextureNode;
 
textureNode->setTexture(QSharedPointer(window()->createTextureFromImage(m_iconPixmap.toImage(;
-m_sizeChanged = true;
 m_textureChanged = false;
 }
 
-if (m_sizeChanged) {
-const int iconSize = 
Units::roundToIconSize(qMin(boundingRect().size().width(), 
boundingRect().size().height()));
-const QRect destRect(QPointF(boundingRect().center() - 
QPointF(iconSize/2, iconSize/2)).toPoint(),
- QSize(iconSize, iconSize));
+const int iconSize = 
Units::roundToIconSize(qMin(boundingRect().size().width(), 
boundingRect().size().height()));
+const QRect destRect(QPointF(boundingRect().center() - 
QPointF(iconSize/2, iconSize/2)).toPoint(),
+QSize(iconSize, iconSize));
 
-textureNode->setRect(destRect);
-m_sizeChanged = false;
-}
+textureNode->setRect(destRect);
+
 return textureNode;
 }
 }
@@ -354,6 +347,7 @@
 m_animation->stop();
 }
 update();
+m_sizeChanged = false;
 }
 
 void IconItem::geometryChanged(const QRectF &newGeometry,

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/336
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I552f79b13f7714749137fa90df1f9f30120e6a37
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
Gerrit-Reviewer: David Edmundson 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: never resize a dialog bigger than the screen

2015-01-16 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/334

Change subject: never resize a dialog bigger than the screen
..

never resize a dialog bigger than the screen

in cases screen resolution is quite low, and font size is enormous, popups
tend to become bigger than the screen
BUG:337041

Change-Id: I840868dbd7db665a3953687977d30dd6c3b4a386
---
M src/plasmaquick/dialog.cpp
1 file changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/34/334/1

diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp
index 8c38f47..95d9497 100644
--- a/src/plasmaquick/dialog.cpp
+++ b/src/plasmaquick/dialog.cpp
@@ -331,6 +331,9 @@
 //on the scene
 auto margin = frameSvgItem->fixedMargins();
 int minimumWidth = mainItemLayout->property("minimumWidth").toInt() + 
margin->left() + margin->right();
+if (q->screen()) {
+minimumWidth = qMin(q->screen()->availableGeometry().width(), 
minimumWidth);
+}
 q->contentItem()->setWidth(qMax(q->width(), minimumWidth));
 q->setWidth(qMax(q->width(), minimumWidth));
 
@@ -354,6 +357,10 @@
 //on the scene
 auto margin = frameSvgItem->fixedMargins();
 int minimumHeight = mainItemLayout->property("minimumHeight").toInt() + 
margin->top() + margin->bottom();
+if (q->screen()) {
+minimumHeight = qMin(q->screen()->availableGeometry().height(), 
minimumHeight);
+
+}
 q->contentItem()->setHeight(qMax(q->height(), minimumHeight));
 q->setHeight(qMax(q->height(), minimumHeight));
 
@@ -373,6 +380,9 @@
 
 auto margin = frameSvgItem->fixedMargins();
 int maximumWidth = mainItemLayout->property("maximumWidth").toInt() + 
margin->left() + margin->right();
+if (q->screen()) {
+maximumWidth = qMin(q->screen()->availableGeometry().width(), 
maximumWidth);
+}
 q->contentItem()->setWidth(qMax(q->width(), maximumWidth));
 q->setWidth(qMax(q->width(), maximumWidth));
 
@@ -392,6 +402,9 @@
 
 auto margin = frameSvgItem->fixedMargins();
 int maximumHeight = mainItemLayout->property("maximumHeight").toInt() + 
margin->top() + margin->bottom();
+if (q->screen()) {
+maximumHeight = qMin(q->screen()->availableGeometry().height(), 
maximumHeight);
+}
 q->contentItem()->setHeight(qMax(q->height(), maximumHeight));
 q->setHeight(qMin(q->height(), maximumHeight));
 
@@ -423,6 +436,12 @@
 minimumWidth += margin->left() + margin->right();
 maximumWidth += margin->left() + margin->right();
 
+if (q->screen()) {
+minimumWidth = qMin(q->screen()->availableGeometry().width(), 
minimumWidth);
+minimumHeight = qMin(q->screen()->availableGeometry().height(), 
minimumHeight);
+maximumWidth = qMin(q->screen()->availableGeometry().width(), 
maximumWidth);
+maximumHeight = qMin(q->screen()->availableGeometry().height(), 
maximumHeight);
+}
 
 const QSize finalSize(qBound(minimumWidth, q->width(), maximumWidth),
   qBound(minimumHeight, q->height(), maximumHeight));

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/334
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I840868dbd7db665a3953687977d30dd6c3b4a386
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: migrate to KPackage

2014-12-23 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/260

Change subject: migrate to KPackage
..

migrate to KPackage

Plasma::Package internally uses KPackage, being a pure wrapper.
old client code and old packagestructures still work using the wrapper.
old workspace code that is not directly using kpackage continues to work 
correctly

Change-Id: I05f95e8d05e3b67759973c4009e3753c61b1dcce
---
M CMakeLists.txt
M src/plasma/CMakeLists.txt
M src/plasma/applet.cpp
M src/plasma/applet.h
M src/plasma/corona.cpp
M src/plasma/corona.h
M src/plasma/package.cpp
M src/plasma/package.h
M src/plasma/packagestructure.cpp
M src/plasma/packagestructure.h
M src/plasma/pluginloader.cpp
M src/plasma/private/applet_p.cpp
M src/plasma/private/applet_p.h
M src/plasma/private/corona_p.h
M src/plasma/private/package_p.h
D src/plasma/private/packagejob.cpp
D src/plasma/private/packagejob_p.h
D src/plasma/private/packagejobthread.cpp
D src/plasma/private/packagejobthread_p.h
M src/plasma/private/packages.cpp
M src/plasma/private/packages_p.h
A src/plasma/private/packagestructure_p.h
M src/plasmaquick/packageurlinterceptor.cpp
23 files changed, 345 insertions(+), 1,455 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/60/260/1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ccec0ed..891183c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,7 @@
 find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5XmlGui ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5Notifications ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5Package ${KF5_DEP_VERSION} REQUIRED)
 
 find_package(KF5DocTools ${KF5_DEP_VERSION})
 set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate 
documentation"
diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt
index f7aa38b..423b3e7 100644
--- a/src/plasma/CMakeLists.txt
+++ b/src/plasma/CMakeLists.txt
@@ -66,8 +66,6 @@
 #packages
 package.cpp
 packagestructure.cpp
-private/packagejob.cpp
-private/packagejobthread.cpp
 private/packages.cpp
 
 #graphics
@@ -112,6 +110,7 @@
 PUBLIC
 KF5::Service # For kplugininfo.h and kservice.h
 Qt5::Gui
+KF5::Package
 PRIVATE
 Qt5::Sql
 Qt5::Svg
diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp
index 5594bf8..1793a94 100644
--- a/src/plasma/applet.cpp
+++ b/src/plasma/applet.cpp
@@ -287,7 +287,12 @@
 
 Package Applet::package() const
 {
-return d->package ? *d->package : Package();
+return d->legacyPackage ? *d->legacyPackage : Package();
+}
+
+KPackage::Package Applet::kPackage() const
+{
+return d->package ? *d->package : KPackage::Package();
 }
 
 void Applet::updateConstraints(Plasma::Types::Constraints constraints)
diff --git a/src/plasma/applet.h b/src/plasma/applet.h
index a30a7ac..daff8df 100644
--- a/src/plasma/applet.h
+++ b/src/plasma/applet.h
@@ -33,6 +33,8 @@
 #include 
 #include 
 
+#include 
+
 class KActionCollection;
 class KConfigLoader;
 
@@ -224,13 +226,26 @@
 void setUserConfiguring(bool configuring);
 
 //UTILS
+#ifndef PLASMA_NO_DEPRECATED
+/**
+ * Accessor for the associated Package object if any.
+ * Generally, only Plasmoids come in a Package.
+ * Deprecated: please use kPackage()
+ *
+ * @deprecated use kPackage() instead
+ * @return the Package object, or an invalid one if none
+ **/
+PLASMA_DEPRECATED Package package() const;
+#endif
+
 /**
  * Accessor for the associated Package object if any.
  * Generally, only Plasmoids come in a Package.
  *
  * @return the Package object, or an invalid one if none
+ * @since 5.5
  **/
-Package package() const;
+KPackage::Package kPackage() const;
 
 /**
  * Called when any of the geometry constraints have been updated.
diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp
index 038be7b..b04a510 100644
--- a/src/plasma/corona.cpp
+++ b/src/plasma/corona.cpp
@@ -38,8 +38,10 @@
 
 #include "containment.h"
 #include "pluginloader.h"
+#include "packagestructure.h"
 #include "private/applet_p.h"
 #include "private/containment_p.h"
+#include "private/package_p.h"
 #include "private/timetracker.h"
 
 using namespace Plasma;
@@ -71,15 +73,28 @@
 
 Plasma::Package Corona::package() const
 {
-return d->package;
+return d->legacyPackage;
 }
 
 void Corona::setPackage(const Plasma::Package &package)
 {
-d->package = package;
+d->legacyPackage = package;
 emit packageChanged(package);
 }
 
+KPackage::Package Corona::kPackage() const
+{
+return d->package;
+}
+
+void Corona::setKPackage(const KPackage::Package &package)
+{
+d->package = package;
+d->legacyPackage = Package(new PackageStructure());
+d->legacyPackage.d->internalPackage = new KPackage::Package(package);
+emit kPackageChanged(package);
+}
+
 void Corona::saveLayout(const 

Change in plasma-framework[master]: Add a plotter component

2014-12-16 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/244

Change subject: Add a plotter component
..

Add a plotter component

a Plotter can draw a graph of values arriving from an arbitrary number of data 
sources
to show their evoluton in time.
an example can be a plot of the network transfer speed or CPU temperature over 
time.
Multiple plots can be fitted in the same graph, either stacked or intersected.

Change-Id: I4a29a25412b375dfbd7f0db618040bae19c9b39c
---
M CMakeLists.txt
A Findepoxy.cmake
M src/declarativeimports/plasmaextracomponents/CMakeLists.txt
M src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp
A src/declarativeimports/plasmaextracomponents/plotter.cpp
A src/declarativeimports/plasmaextracomponents/plotter.h
A tests/plotter.qml
7 files changed, 993 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/44/244/1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b19ab53..2a971a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@
 
 # ECM setup
 find_package(ECM 1.4.0 REQUIRED NO_MODULE)
-set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${ECM_MODULE_PATH} 
${ECM_KDE_MODULE_DIR})
 
 include(FeatureSummary)
 include(GenerateExportHeader)
@@ -109,6 +109,13 @@
 set(HAVE_GLX 0)
 endif()
 
+find_package(epoxy)
+set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
+   URL "http://github.com/anholt/libepoxy";
+   TYPE REQUIRED
+   PURPOSE "OpenGL dispatch library"
+  )
+
 #
 
 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
@@ -164,6 +171,7 @@
 
 # make plasma_version.h available
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${epoxy_INCLUDE_DIR})
 
 # list the subdirectories #
 if (KF5DocTools_FOUND)
diff --git a/Findepoxy.cmake b/Findepoxy.cmake
new file mode 100644
index 000..c5500a0
--- /dev/null
+++ b/Findepoxy.cmake
@@ -0,0 +1,27 @@
+# - Try to find libepoxy
+# Once done this will define
+#
+#  epoxy_FOUND- System has libepoxy
+#  epoxy_LIBRARY  - The libepoxy library
+#  epoxy_INCLUDE_DIR  - The libepoxy include dir
+#  epoxy_DEFINITIONS  - Compiler switches required for using libepoxy
+
+# Copyright (c) 2014 Fredrik Höglund 
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (NOT WIN32)
+  find_package(PkgConfig)
+  pkg_check_modules(PKG_epoxy QUIET epoxy)
+
+  set(epoxy_DEFINITIONS ${PKG_epoxy_CFLAGS})
+
+  find_path(epoxy_INCLUDE_DIR NAMES epoxy/gl.h HINTS ${PKG_epoxy_INCLUDEDIR} 
${PKG_epoxy_INCLUDE_DIRS})
+  find_library(epoxy_LIBRARY  NAMES epoxy  HINTS ${PKG_epoxy_LIBDIR} 
${PKG_epoxy_LIBRARY_DIRS})
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(epoxy DEFAULT_MSG epoxy_LIBRARY 
epoxy_INCLUDE_DIR)
+
+  mark_as_advanced(epoxy_INCLUDE_DIR epoxy_LIBRARY)
+endif()
diff --git a/src/declarativeimports/plasmaextracomponents/CMakeLists.txt 
b/src/declarativeimports/plasmaextracomponents/CMakeLists.txt
index 8aec3c5..b13f345 100644
--- a/src/declarativeimports/plasmaextracomponents/CMakeLists.txt
+++ b/src/declarativeimports/plasmaextracomponents/CMakeLists.txt
@@ -10,6 +10,7 @@
 #resourceinstance.cpp
 plasmaextracomponentsplugin.cpp
 fallbackcomponent.cpp
+plotter.cpp
 )
 
 add_library(plasmaextracomponentsplugin SHARED ${plasmaextracomponents_SRCS})
@@ -19,7 +20,8 @@
 Qt5::Qml
 ${KACTIVITIES_LIBRARY}
 KF5::Service
-KF5::Plasma)
+KF5::Plasma
+${epoxy_LIBRARY})
 
 
 install(TARGETS plasmaextracomponentsplugin DESTINATION 
${QML_INSTALL_DIR}/org/kde/plasma/extras)
diff --git 
a/src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp 
b/src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp
index 448e13a..2506902 100644
--- 
a/src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp
+++ 
b/src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp
@@ -20,7 +20,7 @@
 #include "plasmaextracomponentsplugin.h"
 
 #include "appbackgroundprovider_p.h"
-//#include "resourceinstance.h"
+#include "plotter.h"
 #include "fallbackcomponent.h"
 
 #include 
@@ -40,6 +40,8 @@
 Q_ASSERT(uri == QLatin1String("org.kde.plasma.extras"));
 //qmlRegisterType(uri, 2, 0, "ResourceInstance");
 qmlRegisterType(uri, 2, 0, "FallbackComponent");
+qmlRegisterType(uri, 2, 0, "PlotData");
+qmlRegisterType(uri, 2, 0, "Plotter");
 }
 
 #include "plasmaextracomponentsplugin.moc"
diff --git a/src/declarativeimports/plasmaextracom

Change in plasma-framework[master]: Different themes between desktop and dialogs

2014-12-11 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/218

Change subject: Different  themes between desktop and dialogs
..

Different  themes between desktop and dialogs

different themes between QtControl themes in applets
and in config dialogs: this allows QtQuickControls
to be freely usable in applets without worrying how they
will integrate

Change-Id: I696bdcbd78eb2e4df708367ac0d70d13c5d6cf12
---
M src/plasmaquick/appletquickitem.cpp
M src/plasmaquick/view.cpp
2 files changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/18/218/1

diff --git a/src/plasmaquick/appletquickitem.cpp 
b/src/plasmaquick/appletquickitem.cpp
index 6ec12b9..06406a4 100644
--- a/src/plasmaquick/appletquickitem.cpp
+++ b/src/plasmaquick/appletquickitem.cpp
@@ -435,6 +435,18 @@
 engine->setUrlInterceptor(interceptor);
 }
 
+QQmlComponent c(engine);
+c.setData("import QtQuick 2.1\n\
+import QtQuick.Controls 1.0\n\
+import QtQuick.Controls.Private 1.0\n \
+Item {\
+  Component.onCompleted: {\
+Settings.styleName = \"Base\";\
+  }\
+}", QUrl());
+QObject *o = c.create();
+o->deleteLater();
+
 
d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->package().filePath("mainscript")));
 
 if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() 
|| !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) {
diff --git a/src/plasmaquick/view.cpp b/src/plasmaquick/view.cpp
index 1d1b506..1c981ae 100644
--- a/src/plasmaquick/view.cpp
+++ b/src/plasmaquick/view.cpp
@@ -196,6 +196,18 @@
 qWarning() << "Invalid home screen package";
 }
 
+QQmlComponent c(engine());
+c.setData("import QtQuick 2.1\n\
+import QtQuick.Controls 1.0\n\
+import QtQuick.Controls.Private 1.0\n \
+Item {\
+  Component.onCompleted: {\
+Settings.styleName = \"Base\";\
+  }\
+}", QUrl());
+QObject *o = c.create();
+o->deleteLater();
+
 setResizeMode(View::SizeRootObjectToView);
 }
 

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/218
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I696bdcbd78eb2e4df708367ac0d70d13c5d6cf12
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: export a plasma version number in themes

2014-12-02 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/195

Change subject: export a plasma version number in themes
..

export a plasma version number in themes

some of the behavior of the theme has changed.
this makes some of the old themes to not work correctly
(like black text on black)
read a version number of the "plasma version this theme has been intended for"
and use it to change the behavior for retrocompatibility
(all themes that don't export this are assumed to be from KDE4)

Change-Id: I4bc20a0c10de9f9a6c3facd63b6c5b6da210039a
---
M src/desktoptheme/air/metadata.desktop
M src/desktoptheme/breeze-dark/metadata.desktop
M src/desktoptheme/breeze/metadata.desktop
M src/desktoptheme/oxygen/metadata.desktop
M src/plasma/private/theme_p.cpp
M src/plasma/private/theme_p.h
6 files changed, 30 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/95/195/1

diff --git a/src/desktoptheme/air/metadata.desktop 
b/src/desktoptheme/air/metadata.desktop
index a297bb9..c12fde3 100644
--- a/src/desktoptheme/air/metadata.desktop
+++ b/src/desktoptheme/air/metadata.desktop
@@ -86,6 +86,7 @@
 X-KDE-PluginInfo-Depends=
 X-KDE-PluginInfo-License=GPL
 X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-API=5.0
 
 [Wallpaper]
 defaultWallpaperTheme=Elarun
diff --git a/src/desktoptheme/breeze-dark/metadata.desktop 
b/src/desktoptheme/breeze-dark/metadata.desktop
index 9b4d611..52c0041 100644
--- a/src/desktoptheme/breeze-dark/metadata.desktop
+++ b/src/desktoptheme/breeze-dark/metadata.desktop
@@ -41,6 +41,7 @@
 X-KDE-PluginInfo-Depends=
 X-KDE-PluginInfo-License=LGPL
 X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-API=5.0
 
 [Wallpaper]
 defaultWallpaperTheme=Next
diff --git a/src/desktoptheme/breeze/metadata.desktop 
b/src/desktoptheme/breeze/metadata.desktop
index ddff6a5..cb15ee8 100644
--- a/src/desktoptheme/breeze/metadata.desktop
+++ b/src/desktoptheme/breeze/metadata.desktop
@@ -43,6 +43,7 @@
 X-KDE-PluginInfo-Depends=
 X-KDE-PluginInfo-License=LGPL
 X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-API=5.0
 
 [Wallpaper]
 defaultWallpaperTheme=Next
diff --git a/src/desktoptheme/oxygen/metadata.desktop 
b/src/desktoptheme/oxygen/metadata.desktop
index a1a0c51..96592c1 100644
--- a/src/desktoptheme/oxygen/metadata.desktop
+++ b/src/desktoptheme/oxygen/metadata.desktop
@@ -82,6 +82,7 @@
 X-KDE-PluginInfo-Depends=
 X-KDE-PluginInfo-License=GPL
 X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-API=5.0
 
 [Wallpaper]
 defaultWallpaperTheme=Elarun
diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp
index ccd9f91..61cf797 100644
--- a/src/plasma/private/theme_p.cpp
+++ b/src/plasma/private/theme_p.cpp
@@ -66,7 +66,10 @@
   useGlobal(true),
   hasWallpapers(false),
   fixedName(false),
-  backgroundContrastEnabled(true)
+  backgroundContrastEnabled(true),
+  apiMajor(1),
+  apiMinor(0),
+  apiRevision(0)
 {
 ThemeConfig config;
 cacheTheme = config.cacheTheme();
@@ -532,6 +535,13 @@
 {
 const KColorScheme *scheme = 0;
 
+//Before 5.0 Plasma theme really only used Normal and Button
+//many old themes are built on this assumption and will break
+//otherwise
+if (apiMajor < 5 && group != Theme::NormalColorGroup) {
+group = Theme::ButtonColorGroup;
+}
+
 switch (group) {
 case Theme::ButtonColorGroup: {
 scheme = &buttonColorScheme;
@@ -796,6 +806,16 @@
 KConfig metadata(metadataPath);
 processWallpaperSettings(&metadata);
 }
+
+//Check for what Plasma version the theme has been done
+//There are some behavioral differences between KDE4 Plasma and Plasma 
5
+cg = KConfigGroup(&metadata, "Desktop Entry");
+const QString apiVersion = cg.readEntry("X-Plasma-API", "1.0");
+QRegExp exp("(\\d+)\\.{0,1}(\\d*)\\.{0,1}(\\d*)");
+exp.indexIn(apiVersion);
+apiMajor = exp.cap(1).toInt();
+apiMinor = exp.cap(2).toInt();
+apiRevision = exp.cap(3).toInt();
 }
 
 if (realTheme && isDefault && writeSettings) {
diff --git a/src/plasma/private/theme_p.h b/src/plasma/private/theme_p.h
index 309b555..96e98ed 100644
--- a/src/plasma/private/theme_p.h
+++ b/src/plasma/private/theme_p.h
@@ -153,6 +153,11 @@
 qreal backgroundIntensity;
 qreal backgroundSaturation;
 bool backgroundContrastEnabled;
+
+//Version number of Plasma the Theme has been designed for
+int apiMajor;
+int apiMinor;
+int apiRevision;
 };
 
 }

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/195
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bc20a0c10de9f9a6c3facd63b6c5b6da210039a
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
Gerrit-Reviewer: 

Change in plasma-framework[master]: use PlasmaCore.ColorScope when suitable

2014-11-25 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/177

Change subject: use PlasmaCore.ColorScope when suitable
..

use PlasmaCore.ColorScope when suitable

It is possible to put a PlasmaCore.ColorScope element, to automatically
change the colors:
if for instance the complementary scope will be set, all labels
descendent of such element would flip their color

Change-Id: I2214aca522eb094cf067d8726c5bf2a7ecbf36b3
---
M src/declarativeimports/plasmacomponents/qml/Label.qml
M src/declarativeimports/plasmacomponents/qml/styles/TextAreaStyle.qml
M src/declarativeimports/plasmacomponents/qml/styles/ToolButtonStyle.qml
3 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/77/177/1

diff --git a/src/declarativeimports/plasmacomponents/qml/Label.qml 
b/src/declarativeimports/plasmacomponents/qml/Label.qml
index 1243ca6..a22efb6 100644
--- a/src/declarativeimports/plasmacomponents/qml/Label.qml
+++ b/src/declarativeimports/plasmacomponents/qml/Label.qml
@@ -50,7 +50,7 @@
 font.underline: theme.defaultFont.underline
 font.weight: theme.defaultFont.weight
 font.wordSpacing: theme.defaultFont.wordSpacing
-color: theme.textColor
+color: PlasmaCore.ColorScope.textColor
 
 opacity: enabled? 1 : 0.6
 
diff --git 
a/src/declarativeimports/plasmacomponents/qml/styles/TextAreaStyle.qml 
b/src/declarativeimports/plasmacomponents/qml/styles/TextAreaStyle.qml
index 68f1a8b..90af0c5 100644
--- a/src/declarativeimports/plasmacomponents/qml/styles/TextAreaStyle.qml
+++ b/src/declarativeimports/plasmacomponents/qml/styles/TextAreaStyle.qml
@@ -36,9 +36,9 @@
 
 font: theme.defaultFont
 backgroundColor: "transparent"
-textColor: theme.viewTextColor
-selectionColor: theme.viewFocusColor
-selectedTextColor: theme.viewBackgroundColor
+textColor: control.backgroundVisible ? theme.viewTextColor : 
PlasmaCore.ColorScope.textColor
+selectionColor: control.backgroundVisible ? theme.viewFocusColor : 
PlasmaCore.ColorScope.highlightColor
+selectedTextColor: control.backgroundVisible ? theme.viewBackgroundColor : 
PlasmaCore.ColorScope.backgroundColor
 
 renderType: Text.NativeRendering
 
diff --git 
a/src/declarativeimports/plasmacomponents/qml/styles/ToolButtonStyle.qml 
b/src/declarativeimports/plasmacomponents/qml/styles/ToolButtonStyle.qml
index af04469..cf19524 100644
--- a/src/declarativeimports/plasmacomponents/qml/styles/ToolButtonStyle.qml
+++ b/src/declarativeimports/plasmacomponents/qml/styles/ToolButtonStyle.qml
@@ -87,7 +87,7 @@
 visible: control.text != ""
 Layout.fillWidth: true
 height: parent.height
-color: control.hovered || !control.flat ? 
theme.buttonTextColor : theme.textColor
+color: control.hovered || !control.flat ? 
theme.buttonTextColor : PlasmaCore.ColorScope.textColor
 horizontalAlignment: icon.valid ? Text.AlignLeft : 
Text.AlignHCenter
 verticalAlignment: Text.AlignVCenter
 elide: Text.ElideRight

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/177
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2214aca522eb094cf067d8726c5bf2a7ecbf36b3
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
Gerrit-Reviewer: David Edmundson 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Change in plasma-framework[master]: workaround on textarea input breaking

2014-11-04 Thread Marco Martin (Code Review)
Marco Martin has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/145

Change subject: workaround on textarea input breaking
..

workaround on textarea input breaking

this makes sure if there is an item with focus in the applet,
it and all its parent are removed the focus when the applet is deleted.
otherwise when there is an item with focus that loses its qquickwindow,
it will never be able to gain it again
it's a workaround but i'm not sure how should be fixed in qquickitem,
or if is even appropriate

Change-Id: I72c8f01d4557003604c4261ca5a9ab49dd136b02
---
M src/scriptengines/qml/plasmoid/appletinterface.cpp
M src/scriptengines/qml/plasmoid/appletinterface.h
2 files changed, 35 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework 
refs/changes/45/145/1
-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/145
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72c8f01d4557003604c4261ca5a9ab49dd136b02
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: Marco Martin 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel