From a532159c0e641f0d0a44c95e18a583effdad54b3 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 16 Jan 2012 13:58:36 +0100 Subject: [PATCH 1/7] fix comments syntax --- declarativeimports/plasmacomponents/qml/SectionScroller.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/declarativeimports/plasmacomponents/qml/SectionScroller.qml b/declarativeimports/plasmacomponents/qml/SectionScroller.qml index 3a7dd18b6..670ba0750 100644 --- a/declarativeimports/plasmacomponents/qml/SectionScroller.qml +++ b/declarativeimports/plasmacomponents/qml/SectionScroller.qml @@ -66,7 +66,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore Item { id: root - /** + /* * The listview this scroll indicator will work on */ property ListView listView From 43eb9c596783c86b74c52e2649ddd94d0f94b9d4 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 16 Jan 2012 21:28:50 +0100 Subject: [PATCH 2/7] tell why hasOverState exists --- declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml b/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml index bf9e1b731..8c00c35ca 100644 --- a/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml +++ b/declarativeimports/plasmacomponents/qml/private/ButtonShadow.qml @@ -39,6 +39,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore Item { id: main state: parent.state + //used to tell apart this implementation with the touch components one property bool hasOverState: true PlasmaCore.FrameSvgItem { From 468b015ce64cf379a0e41bc53570fe83efa5b229 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 17 Jan 2012 16:49:53 +0100 Subject: [PATCH 3/7] make sure the proper window is active --- declarativeimports/plasmacomponents/fullscreendialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/declarativeimports/plasmacomponents/fullscreendialog.cpp b/declarativeimports/plasmacomponents/fullscreendialog.cpp index 3af3c6867..660a11c22 100644 --- a/declarativeimports/plasmacomponents/fullscreendialog.cpp +++ b/declarativeimports/plasmacomponents/fullscreendialog.cpp @@ -250,8 +250,12 @@ void FullScreenDialog::setVisible(const bool visible) if (m_view->isVisible() != visible) { m_background->setVisible(visible); m_view->setVisible(visible); + unsigned long state = NET::Sticky | NET::StaysOnTop | NET::KeepAbove | NET::SkipTaskbar | NET::SkipPager; + KWindowSystem::setState(m_view->effectiveWinId(), state); + KWindowSystem::setState(m_background->effectiveWinId(), state); if (visible) { m_view->raise(); + KWindowSystem::forceActiveWindow(m_view->effectiveWinId()); } } } From 3f73928cf92acbd58a35f6c9f63a61a7e589e63b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 18 Jan 2012 11:39:41 +0100 Subject: [PATCH 4/7] fix text centering when needed --- declarativeimports/plasmacomponents/qml/TabButton.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/TabButton.qml b/declarativeimports/plasmacomponents/qml/TabButton.qml index 5a3605501..a3b8c10c8 100644 --- a/declarativeimports/plasmacomponents/qml/TabButton.qml +++ b/declarativeimports/plasmacomponents/qml/TabButton.qml @@ -90,8 +90,8 @@ Item { signal clicked - implicitWidth: label.paintedWidth + (internal.portrait ? 0 : (iconSource != "" ? 16 : 0)) - implicitHeight: label.paintedHeight + (internal.portrait ? (iconSource != "" ? 16 : 0) : 0) + implicitWidth: label.paintedWidth + (internal.portrait ? 0 : (iconSource != null ? 16 : 0)) + implicitHeight: label.paintedHeight + (internal.portrait ? (iconSource != null ? 16 : 0) : 0) //long notation to not make it overwritten by implementations Connections { @@ -129,14 +129,14 @@ Item { objectName: "label" anchors { - top: internal.portrait && iconSource != "" ? imageLoader.bottom : parent.top - left: internal.portrait || iconSource == "" ? parent.left : imageLoader.right + top: internal.portrait && iconSource != null ? imageLoader.bottom : parent.top + left: internal.portrait || iconSource == null ? parent.left : imageLoader.right right: parent.right bottom: parent.bottom } elide: Text.ElideRight - horizontalAlignment: !internal.portrait && iconSource != "" ? Text.AlignLeft : Text.AlignHCenter + horizontalAlignment: !internal.portrait && iconSource != null ? Text.AlignLeft : Text.AlignHCenter verticalAlignment: Text.AlignVCenter } From 4dca0e4d129b3081b9bddc336e048fe66ddf37d8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 18 Jan 2012 14:08:41 +0100 Subject: [PATCH 5/7] dismiss dialog close if we are over the dialog at button release --- .../plasmacomponents/fullscreendialog.cpp | 11 ++++++++++- .../plasmacomponents/fullscreendialog.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/declarativeimports/plasmacomponents/fullscreendialog.cpp b/declarativeimports/plasmacomponents/fullscreendialog.cpp index 660a11c22..29b4f33b8 100644 --- a/declarativeimports/plasmacomponents/fullscreendialog.cpp +++ b/declarativeimports/plasmacomponents/fullscreendialog.cpp @@ -71,11 +71,15 @@ public: void mousePressEvent(QMouseEvent *event) { event->accept(); + m_dialog->view()->winId(); + KWindowSystem::forceActiveWindow(m_dialog->view()->winId()); } void mouseReleaseEvent(QMouseEvent *event) { - m_dialog->close(); + if (!m_dialog->view()->geometry().contains(event->globalPos())) { + m_dialog->close(); + } } private: @@ -260,6 +264,11 @@ void FullScreenDialog::setVisible(const bool visible) } } +QGraphicsView *FullScreenDialog::view() const +{ + return m_view; +} + QDeclarativeListProperty FullScreenDialog::title() { if (m_rootObject) { diff --git a/declarativeimports/plasmacomponents/fullscreendialog.h b/declarativeimports/plasmacomponents/fullscreendialog.h index 88d9a9061..4eac4a37b 100644 --- a/declarativeimports/plasmacomponents/fullscreendialog.h +++ b/declarativeimports/plasmacomponents/fullscreendialog.h @@ -54,6 +54,7 @@ public: bool isVisible() const; void setVisible(const bool visible); + QGraphicsView *view() const; //QML properties QDeclarativeListProperty title(); From 7a656708fe023e5a294bd0197aeb25eb680e28dc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 18 Jan 2012 14:23:08 +0100 Subject: [PATCH 6/7] simplify the slidingpopups call --- declarativeimports/plasmacomponents/fullscreendialog.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/declarativeimports/plasmacomponents/fullscreendialog.cpp b/declarativeimports/plasmacomponents/fullscreendialog.cpp index 29b4f33b8..90e6d3d6f 100644 --- a/declarativeimports/plasmacomponents/fullscreendialog.cpp +++ b/declarativeimports/plasmacomponents/fullscreendialog.cpp @@ -253,6 +253,7 @@ void FullScreenDialog::setVisible(const bool visible) { if (m_view->isVisible() != visible) { m_background->setVisible(visible); + Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0); m_view->setVisible(visible); unsigned long state = NET::Sticky | NET::StaysOnTop | NET::KeepAbove | NET::SkipTaskbar | NET::SkipPager; KWindowSystem::setState(m_view->effectiveWinId(), state); @@ -352,10 +353,6 @@ bool FullScreenDialog::eventFilter(QObject *watched, QEvent *event) if (watched == m_mainItem.data() && (event->type() == QEvent::GraphicsSceneResize)) { syncMainItem(); - } else if (watched == m_view && event->type() == QEvent::Show) { - Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0); - } else if (watched == m_view && event->type() == QEvent::Hide) { - Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0); } return false; } From 6d4ad45c84279d808291793c36b795c2409935ff Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 18 Jan 2012 16:49:12 +0100 Subject: [PATCH 7/7] ensure the text field has focus --- .../platformcomponents/touch/Dialog.qml | 4 ---- .../plasmacomponents/qml/SelectionDialog.qml | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/declarativeimports/plasmacomponents/platformcomponents/touch/Dialog.qml b/declarativeimports/plasmacomponents/platformcomponents/touch/Dialog.qml index 9e9fc8d90..e590f7ce7 100644 --- a/declarativeimports/plasmacomponents/platformcomponents/touch/Dialog.qml +++ b/declarativeimports/plasmacomponents/platformcomponents/touch/Dialog.qml @@ -168,10 +168,6 @@ Item { } } - Component.onCompleted: { - rootItem = Utils.rootObject() - } - states: [ State { name: "closed" diff --git a/declarativeimports/plasmacomponents/qml/SelectionDialog.qml b/declarativeimports/plasmacomponents/qml/SelectionDialog.qml index 6eddf2d3c..9b0d122e4 100644 --- a/declarativeimports/plasmacomponents/qml/SelectionDialog.qml +++ b/declarativeimports/plasmacomponents/qml/SelectionDialog.qml @@ -167,15 +167,27 @@ CommonDialog { reject() } + Timer { + id: focusTimer + interval: 100 + onTriggered: { + filterField.forceActiveFocus() + } + } onStatusChanged: { + //FIXME: why needs focus deactivation then activation? + if (status == DialogStatus.Open) { + filterField.focus = false + focusTimer.running = true + } + if (status == DialogStatus.Opening) { if (listView.currentItem != null) { listView.currentItem.focus = false } listView.currentIndex = -1 listView.positionViewAtIndex(0, ListView.Beginning) - } - else if (status == DialogStatus.Open) { + } else if (status == DialogStatus.Open) { listView.focus = true } }