summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-20 21:11:38 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-20 21:11:38 +0300
commit0389574eb794a36915cb8d7fc69d756aca20d69b (patch)
tree4659e5cfaaa5052304ff0f506ade4297671778f0
parentRekonqWindow: rename loadUrl slots (diff)
downloadrekonq-0389574eb794a36915cb8d7fc69d756aca20d69b.tar.xz
BookmarksToolBar: elide action title
-rw-r--r--src/bookmarks/CMakeLists.txt1
-rw-r--r--src/bookmarks/bookmark.cpp1
-rw-r--r--src/bookmarks/bookmark.hpp13
-rw-r--r--src/panels/bookmarkstoolbar.cpp9
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();