diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/bookmarks/bookmark.cpp | 1 | ||||
-rw-r--r-- | src/bookmarks/bookmark.hpp | 13 | ||||
-rw-r--r-- | src/panels/bookmarkstoolbar.cpp | 9 |
4 files changed, 7 insertions, 17 deletions
diff --git a/src/bookmarks/CMakeLists.txt b/src/bookmarks/CMakeLists.txt index 0fdbbad8..3f89c74f 100644 --- a/src/bookmarks/CMakeLists.txt +++ b/src/bookmarks/CMakeLists.txt @@ -1,6 +1,5 @@ add_library(bookmarks STATIC # Bookmarks Model - bookmark.cpp bookmark.hpp bookmarkstreeitem.cpp bookmarkstreeitem.hpp bookmarkstreemodel.cpp bookmarkstreemodel.hpp bookmarkstreeformats.hpp diff --git a/src/bookmarks/bookmark.cpp b/src/bookmarks/bookmark.cpp deleted file mode 100644 index 665a10c8..00000000 --- a/src/bookmarks/bookmark.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "bookmark.hpp" diff --git a/src/bookmarks/bookmark.hpp b/src/bookmarks/bookmark.hpp deleted file mode 100644 index ea958f6d..00000000 --- a/src/bookmarks/bookmark.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include <QList> -#include <QObject> - -class Bookmark : public QObject { - Q_OBJECT - -public: - explicit Bookmark(QObject *parent = nullptr) : QObject(parent) {} -}; - -typedef QList<Bookmark> BookmarkGroup;
\ No newline at end of file diff --git a/src/panels/bookmarkstoolbar.cpp b/src/panels/bookmarkstoolbar.cpp index 7c3517ec..01a7db30 100644 --- a/src/panels/bookmarkstoolbar.cpp +++ b/src/panels/bookmarkstoolbar.cpp @@ -12,6 +12,8 @@ #include "bookmarks/bookmarkstreemodel.hpp" #include <QShowEvent> +constexpr int elide_width = 100; + BookmarkToolBar::BookmarkToolBar(QWidget *parent) : QToolBar(parent) { /* @@ -36,13 +38,16 @@ void BookmarkToolBar::showEvent(QShowEvent *event) Q_CHECK_PTR(model); clear(); + const auto metrics = fontMetrics(); - const auto *root = model->item(); + const auto *root = model->item(); // TODO get root of Bookmarks Toolbar item Q_CHECK_PTR(root); for (int i = 0; i < root->childCount(); ++i) { const auto *child = root->child(i); if (child->type() != BookmarksTreeItem::Bookmark) continue; - addAction(child->action(this, rekonq::CurrentTab)); + auto *action = child->action(this, rekonq::CurrentTab); + action->setText(metrics.elidedText(action->text(), Qt::ElideRight, elide_width)); + addAction(action); } event->accept(); |