Add class docstrings for webkittab/webenginetab
This commit is contained in:
parent
de60ad04dc
commit
df2c50aa60
@ -35,6 +35,8 @@ from qutebrowser.utils import usertypes, qtutils
|
|||||||
|
|
||||||
class WebEngineSearch(tab.AbstractSearch):
|
class WebEngineSearch(tab.AbstractSearch):
|
||||||
|
|
||||||
|
"""QtWebEngine implementations related to searching on the page."""
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
pass
|
pass
|
||||||
@ -42,6 +44,8 @@ class WebEngineSearch(tab.AbstractSearch):
|
|||||||
|
|
||||||
class WebEngineCaret(tab.AbstractCaret):
|
class WebEngineCaret(tab.AbstractCaret):
|
||||||
|
|
||||||
|
"""QtWebEngine implementations related to moving the cursor/selection."""
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
@pyqtSlot(usertypes.KeyMode)
|
@pyqtSlot(usertypes.KeyMode)
|
||||||
@ -65,6 +69,8 @@ class WebEngineCaret(tab.AbstractCaret):
|
|||||||
|
|
||||||
class WebEngineScroller(tab.AbstractScroller):
|
class WebEngineScroller(tab.AbstractScroller):
|
||||||
|
|
||||||
|
"""QtWebEngine implementations related to scrolling."""
|
||||||
|
|
||||||
def _key_press(self, key, count=1):
|
def _key_press(self, key, count=1):
|
||||||
# FIXME Abort scrolling if the minimum/maximum was reached.
|
# FIXME Abort scrolling if the minimum/maximum was reached.
|
||||||
press_evt = QKeyEvent(QEvent.KeyPress, key, Qt.NoModifier, 0, 0, 0)
|
press_evt = QKeyEvent(QEvent.KeyPress, key, Qt.NoModifier, 0, 0, 0)
|
||||||
@ -117,6 +123,8 @@ class WebEngineScroller(tab.AbstractScroller):
|
|||||||
|
|
||||||
class WebEngineHistory(tab.AbstractHistory):
|
class WebEngineHistory(tab.AbstractHistory):
|
||||||
|
|
||||||
|
"""QtWebEngine implementations related to page history."""
|
||||||
|
|
||||||
def current_idx(self):
|
def current_idx(self):
|
||||||
return self._history.currentItemIndex()
|
return self._history.currentItemIndex()
|
||||||
|
|
||||||
@ -145,6 +153,8 @@ class WebEngineHistory(tab.AbstractHistory):
|
|||||||
|
|
||||||
class WebEngineZoom(tab.AbstractZoom):
|
class WebEngineZoom(tab.AbstractZoom):
|
||||||
|
|
||||||
|
"""QtWebEngine implementations related to zooming."""
|
||||||
|
|
||||||
def _set_factor_internal(self, factor):
|
def _set_factor_internal(self, factor):
|
||||||
self._widget.setZoomFactor(factor)
|
self._widget.setZoomFactor(factor)
|
||||||
|
|
||||||
@ -154,6 +164,8 @@ class WebEngineZoom(tab.AbstractZoom):
|
|||||||
|
|
||||||
class WebEngineViewTab(tab.AbstractTab):
|
class WebEngineViewTab(tab.AbstractTab):
|
||||||
|
|
||||||
|
"""A QtWebEngine tab in the browser."""
|
||||||
|
|
||||||
def __init__(self, win_id, modeman, parent=None):
|
def __init__(self, win_id, modeman, parent=None):
|
||||||
super().__init__(win_id)
|
super().__init__(win_id)
|
||||||
widget = webview.WebEngineView()
|
widget = webview.WebEngineView()
|
||||||
|
@ -36,6 +36,8 @@ from qutebrowser.utils import qtutils, objreg, usertypes, utils
|
|||||||
|
|
||||||
class WebViewSearch(tabmod.AbstractSearch):
|
class WebViewSearch(tabmod.AbstractSearch):
|
||||||
|
|
||||||
|
"""QtWebKit implementations related to searching on the page."""
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
# We first clear the marked text, then the highlights
|
# We first clear the marked text, then the highlights
|
||||||
self._widget.search('', 0)
|
self._widget.search('', 0)
|
||||||
@ -76,6 +78,8 @@ class WebViewSearch(tabmod.AbstractSearch):
|
|||||||
|
|
||||||
class WebViewCaret(tabmod.AbstractCaret):
|
class WebViewCaret(tabmod.AbstractCaret):
|
||||||
|
|
||||||
|
"""QtWebKit implementations related to moving the cursor/selection."""
|
||||||
|
|
||||||
@pyqtSlot(usertypes.KeyMode)
|
@pyqtSlot(usertypes.KeyMode)
|
||||||
def on_mode_entered(self, mode):
|
def on_mode_entered(self, mode):
|
||||||
if mode != usertypes.KeyMode.caret:
|
if mode != usertypes.KeyMode.caret:
|
||||||
@ -294,6 +298,8 @@ class WebViewCaret(tabmod.AbstractCaret):
|
|||||||
|
|
||||||
class WebViewZoom(tabmod.AbstractZoom):
|
class WebViewZoom(tabmod.AbstractZoom):
|
||||||
|
|
||||||
|
"""QtWebKit implementations related to zooming."""
|
||||||
|
|
||||||
def _set_factor_internal(self, factor):
|
def _set_factor_internal(self, factor):
|
||||||
self._widget.setZoomFactor(factor)
|
self._widget.setZoomFactor(factor)
|
||||||
|
|
||||||
@ -303,6 +309,8 @@ class WebViewZoom(tabmod.AbstractZoom):
|
|||||||
|
|
||||||
class WebViewScroller(tabmod.AbstractScroller):
|
class WebViewScroller(tabmod.AbstractScroller):
|
||||||
|
|
||||||
|
"""QtWebKit implementations related to scrolling."""
|
||||||
|
|
||||||
def pos_px(self):
|
def pos_px(self):
|
||||||
return self._widget.page().mainFrame().scrollPosition()
|
return self._widget.page().mainFrame().scrollPosition()
|
||||||
|
|
||||||
@ -396,6 +404,8 @@ class WebViewScroller(tabmod.AbstractScroller):
|
|||||||
|
|
||||||
class WebViewHistory(tabmod.AbstractHistory):
|
class WebViewHistory(tabmod.AbstractHistory):
|
||||||
|
|
||||||
|
"""QtWebKit implementations related to page history."""
|
||||||
|
|
||||||
def current_idx(self):
|
def current_idx(self):
|
||||||
return self._history.currentItemIndex()
|
return self._history.currentItemIndex()
|
||||||
|
|
||||||
@ -434,6 +444,8 @@ class WebViewHistory(tabmod.AbstractHistory):
|
|||||||
|
|
||||||
class WebViewTab(tabmod.AbstractTab):
|
class WebViewTab(tabmod.AbstractTab):
|
||||||
|
|
||||||
|
"""A QtWebKit tab in the browser."""
|
||||||
|
|
||||||
def __init__(self, win_id, modeman, parent=None):
|
def __init__(self, win_id, modeman, parent=None):
|
||||||
super().__init__(win_id)
|
super().__init__(win_id)
|
||||||
widget = webview.WebView(win_id, self.tab_id, tab=self)
|
widget = webview.WebView(win_id, self.tab_id, tab=self)
|
||||||
|
Loading…
Reference in New Issue
Block a user