mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Qt5: Added new option to use Caret Browsing
It can be enabled from Preferences -> Browsing, Menu View or with F7 shortcut.
This commit is contained in:
parent
44693080cb
commit
bdc9a0417a
|
@ -373,6 +373,7 @@ void MainApplication::loadSettings()
|
|||
m_websettings->setDefaultTextEncoding(settings.value("DefaultEncoding", m_websettings->defaultTextEncoding()).toString());
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_websettings->setAttribute(QWebSettings::CaretBrowsingEnabled, settings.value("CaretBrowsing", false).toBool());
|
||||
m_websettings->setAttribute(QWebSettings::ScrollAnimatorEnabled, settings.value("AnimateScrolling", true).toBool());
|
||||
#endif
|
||||
|
||||
|
|
|
@ -401,6 +401,12 @@ void QupZilla::setupMenu()
|
|||
m_menuEncoding = new QMenu(this);
|
||||
actionEncoding->setMenu(m_menuEncoding);
|
||||
connect(m_menuEncoding, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEncodingMenu()));
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_actionCaretBrowsing = new QAction(tr("Enable &Caret Browsing"), this);
|
||||
m_actionCaretBrowsing->setCheckable(true);
|
||||
m_actionCaretBrowsing->setShortcut(QKeySequence("F7"));
|
||||
connect(m_actionCaretBrowsing, SIGNAL(triggered()), this, SLOT(triggerCaretBrowsing()));
|
||||
#endif
|
||||
|
||||
QMenu* toolbarsMenu = new QMenu(tr("Toolbars"));
|
||||
#ifndef Q_OS_MAC
|
||||
|
@ -422,6 +428,9 @@ void QupZilla::setupMenu()
|
|||
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), this, SLOT(zoomOut()))->setShortcut(QKeySequence("Ctrl+-"));
|
||||
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), this, SLOT(zoomReset()))->setShortcut(QKeySequence("Ctrl+0"));
|
||||
m_menuView->addSeparator();
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_menuView->addAction(m_actionCaretBrowsing);
|
||||
#endif
|
||||
m_menuView->addAction(actionEncoding);
|
||||
m_menuView->addSeparator();
|
||||
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), this, SLOT(showSource()))->setShortcut(QKeySequence("Ctrl+U"));
|
||||
|
@ -969,6 +978,10 @@ void QupZilla::aboutToShowViewMenu()
|
|||
#endif
|
||||
m_actionShowStatusbar->setChecked(statusBar()->isVisible());
|
||||
m_actionShowBookmarksToolbar->setChecked(m_bookmarksToolbar->isVisible());
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_actionCaretBrowsing->setChecked(mApp->webSettings()->testAttribute(QWebSettings::CaretBrowsingEnabled));
|
||||
#endif
|
||||
}
|
||||
|
||||
void QupZilla::aboutToShowEditMenu()
|
||||
|
@ -1075,6 +1088,20 @@ void QupZilla::changeEncoding()
|
|||
}
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
void QupZilla::triggerCaretBrowsing()
|
||||
{
|
||||
bool enable = !mApp->webSettings()->testAttribute(QWebSettings::CaretBrowsingEnabled);
|
||||
|
||||
Settings settings;
|
||||
settings.beginGroup("Web-Browser-Settings");
|
||||
settings.setValue("CaretBrowsing", enable);
|
||||
settings.endGroup();
|
||||
|
||||
mApp->webSettings()->setAttribute(QWebSettings::CaretBrowsingEnabled, enable);
|
||||
}
|
||||
#endif
|
||||
|
||||
void QupZilla::bookmarkPage()
|
||||
{
|
||||
mApp->browsingLibrary()->bookmarksManager()->addBookmark(weView());
|
||||
|
|
|
@ -188,6 +188,10 @@ private slots:
|
|||
void fullScreen(bool make);
|
||||
void changeEncoding();
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
void triggerCaretBrowsing();
|
||||
#endif
|
||||
|
||||
void closeWindow();
|
||||
bool quitApp();
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -260,6 +264,7 @@ private:
|
|||
QAction* m_actionPrivateBrowsing;
|
||||
QAction* m_actionStop;
|
||||
QAction* m_actionReload;
|
||||
QAction* m_actionCaretBrowsing;
|
||||
QAction* m_actionRestoreTab;
|
||||
|
||||
QLabel* m_privateBrowsing;
|
||||
|
|
|
@ -244,6 +244,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||
ui->allowDNSPrefetch->setChecked(settings.value("DNS-Prefetch", false).toBool());
|
||||
ui->linksInFocusChain->setChecked(settings.value("IncludeLinkInFocusChain", false).toBool());
|
||||
ui->zoomTextOnly->setChecked(settings.value("zoomTextOnly", false).toBool());
|
||||
ui->caretBrowsing->setChecked(settings.value("CaretBrowsing", false).toBool());
|
||||
ui->animateScrolling->setChecked(settings.value("AnimateScrolling", true).toBool());
|
||||
ui->printEBackground->setChecked(settings.value("PrintElementBackground", true).toBool());
|
||||
ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt());
|
||||
|
@ -891,6 +892,7 @@ void Preferences::saveSettings()
|
|||
settings.setValue("JavaScriptCanAccessClipboard", ui->jscanAccessClipboard->isChecked());
|
||||
settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked());
|
||||
settings.setValue("zoomTextOnly", ui->zoomTextOnly->isChecked());
|
||||
settings.setValue("CaretBrowsing", ui->caretBrowsing->isChecked());
|
||||
settings.setValue("AnimateScrolling", ui->animateScrolling->isChecked());
|
||||
settings.setValue("PrintElementBackground", ui->printEBackground->isChecked());
|
||||
settings.setValue("wheelScrollLines", ui->wheelScroll->value());
|
||||
|
|
|
@ -1061,6 +1061,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="caretBrowsing">
|
||||
<property name="text">
|
||||
<string>Enable caret browsing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="zoomTextOnly">
|
||||
<property name="text">
|
||||
|
|
Loading…
Reference in New Issue
Block a user