mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
Show history & bookmark url in menu on mouse hover
BUG: 448238 Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
a779a018e1
commit
f5249f67db
@ -25,6 +25,7 @@
|
|||||||
#include "qzsettings.h"
|
#include "qzsettings.h"
|
||||||
#include "tabwidget.h"
|
#include "tabwidget.h"
|
||||||
#include "iconprovider.h"
|
#include "iconprovider.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
BookmarksMenu::BookmarksMenu(QWidget* parent)
|
BookmarksMenu::BookmarksMenu(QWidget* parent)
|
||||||
: Menu(parent)
|
: Menu(parent)
|
||||||
@ -93,6 +94,11 @@ void BookmarksMenu::menuAboutToShow()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BookmarksMenu::menuAboutToHide()
|
||||||
|
{
|
||||||
|
mApp->getWindow()->statusBar()->clearMessage();
|
||||||
|
}
|
||||||
|
|
||||||
void BookmarksMenu::menuMiddleClicked(Menu* menu)
|
void BookmarksMenu::menuMiddleClicked(Menu* menu)
|
||||||
{
|
{
|
||||||
BookmarkItem* item = static_cast<BookmarkItem*>(menu->menuAction()->data().value<void*>());
|
BookmarkItem* item = static_cast<BookmarkItem*>(menu->menuAction()->data().value<void*>());
|
||||||
@ -173,6 +179,7 @@ void BookmarksMenu::init()
|
|||||||
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
|
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
|
||||||
connect(this, SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow()));
|
connect(this, SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow()));
|
||||||
connect(this, SIGNAL(menuMiddleClicked(Menu*)), this, SLOT(menuMiddleClicked(Menu*)));
|
connect(this, SIGNAL(menuMiddleClicked(Menu*)), this, SLOT(menuMiddleClicked(Menu*)));
|
||||||
|
connect(this, &QMenu::aboutToHide, this, &BookmarksMenu::menuAboutToHide);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksMenu::refresh()
|
void BookmarksMenu::refresh()
|
||||||
|
@ -43,6 +43,7 @@ private Q_SLOTS:
|
|||||||
void bookmarksChanged();
|
void bookmarksChanged();
|
||||||
void aboutToShow();
|
void aboutToShow();
|
||||||
void menuAboutToShow();
|
void menuAboutToShow();
|
||||||
|
void menuAboutToHide();
|
||||||
void menuMiddleClicked(Menu* menu);
|
void menuMiddleClicked(Menu* menu);
|
||||||
|
|
||||||
void bookmarkActivated();
|
void bookmarkActivated();
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "qzsettings.h"
|
#include "qzsettings.h"
|
||||||
#include "browserwindow.h"
|
#include "browserwindow.h"
|
||||||
#include "sqldatabase.h"
|
#include "sqldatabase.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
@ -390,11 +391,15 @@ void BookmarksTools::addFolderToMenu(QObject* receiver, Menu* menu, BookmarkItem
|
|||||||
m->setTitle(title);
|
m->setTitle(title);
|
||||||
m->setIcon(folder->icon());
|
m->setIcon(folder->icon());
|
||||||
|
|
||||||
|
QObject::connect(m, &QMenu::aboutToHide, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
|
|
||||||
addFolderContentsToMenu(receiver, m, folder);
|
addFolderContentsToMenu(receiver, m, folder);
|
||||||
|
|
||||||
QAction* act = menu->addMenu(m);
|
QAction* act = menu->addMenu(m);
|
||||||
act->setData(QVariant::fromValue<void*>(static_cast<void*>(folder)));
|
act->setData(QVariant::fromValue<void*>(static_cast<void*>(folder)));
|
||||||
act->setIconVisibleInMenu(true);
|
act->setIconVisibleInMenu(true);
|
||||||
|
|
||||||
|
QObject::connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksTools::addUrlToMenu(QObject* receiver, Menu* menu, BookmarkItem* bookmark)
|
void BookmarksTools::addUrlToMenu(QObject* receiver, Menu* menu, BookmarkItem* bookmark)
|
||||||
@ -413,6 +418,10 @@ void BookmarksTools::addUrlToMenu(QObject* receiver, Menu* menu, BookmarkItem* b
|
|||||||
QObject::connect(act, SIGNAL(ctrlTriggered()), receiver, SLOT(bookmarkCtrlActivated()));
|
QObject::connect(act, SIGNAL(ctrlTriggered()), receiver, SLOT(bookmarkCtrlActivated()));
|
||||||
QObject::connect(act, SIGNAL(shiftTriggered()), receiver, SLOT(bookmarkShiftActivated()));
|
QObject::connect(act, SIGNAL(shiftTriggered()), receiver, SLOT(bookmarkShiftActivated()));
|
||||||
|
|
||||||
|
QObject::connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), [=]() {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(bookmark->url().toString());
|
||||||
|
});
|
||||||
|
|
||||||
menu->addAction(act);
|
menu->addAction(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +432,8 @@ void BookmarksTools::addSeparatorToMenu(Menu* menu, BookmarkItem* separator)
|
|||||||
Q_ASSERT(menu);
|
Q_ASSERT(menu);
|
||||||
Q_ASSERT(separator->isSeparator());
|
Q_ASSERT(separator->isSeparator());
|
||||||
|
|
||||||
menu->addSeparator();
|
auto* act = menu->addSeparator();
|
||||||
|
QObject::connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksTools::addFolderContentsToMenu(QObject *receiver, Menu *menu, BookmarkItem *folder)
|
void BookmarksTools::addFolderContentsToMenu(QObject *receiver, Menu *menu, BookmarkItem *folder)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "qzsettings.h"
|
#include "qzsettings.h"
|
||||||
#include "sqldatabase.h"
|
#include "sqldatabase.h"
|
||||||
#include "closedwindowsmanager.h"
|
#include "closedwindowsmanager.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QWebEngineHistory>
|
#include <QWebEngineHistory>
|
||||||
@ -104,12 +105,18 @@ void HistoryMenu::aboutToShow()
|
|||||||
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
|
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
|
||||||
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
|
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
|
||||||
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
|
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), [=]() {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(url.toString());
|
||||||
|
});
|
||||||
|
|
||||||
addAction(act);
|
addAction(act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMenu::aboutToHide()
|
void HistoryMenu::aboutToHide()
|
||||||
{
|
{
|
||||||
|
clearStatusbar();
|
||||||
|
|
||||||
// Enable Back/Forward actions to ensure shortcuts are working
|
// Enable Back/Forward actions to ensure shortcuts are working
|
||||||
actions().at(0)->setEnabled(true);
|
actions().at(0)->setEnabled(true);
|
||||||
actions().at(1)->setEnabled(true);
|
actions().at(1)->setEnabled(true);
|
||||||
@ -128,6 +135,10 @@ void HistoryMenu::aboutToShowMostVisited()
|
|||||||
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
|
connect(act, &QAction::triggered, this, &HistoryMenu::historyEntryActivated);
|
||||||
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
|
connect(act, &Action::ctrlTriggered, this, &HistoryMenu::historyEntryCtrlActivated);
|
||||||
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
|
connect(act, &Action::shiftTriggered, this, &HistoryMenu::historyEntryShiftActivated);
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), [=]() {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(entry.url.toString());
|
||||||
|
});
|
||||||
|
|
||||||
m_menuMostVisited->addAction(act);
|
m_menuMostVisited->addAction(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +242,11 @@ void HistoryMenu::openUrlInNewWindow(const QUrl &url)
|
|||||||
mApp->createWindow(Qz::BW_NewWindow, url);
|
mApp->createWindow(Qz::BW_NewWindow, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HistoryMenu::clearStatusbar()
|
||||||
|
{
|
||||||
|
mApp->getWindow()->statusBar()->clearMessage();
|
||||||
|
}
|
||||||
|
|
||||||
void HistoryMenu::init()
|
void HistoryMenu::init()
|
||||||
{
|
{
|
||||||
setTitle(tr("Hi&story"));
|
setTitle(tr("Hi&story"));
|
||||||
@ -254,6 +270,7 @@ void HistoryMenu::init()
|
|||||||
|
|
||||||
m_menuMostVisited = new Menu(tr("Most Visited"), this);
|
m_menuMostVisited = new Menu(tr("Most Visited"), this);
|
||||||
connect(m_menuMostVisited, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowMostVisited);
|
connect(m_menuMostVisited, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowMostVisited);
|
||||||
|
connect(m_menuMostVisited, &QMenu::aboutToHide, this, &HistoryMenu::clearStatusbar);
|
||||||
|
|
||||||
m_menuClosedTabs = new Menu(tr("Closed Tabs"));
|
m_menuClosedTabs = new Menu(tr("Closed Tabs"));
|
||||||
connect(m_menuClosedTabs, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedTabs);
|
connect(m_menuClosedTabs, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedTabs);
|
||||||
@ -261,7 +278,12 @@ void HistoryMenu::init()
|
|||||||
m_menuClosedWindows = new Menu(tr("Closed Windows"));
|
m_menuClosedWindows = new Menu(tr("Closed Windows"));
|
||||||
connect(m_menuClosedWindows, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedWindows);
|
connect(m_menuClosedWindows, &QMenu::aboutToShow, this, &HistoryMenu::aboutToShowClosedWindows);
|
||||||
|
|
||||||
addMenu(m_menuMostVisited);
|
act = addMenu(m_menuMostVisited);
|
||||||
addMenu(m_menuClosedTabs);
|
connect(act, &QAction::hovered, this, &HistoryMenu::clearStatusbar);
|
||||||
addMenu(m_menuClosedWindows);
|
|
||||||
|
act = addMenu(m_menuClosedTabs);
|
||||||
|
connect(act, &QAction::hovered, this, &HistoryMenu::clearStatusbar);
|
||||||
|
|
||||||
|
act = addMenu(m_menuClosedWindows);
|
||||||
|
connect(act, &QAction::hovered, this, &HistoryMenu::clearStatusbar);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,8 @@ private Q_SLOTS:
|
|||||||
void openUrlInNewTab(const QUrl &url);
|
void openUrlInNewTab(const QUrl &url);
|
||||||
void openUrlInNewWindow(const QUrl &url);
|
void openUrlInNewWindow(const QUrl &url);
|
||||||
|
|
||||||
|
void clearStatusbar();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "abstractbuttoninterface.h"
|
#include "abstractbuttoninterface.h"
|
||||||
#include "navigationbartoolbutton.h"
|
#include "navigationbartoolbutton.h"
|
||||||
#include "navigationbarconfigdialog.h"
|
#include "navigationbarconfigdialog.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QSplitter>
|
#include <QSplitter>
|
||||||
@ -382,6 +383,9 @@ void NavigationBar::aboutToShowHistoryBackMenu()
|
|||||||
act->setData(i);
|
act->setData(i);
|
||||||
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
|
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
|
||||||
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
|
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), [=]() {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(item.url().toString());
|
||||||
|
});
|
||||||
m_menuBack->addAction(act);
|
m_menuBack->addAction(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +396,9 @@ void NavigationBar::aboutToShowHistoryBackMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_menuBack->addSeparator();
|
m_menuBack->addSeparator();
|
||||||
m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
|
auto *act = m_menuBack->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
|
connect(m_menuBack, &QMenu::aboutToHide, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationBar::aboutToShowHistoryNextMenu()
|
void NavigationBar::aboutToShowHistoryNextMenu()
|
||||||
@ -416,6 +422,9 @@ void NavigationBar::aboutToShowHistoryNextMenu()
|
|||||||
act->setData(i);
|
act->setData(i);
|
||||||
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
|
connect(act, &QAction::triggered, this, &NavigationBar::loadHistoryIndex);
|
||||||
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
|
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadHistoryIndexInNewTab()));
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), [=]() {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(item.url().toString());
|
||||||
|
});
|
||||||
m_menuForward->addAction(act);
|
m_menuForward->addAction(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,7 +435,9 @@ void NavigationBar::aboutToShowHistoryNextMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_menuForward->addSeparator();
|
m_menuForward->addSeparator();
|
||||||
m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
|
auto *act = m_menuForward->addAction(QIcon::fromTheme(QSL("edit-clear")), tr("Clear history"), this, &NavigationBar::clearHistory);
|
||||||
|
connect(act, &QAction::hovered, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
|
connect(m_menuForward, &QMenu::aboutToHide, mApp->getWindow()->statusBar(), &StatusBar::clearMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationBar::aboutToShowToolsMenu()
|
void NavigationBar::aboutToShowToolsMenu()
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#include "bookmarks.h"
|
#include "bookmarks.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "iconprovider.h"
|
#include "iconprovider.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
|
#include "bookmarksmodel.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
@ -39,6 +42,9 @@ BookmarksSidebar::BookmarksSidebar(BrowserWindow* window, QWidget* parent)
|
|||||||
connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksSidebar::bookmarkShiftActivated);
|
connect(ui->tree, &BookmarksTreeView::bookmarkShiftActivated, this, &BookmarksSidebar::bookmarkShiftActivated);
|
||||||
connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksSidebar::createContextMenu);
|
connect(ui->tree, &BookmarksTreeView::contextMenuRequested, this, &BookmarksSidebar::createContextMenu);
|
||||||
|
|
||||||
|
connect(ui->tree, &BookmarksTreeView::bookmarksSelected, this, &BookmarksSidebar::onCurrentChanged);
|
||||||
|
connect(ui->tree, &QTreeView::entered, this, &BookmarksSidebar::onEntered);
|
||||||
|
|
||||||
connect(ui->search, &QLineEdit::textChanged, ui->tree, &BookmarksTreeView::search);
|
connect(ui->search, &QLineEdit::textChanged, ui->tree, &BookmarksTreeView::search);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,3 +146,30 @@ void BookmarksSidebar::showEvent(QShowEvent *event)
|
|||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
ui->search->setFocus();
|
ui->search->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BookmarksSidebar::onCurrentChanged(const QList<BookmarkItem*> &items)
|
||||||
|
{
|
||||||
|
if (items.count() > 0) {
|
||||||
|
auto item = items.first();
|
||||||
|
|
||||||
|
if (item->isUrl()) {
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(item->url().toString());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mApp->getWindow()->statusBar()->clearMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BookmarksSidebar::onEntered(const QModelIndex& index)
|
||||||
|
{
|
||||||
|
if (index.isValid()) {
|
||||||
|
if (index.data(BookmarksModel::TypeRole).toInt() == BookmarkItem::Url) {
|
||||||
|
auto url = index.data(BookmarksModel::UrlStringRole).toString();
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(url);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mApp->getWindow()->statusBar()->clearMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -52,6 +52,9 @@ private Q_SLOTS:
|
|||||||
void deleteBookmarks();
|
void deleteBookmarks();
|
||||||
void createContextMenu(const QPoint &pos);
|
void createContextMenu(const QPoint &pos);
|
||||||
|
|
||||||
|
void onCurrentChanged(const QList<BookmarkItem*> &items);
|
||||||
|
void onEntered(const QModelIndex& index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "qzsettings.h"
|
#include "qzsettings.h"
|
||||||
#include "iconprovider.h"
|
#include "iconprovider.h"
|
||||||
|
#include "historymodel.h"
|
||||||
|
#include "statusbar.h"
|
||||||
|
|
||||||
|
#include <QItemSelectionModel>
|
||||||
|
|
||||||
HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent)
|
HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
@ -37,6 +41,9 @@ HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent)
|
|||||||
connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistorySideBar::urlShiftActivated);
|
connect(ui->historyTree, &HistoryTreeView::urlShiftActivated, this, &HistorySideBar::urlShiftActivated);
|
||||||
connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistorySideBar::createContextMenu);
|
connect(ui->historyTree, &HistoryTreeView::contextMenuRequested, this, &HistorySideBar::createContextMenu);
|
||||||
|
|
||||||
|
connect(ui->historyTree, &QTreeView::entered, this, &HistorySideBar::showSidebarHint);
|
||||||
|
connect(ui->historyTree->selectionModel(), &QItemSelectionModel::currentChanged, this, &HistorySideBar::onCurrentChanged);
|
||||||
|
|
||||||
connect(ui->search, &QLineEdit::textEdited, ui->historyTree, &HistoryTreeView::search);
|
connect(ui->search, &QLineEdit::textEdited, ui->historyTree, &HistoryTreeView::search);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,6 +116,18 @@ void HistorySideBar::showEvent(QShowEvent *event)
|
|||||||
ui->search->setFocus();
|
ui->search->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HistorySideBar::onCurrentChanged(const QModelIndex& current, const QModelIndex& previous)
|
||||||
|
{
|
||||||
|
Q_UNUSED(previous)
|
||||||
|
showSidebarHint(current);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistorySideBar::showSidebarHint(const QModelIndex& index)
|
||||||
|
{
|
||||||
|
const QUrl url = index.data(HistoryModel::UrlRole).toUrl();
|
||||||
|
mApp->getWindow()->statusBar()->showMessage(url.toString());
|
||||||
|
}
|
||||||
|
|
||||||
HistorySideBar::~HistorySideBar()
|
HistorySideBar::~HistorySideBar()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
|
@ -50,6 +50,9 @@ private Q_SLOTS:
|
|||||||
|
|
||||||
void createContextMenu(const QPoint &pos);
|
void createContextMenu(const QPoint &pos);
|
||||||
|
|
||||||
|
void onCurrentChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
|
void showSidebarHint(const QModelIndex& index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user