mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
Ladybird: Replace StatusBar with ToolTip
This gives the actual webcontent more space to work with, it also emulates how other browsers does it. In the future we'd like to do something else since only ToolTip can be visible at the same time.
This commit is contained in:
parent
bfc9057638
commit
d1d6a204fc
2 changed files with 9 additions and 4 deletions
|
@ -9,7 +9,8 @@
|
|||
#include "BrowserWindow.h"
|
||||
#include "History.h"
|
||||
#include <QCoreApplication>
|
||||
#include <QStatusBar>
|
||||
#include <QPoint>
|
||||
#include <QToolTip>
|
||||
|
||||
extern String s_serenity_resource_root;
|
||||
|
||||
|
@ -48,8 +49,13 @@ Tab::Tab(QMainWindow* window)
|
|||
m_toolbar->addAction(m_home_action);
|
||||
m_toolbar->addWidget(m_location_edit);
|
||||
|
||||
QObject::connect(m_view, &WebView::linkHovered, m_window->statusBar(), &QStatusBar::showMessage);
|
||||
QObject::connect(m_view, &WebView::linkUnhovered, m_window->statusBar(), &QStatusBar::clearMessage);
|
||||
QObject::connect(m_view, &WebView::linkHovered, [this](QString const& title) {
|
||||
const QPoint* pos = new QPoint(0, size().height() - 15);
|
||||
QToolTip::showText(*pos, title, this);
|
||||
});
|
||||
QObject::connect(m_view, &WebView::linkUnhovered, [this] {
|
||||
QToolTip::hideText();
|
||||
});
|
||||
|
||||
QObject::connect(m_view, &WebView::loadStarted, [this](const URL& url) {
|
||||
m_location_edit->setText(url.to_string().characters());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue