aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bookmarks/bookmarksform.ui30
-rw-r--r--lib/bookmarks/bookmarksview.cpp5
-rw-r--r--lib/bookmarks/bookmarksview.h1
-rw-r--r--lib/bookmarks/bookmarkswidget.cpp4
-rw-r--r--lib/web/webprofile.h8
5 files changed, 28 insertions, 20 deletions
diff --git a/lib/bookmarks/bookmarksform.ui b/lib/bookmarks/bookmarksform.ui
index db1a85e..491bdc3 100644
--- a/lib/bookmarks/bookmarksform.ui
+++ b/lib/bookmarks/bookmarksform.ui
@@ -17,30 +17,36 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <widget class="QToolButton" name="addFolder_toolButton">
- <property name="text">
- <string>...</string>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- </widget>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</item>
<item>
- <widget class="QToolButton" name="addBookmark_toolButton">
+ <widget class="QToolButton" name="addFolder_toolButton">
<property name="text">
- <string>...</string>
+ <string>Add Folder</string>
</property>
</widget>
</item>
<item>
- <widget class="QToolButton" name="addSeparator_toolButton">
+ <widget class="QToolButton" name="addBookmark_toolButton">
<property name="text">
- <string>...</string>
+ <string>Add Bookmark</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteItem_toolButton">
<property name="text">
- <string>...</string>
+ <string>Delete Item</string>
</property>
</widget>
</item>
@@ -63,6 +69,12 @@
<property name="columnCount">
<number>2</number>
</property>
+ <attribute name="headerDefaultSectionSize">
+ <number>200</number>
+ </attribute>
+ <attribute name="headerMinimumSectionSize">
+ <number>100</number>
+ </attribute>
<column>
<property name="text">
<string notr="true">Title</string>
diff --git a/lib/bookmarks/bookmarksview.cpp b/lib/bookmarks/bookmarksview.cpp
index e427c2f..a92a3a7 100644
--- a/lib/bookmarks/bookmarksview.cpp
+++ b/lib/bookmarks/bookmarksview.cpp
@@ -45,5 +45,8 @@ QTreeWidgetItem *BookmarksView::createFolder(QTreeWidgetItem *parentItem)
BookmarksView::Type BookmarksView::itemType(QTreeWidgetItem *item) const
{
+ if(item == nullptr)
+ return Invalid;
+
return item->data(0, Qt::UserRole).value<Type>();
-} \ No newline at end of file
+}
diff --git a/lib/bookmarks/bookmarksview.h b/lib/bookmarks/bookmarksview.h
index 47b3f9c..f99fd2a 100644
--- a/lib/bookmarks/bookmarksview.h
+++ b/lib/bookmarks/bookmarksview.h
@@ -17,6 +17,7 @@ class BookmarksView : public QTreeWidget
public:
enum Type {
+ Invalid,
Folder,
Bookmark
};
diff --git a/lib/bookmarks/bookmarkswidget.cpp b/lib/bookmarks/bookmarkswidget.cpp
index f56c53b..a027518 100644
--- a/lib/bookmarks/bookmarkswidget.cpp
+++ b/lib/bookmarks/bookmarkswidget.cpp
@@ -17,7 +17,6 @@ BookmarksWidget::BookmarksWidget(const QString &path, QWidget *parent)
{
// make sure this dialog does not get deleted on close
setAttribute(Qt::WA_DeleteOnClose, false);
- setWindowTitle(tr("Bookmarks"));
ui->setupUi(this);
ui->bookmark_groupBox->setVisible(false);
@@ -43,7 +42,8 @@ BookmarksWidget::BookmarksWidget(const QString &path, QWidget *parent)
// open bookmark action
connect(ui->treeWidget, &QTreeWidget::itemActivated, this, [this](QTreeWidgetItem *item, int column) {
- emit openUrl(QUrl::fromUserInput(item->text(1)));
+ if(ui->treeWidget->itemType(item) == BookmarksView::Bookmark)
+ emit openUrl(QUrl::fromUserInput(item->text(1)));
});
// add bookmark action
diff --git a/lib/web/webprofile.h b/lib/web/webprofile.h
index 7a747a3..f4d31e6 100644
--- a/lib/web/webprofile.h
+++ b/lib/web/webprofile.h
@@ -81,15 +81,7 @@ public:
void setSpellCheckEnabled(bool enable);
- void addBookmark(const QString &title, const QString &url)
- {
- if(!title.isEmpty() && !url.isEmpty())
- emit addBookmarkRequested(title, url);
- }
-
signals:
- void addBookmarkRequested(const QString &title, const QString &url);
-
void searchChanged(const QString &url);
void homepageChanged(const QUrl &url);
void newtabChanged(const QUrl &url);