rename: att -> att_browser
This commit is contained in:
+14
-6
@@ -88,7 +88,7 @@ BrowserWindow::BrowserWindow(const Session &session, const QUrl &startUrl, QWidg
|
||||
|
||||
void BrowserWindow::setupUi()
|
||||
{
|
||||
setWindowTitle(QStringLiteral("att"));
|
||||
setWindowTitle(QStringLiteral("att_browser"));
|
||||
resize(1280, 800);
|
||||
|
||||
auto *central = new QWidget(this);
|
||||
@@ -134,8 +134,8 @@ void BrowserWindow::connectView()
|
||||
setPageFullScreen(request.toggleOn());
|
||||
});
|
||||
connect(m_view, &QWebEngineView::titleChanged, this, [this](const QString &title) {
|
||||
setWindowTitle(title.isEmpty() ? QStringLiteral("att")
|
||||
: QStringLiteral("%1 - att").arg(title));
|
||||
setWindowTitle(title.isEmpty() ? QStringLiteral("att_browser")
|
||||
: QStringLiteral("%1 - att_browser").arg(title));
|
||||
m_session.history->updateTitle(m_view->url(), title);
|
||||
});
|
||||
connect(m_view, &QWebEngineView::loadFinished, this, [this](bool ok) {
|
||||
@@ -344,11 +344,11 @@ bool BrowserWindow::handleNormalModeKey(QKeyEvent *event)
|
||||
return true;
|
||||
}
|
||||
if (text == QLatin1String("j")) {
|
||||
scrollBy(0, kScrollStep);
|
||||
scrollByCssPx(0, config::kScrollStepPx);
|
||||
return true;
|
||||
}
|
||||
if (text == QLatin1String("k")) {
|
||||
scrollBy(0, -kScrollStep);
|
||||
scrollByCssPx(0, -config::kScrollStepPx);
|
||||
return true;
|
||||
}
|
||||
if (text == QLatin1String("h")) {
|
||||
@@ -500,7 +500,7 @@ void BrowserWindow::runCommand(const QString &command)
|
||||
} else if (name == QLatin1String("version")) {
|
||||
// The Chromium security patch level is what says how far behind
|
||||
// Chrome's fixes this build is; "nix flake update" moves it forward.
|
||||
m_status->showMessage(QStringLiteral("att %1, Qt %2, Chromium %3, security patches %4")
|
||||
m_status->showMessage(QStringLiteral("att_browser %1, Qt %2, Chromium %3, security patches %4")
|
||||
.arg(QCoreApplication::applicationVersion(),
|
||||
QString::fromLatin1(qVersion()),
|
||||
QString::fromLatin1(qWebEngineChromiumVersion()),
|
||||
@@ -655,6 +655,14 @@ void BrowserWindow::scrollBy(int dx, int dy)
|
||||
QCoreApplication::sendEvent(target, &event);
|
||||
}
|
||||
|
||||
void BrowserWindow::scrollByCssPx(int dx, int dy)
|
||||
{
|
||||
// Wheel deltas are screen pixels, which the page zoom shrinks (at 125% a
|
||||
// 25px wheel moves 20 CSS px). qutebrowser's scroll-px counts CSS pixels.
|
||||
const double zoom = m_view->zoomFactor();
|
||||
scrollBy(qRound(dx * zoom), qRound(dy * zoom));
|
||||
}
|
||||
|
||||
void BrowserWindow::scrollPages(double factor)
|
||||
{
|
||||
scrollBy(0, qRound(m_view->height() * factor));
|
||||
|
||||
Reference in New Issue
Block a user