From 00fa5d9215d32124292fe3e45372acebac7b9d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20H=C3=B6ltt=C3=A4?= Date: Tue, 30 Oct 2018 15:40:04 +0100 Subject: Refactor item registration with scopes in mind ItemRegister class removed and items now keep track of their own cursor navigable child items. Navigation happens now only between siblings. --- plugin/cursornavigation.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'plugin/cursornavigation.h') diff --git a/plugin/cursornavigation.h b/plugin/cursornavigation.h index 2217679..7e61ee9 100644 --- a/plugin/cursornavigation.h +++ b/plugin/cursornavigation.h @@ -25,20 +25,22 @@ public: static CursorNavigation *cursorNavigationForWindow(QQuickWindow *window); + static CursorNavigationAttached *cursorNavigationAttachment(QQuickItem *item); + private: - void setCursorOnItem(QQuickItem *item); + void setCursorOnItem(CursorNavigationAttached *item); void onActiveFocusItemChanged(); - - static CursorNavigationAttached *cursorNavigationAttachment(QQuickItem *item); + void registerItem(CursorNavigationAttached* item); + void unregisterItem(CursorNavigationAttached* item); private: static const char windowPropertyName[]; QQuickWindow *m_window; InputAdapter m_inputAdapter; - QQuickItem *m_currentItem; //item that currently has the cursor + CursorNavigationAttached *m_currentItem; //item that currently has the cursor QList m_algorithms; - ItemRegister m_itemRegister; - + //a root item that is not tied to any actual QQuickItem + CursorNavigationAttached m_rootItem; friend class CursorNavigationAttached; }; -- cgit v1.2.3