Added some keyboard shortcuts.

This commit is contained in:
Martin Rotter 2016-06-21 07:55:47 +02:00
parent 2774ffb655
commit 40d6f2d70a
8 changed files with 39 additions and 1 deletions

View File

@ -5,6 +5,8 @@ Added:
▪ Internal message viewer is now based on QtWebEngine module which is based on Chromium project. This speeds up viewing of messages and supports newest HTML 5 or CSS 3 features. Note that this does not mean that fully featured internal web browser will come back. It will not! Only SIMPLIFIED internal web browser is now added. New message viewer is also better for viewing messages in newspaper mode.
▪ Default skin now uses Bootrstrap-powered look.
▪ Feed updates are now parallelized up to infinite number of threads. This speeds up speed of concurrent feed updates rapidly (more than 5 times). I was able to update about 160 feeds in 35 seconds. Note that this feature is still in experimental state.
▪ Middle mouse button click on any message in message list opens message in internal web browser, double click in external web browser.
▪ Any middle mouse button click on hyperlink opens it in new internal web browser tab.
Changed:
▪ Minimal Qt version bumped to 5.7.0 - this will lead to some betere features in the future.

View File

@ -137,6 +137,9 @@ QList<QAction*> FormMain::allActions() const {
actions << m_ui->m_actionSelectPreviousMessage;
actions << m_ui->m_actionSelectNextUnreadMessage;
actions << m_ui->m_actionExpandCollapseItem;
actions << m_ui->m_actionTabNewWebBrowser;
actions << m_ui->m_actionTabsCloseAll;
actions << m_ui->m_actionTabsCloseAllExceptCurrent;
return actions;
}

View File

@ -710,6 +710,9 @@
<property name="text">
<string>New web browser tab</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+T</string>
</property>
</action>
<action name="m_actionTabsCloseAll">
<property name="text">

View File

@ -186,6 +186,24 @@ void MessagesView::mousePressEvent(QMouseEvent *event) {
break;
}
case Qt::MiddleButton: {
// Make sure that message importance is switched when user
// clicks the "important" column.
const QModelIndex clicked_index = indexAt(event->pos());
if (clicked_index.isValid()) {
const QModelIndex mapped_index = m_proxyModel->mapToSource(clicked_index);
const QString url = m_sourceModel->messageAt(mapped_index.row()).m_url;
if (!url.isEmpty()) {
qApp->mainForm()->tabWidget()->addLinkedBrowser(url);
}
}
break;
}
default:
break;
}

View File

@ -206,7 +206,7 @@ int TabWidget::addEmptyBrowser() {
}
int TabWidget::addLinkedBrowser(const QUrl &initial_url) {
return addBrowser(true, false, initial_url);
return addBrowser(false, false, initial_url);
}
int TabWidget::addLinkedBrowser(const QString &initial_url) {

View File

@ -50,6 +50,10 @@ class WebBrowser : public TabContent {
return const_cast<WebBrowser*>(this);
}
WebViewer *viewer() const {
return m_webView;
}
void reloadFontSettings();
public slots:

View File

@ -21,6 +21,9 @@
#include "miscellaneous/application.h"
#include "definitions/definitions.h"
#include "network-web/webpage.h"
#include "gui/dialogs/formmain.h"
#include "gui/tabwidget.h"
#include "gui/webbrowser.h"
#include <QWheelEvent>
@ -118,6 +121,10 @@ void WebViewer::clear() {
setHtml("<!DOCTYPE html><html><body</body></html>", QUrl(INTERNAL_URL_BLANK));
}
QWebEngineView *WebViewer::createWindow(QWebEnginePage::WebWindowType type) {
return qApp->mainForm()->tabWidget()->widget(qApp->mainForm()->tabWidget()->addBrowser(false, false))->webBrowser()->viewer();
}
void WebViewer::wheelEvent(QWheelEvent *event) {
QWebEngineView::wheelEvent(event);

View File

@ -45,6 +45,7 @@ class WebViewer : public QWebEngineView {
void clear();
protected:
QWebEngineView *createWindow(QWebEnginePage::WebWindowType type);
void wheelEvent(QWheelEvent *event);
signals: