Replace scroll{up,down,left,right} by scroll cmd

This commit is contained in:
Florian Bruhin 2014-01-20 17:01:52 +01:00
parent 1a6907b4b0
commit 5fce707bb2
3 changed files with 9 additions and 40 deletions

View File

@ -120,10 +120,7 @@ class QuteBrowser(QApplication):
'back': self.mainwindow.tabs.cur_back,
'forward': self.mainwindow.tabs.cur_forward,
'print': self.mainwindow.tabs.cur_print,
'scrolldown': self.mainwindow.tabs.cur_scroll_down,
'scrollup': self.mainwindow.tabs.cur_scroll_up,
'scrollleft': self.mainwindow.tabs.cur_scroll_left,
'scrollright': self.mainwindow.tabs.cur_scroll_right,
'scroll': self.mainwindow.tabs.cur_scroll,
'scrollstart': self.mainwindow.tabs.cur_scroll_start,
'scrollend': self.mainwindow.tabs.cur_scroll_end,
'undo': self.mainwindow.tabs.undo_close,

View File

@ -49,20 +49,8 @@ class Forward(Command):
class Print(Command):
nargs = 0
class ScrollLeft(Command):
nargs = 0
count = True
class ScrollDown(Command):
nargs = 0
count = True
class ScrollUp(Command):
nargs = 0
count = True
class ScrollRight(Command):
nargs = 0
class Scroll(Command):
nargs = 2
count = True
class Undo(Command):

View File

@ -84,29 +84,13 @@ class TabbedBrowser(TabWidget):
# FIXME display warning if end of history
self.currentWidget().forward()
def cur_scroll_down(self, count=None):
"""Scrolls the current tab down"""
def cur_scroll(self, dx, dy, count=None):
"""Scrolls the current tab by count * dx/dy"""
if count is None:
count = 50
self.currentWidget().page().mainFrame().scroll(0, count)
def cur_scroll_up(self, count=None):
"""Scrolls the current tab up"""
if count is None:
count = 50
self.currentWidget().page().mainFrame().scroll(0, -count)
def cur_scroll_left(self, count=None):
"""Scrolls the current tab left"""
if count is None:
count = 50
self.currentWidget().page().mainFrame().scroll(-count, 0)
def cur_scroll_right(self, count=None):
"""Scrolls the current tab right"""
if count is None:
count = 50
self.currentWidget().page().mainFrame().scroll(count, 0)
count = 1
dx = int(count) * int(dx)
dy = int(count) * int(dy)
self.currentWidget().page().mainFrame().scroll(dx, dy)
def cur_scroll_start(self):
"""Scrolls the current tab to the beginning"""