summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstoolbar.hpp
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-14 15:21:28 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-14 15:21:28 +0300
commit6e158f3e228628caadd6997065eec6c00267524a (patch)
treeb767a4551bda665a47ea71e75ec09eb451e91483 /src/bookmarks/bookmarkstoolbar.hpp
parentRename BookmarkModel to BookmarksTreeModel (diff)
downloadrekonq-6e158f3e228628caadd6997065eec6c00267524a.tar.xz
Add Bookmarks toolbar
Diffstat (limited to 'src/bookmarks/bookmarkstoolbar.hpp')
-rw-r--r--src/bookmarks/bookmarkstoolbar.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/bookmarks/bookmarkstoolbar.hpp b/src/bookmarks/bookmarkstoolbar.hpp
new file mode 100644
index 00000000..6aaa750a
--- /dev/null
+++ b/src/bookmarks/bookmarkstoolbar.hpp
@@ -0,0 +1,58 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (C) 2008-2013 by Andrea Diamantini <adjam7 at gmail dot com>
+ * Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com>
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================ */
+
+#pragma once
+
+#include "rekonq.hpp"
+#include <QToolBar>
+
+class BookmarksTreeModel;
+
+/**
+ * This class manage the bookmark toolbar.
+ * Some events from the toolbar are handled to allow the drag and drop
+ */
+class BookmarkToolBar : public QToolBar {
+ Q_OBJECT
+
+public:
+ explicit BookmarkToolBar(QWidget *parent = nullptr);
+ ~BookmarkToolBar() override = default;
+
+ void setModel(BookmarksTreeModel *ptr)
+ {
+ Q_CHECK_PTR(ptr);
+ model = ptr;
+ }
+
+signals:
+ void loadUrl(const QUrl &url, rekonq::OpenType type);
+
+protected:
+ void showEvent(QShowEvent *event) override;
+ // bool eventFilter(QObject *watched, QEvent *event);
+
+private slots:
+ // void contextMenu(const QPoint &);
+ // void menuDisplayed();
+ // void menuHidden();
+ // void hideMenu();
+ // void dragDestroyed();
+
+private:
+ BookmarksTreeModel *model = nullptr;
+ void startDrag();
+
+ QPoint m_startDragPos;
+ QAction *m_dragAction = nullptr;
+ QAction *m_dropAction = nullptr;
+ QAction *m_checkedAction = nullptr;
+ bool m_filled = false;
+};