~ubuntu-branches/ubuntu/oneiric/kde-runtime/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/kubuntu-mobile-07-location-property-that-decides-the-sliding-effect.patch

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2011-09-16 14:57:48 UTC
  • Revision ID: package-import@ubuntu.com-20110916145748-ckb4e6m0wivpk3tw
Tags: 4:4.7.1-0ubuntu5
Drop all kde-active packages and patches as double-building with different
patchsets doesn't seem to work on the archive builders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From b7eea9e4e4289eeae13fc72004539bec07bd0af3 Mon Sep 17 00:00:00 2001
2
 
From: Marco Martin <notmart@gmail.com>
3
 
Date: Mon, 15 Aug 2011 19:32:01 +0200
4
 
Subject: [PATCH 7/10] location property that decides the sliding effect
5
 
 
6
 
---
7
 
 plasma/declarativeimports/core/dialog.cpp |   21 ++++++++++++++++++++-
8
 
 plasma/declarativeimports/core/dialog.h   |    8 ++++++++
9
 
 2 files changed, 28 insertions(+), 1 deletions(-)
10
 
 
11
 
diff --git a/plasma/declarativeimports/core/dialog.cpp b/plasma/declarativeimports/core/dialog.cpp
12
 
index d5f1b42..bb74ac5 100644
13
 
--- a/plasma/declarativeimports/core/dialog.cpp
14
 
+++ b/plasma/declarativeimports/core/dialog.cpp
15
 
@@ -28,6 +28,7 @@
16
 
 
17
 
 #include <Plasma/Corona>
18
 
 #include <Plasma/Dialog>
19
 
+#include <Plasma/WindowEffects>
20
 
 
21
 
 
22
 
 DialogMargins::DialogMargins(Plasma::Dialog *dialog, QObject *parent)
23
 
@@ -83,7 +84,8 @@ int DialogMargins::bottom() const
24
 
 DialogProxy::DialogProxy(QObject *parent)
25
 
     : QObject(parent),
26
 
       m_declarativeItemContainer(0),
27
 
-      m_activeWindow(false)
28
 
+      m_activeWindow(false),
29
 
+      m_location(Plasma::Floating)
30
 
 {
31
 
     m_dialog = new Plasma::Dialog();
32
 
     m_margins = new DialogMargins(m_dialog, this);
33
 
@@ -244,6 +246,21 @@ void DialogProxy::setWindowFlags(const int flags)
34
 
     m_dialog->setWindowFlags((Qt::WindowFlags)flags);
35
 
 }
36
 
 
37
 
+int DialogProxy::location() const
38
 
+{
39
 
+    return (int)m_location;
40
 
+}
41
 
+
42
 
+void DialogProxy::setLocation(int location)
43
 
+{
44
 
+    if (m_location == location) {
45
 
+        return;
46
 
+    }
47
 
+    m_location = (Plasma::Location)location;
48
 
+    emit locationChanged();
49
 
+}
50
 
+
51
 
+
52
 
 QObject *DialogProxy::margins() const
53
 
 {
54
 
     return m_margins;
55
 
@@ -271,8 +288,10 @@ bool DialogProxy::eventFilter(QObject *watched, QEvent *event)
56
 
             emit heightChanged();
57
 
         }
58
 
     } else if (watched == m_dialog && event->type() == QEvent::Show) {
59
 
+        Plasma::WindowEffects::slideWindow(m_dialog, m_location);
60
 
         emit visibleChanged();
61
 
     } else if (watched == m_dialog && event->type() == QEvent::Hide) {
62
 
+        Plasma::WindowEffects::slideWindow(m_dialog, m_location);
63
 
         emit visibleChanged();
64
 
     } else if (watched == m_dialog && event->type() == QEvent::WindowActivate) {
65
 
         m_activeWindow = true;
66
 
diff --git a/plasma/declarativeimports/core/dialog.h b/plasma/declarativeimports/core/dialog.h
67
 
index 5d60d13..a871a80 100644
68
 
--- a/plasma/declarativeimports/core/dialog.h
69
 
+++ b/plasma/declarativeimports/core/dialog.h
70
 
@@ -23,6 +23,8 @@
71
 
 #include <QWeakPointer>
72
 
 #include <QPoint>
73
 
 
74
 
+#include <Plasma/Plasma>
75
 
+
76
 
 class QGraphicsObject;
77
 
 
78
 
 namespace Plasma
79
 
@@ -81,6 +83,7 @@ class DialogProxy : public QObject
80
 
     Q_PROPERTY(int windowFlags READ windowFlags WRITE setWindowFlags)
81
 
     Q_PROPERTY(QObject *margins READ margins CONSTANT)
82
 
     Q_PROPERTY(bool activeWindow READ isActiveWindow NOTIFY activeWindowChanged)
83
 
+    Q_PROPERTY(int location READ location WRITE setLocation NOTIFY locationChanged)
84
 
 
85
 
 public:
86
 
     enum WidgetAttribute {
87
 
@@ -111,6 +114,9 @@ public:
88
 
     int windowFlags() const;
89
 
     void setWindowFlags(const int);
90
 
 
91
 
+    int location() const;
92
 
+    void setLocation(int location);
93
 
+
94
 
     QObject *margins() const;
95
 
 
96
 
     //FIXME: alignment should be Qt::AlignmentFlag
97
 
@@ -126,6 +132,7 @@ Q_SIGNALS:
98
 
     void widthChanged();
99
 
     void heightChanged();
100
 
     void activeWindowChanged();
101
 
+    void locationChanged();
102
 
 
103
 
 protected Q_SLOTS:
104
 
     void syncMainItem();
105
 
@@ -140,6 +147,7 @@ private:
106
 
     QWeakPointer<QGraphicsObject> m_mainItem;
107
 
     DialogMargins *m_margins;
108
 
     bool m_activeWindow;
109
 
+    Plasma::Location m_location;
110
 
 };
111
 
 
112
 
 #endif
113
 
1.7.5.4
114