JBrowser Source Docs
You are reading the documentation for JBrowser 2.0.1. The newest release is 2.0.3. Go to the latest documentation

jbrowser.ui.reader_view

Generated from the source code of JBrowser 2.0.1.

jbrowser/ui/reader_view.py · 445 lines

Reading mode inside a card, and the small offer that suggests it on articles.

ReaderView shows the article that engine/reader.py pulled out of the page, in its own page with no website scripts. The real page stays loaded underneath, so leaving reading mode is instant and the card's history is untouched.

Constants#

Name Value
NT QWebEnginePage.NavigationType
SWATCHES {'light': '#ffffff', 'sepia': '#f1e7d0', 'dark': '#26262c'}

ReaderWeb#

class ReaderWeb(QWebEngineView)source
ReaderWeb(view: 'ReaderView')

The article view, with a short menu of its own (copy, links), not the engine's page menu.

Qt overrides: contextMenuEvent

ReaderPage#

class ReaderPage(QWebEnginePage)source
ReaderPage(view: 'ReaderView')

ReaderPage.acceptNavigationRequest#

acceptNavigationRequest(url: QUrl, nav_type, is_main_frame: bool) -> boolsource

ReaderPage.createWindow#

createWindow(_type) -> QWebEnginePagesource

ReaderPage.javaScriptConsoleMessage#

javaScriptConsoleMessage(*_a) -> Nonesource

ReaderBar#

class ReaderBar(QWidget)source
ReaderBar(view: 'ReaderView')

Slim bar over the article: text style, size, colours and the way out.

ReaderBar.sync#

sync() -> Nonesource

Qt overrides: resizeEvent, paintEvent

ReaderView#

class ReaderView(QWidget)source
ReaderView(card: 'WebCard')

ReaderView.show_article#

show_article(article: dict, url: str) -> Nonesource

ReaderView.zoom#

zoom() -> floatsource

ReaderView.set_zoom#

set_zoom(z: float) -> Nonesource

ReaderView.step_zoom#

step_zoom(direction: int) -> Nonesource

ReaderView.toggle_font#

toggle_font() -> Nonesource

ReaderView.set_theme#

set_theme(key: str) -> Nonesource
follow_link(url: QUrl) -> Nonesource

A link in the article: leave reading mode and open it in the card, like on the page.

ReaderView.leave#

leave() -> Nonesource

ReaderView.focus#

focus() -> Nonesource

ReaderView.dispose#

dispose() -> Nonesource

ReadingOffer#

class ReadingOffer(QFrame)source
ReadingOffer(card: 'WebCard')

"This looks like an article": appears over the page, offers reading mode, never blocks the page.

ReadingOffer.place#

place() -> Nonesource

ReadingOffer.present#

present() -> Nonesource

ReadingOffer.dismiss#

dismiss() -> Nonesource

Qt overrides: paintEvent, showEvent