projects
/
ejpi
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
201ed96
)
Fixing scroll to bottom on startup
author
Ed Page
<eopage@byu.net>
Thu, 13 Jan 2011 02:43:01 +0000
(20:43 -0600)
committer
Ed Page
<eopage@byu.net>
Thu, 13 Jan 2011 03:06:16 +0000
(21:06 -0600)
src/ejpi_qt.py
patch
|
blob
|
history
src/qhistory.py
patch
|
blob
|
history
diff --git
a/src/ejpi_qt.py
b/src/ejpi_qt.py
index
1c79d9d
..
82cd74e
100755
(executable)
--- a/
src/ejpi_qt.py
+++ b/
src/ejpi_qt.py
@@
-218,6
+218,12
@@
class MainWindow(qwrappers.WindowWrapper):
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Computer"))
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Alphabet"))
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Computer"))
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Alphabet"))
+ self._scrollTimer = QtCore.QTimer()
+ self._scrollTimer.setInterval(0)
+ self._scrollTimer.setSingleShot(True)
+ self._scrollTimer.timeout.connect(self._on_delayed_scroll_to_bottom)
+ self._scrollTimer.start()
+
self.set_fullscreen(self._app.fullscreenAction.isChecked())
self.set_orientation(self._app.orientationAction.isChecked())
self.set_fullscreen(self._app.fullscreenAction.isChecked())
self.set_orientation(self._app.orientationAction.isChecked())
@@
-286,6
+292,11
@@
class MainWindow(qwrappers.WindowWrapper):
f.write("%s\n" % line)
@misc_utils.log_exception(_moduleLogger)
f.write("%s\n" % line)
@misc_utils.log_exception(_moduleLogger)
+ def _on_delayed_scroll_to_bottom(self):
+ with qui_utils.notify_error(self._app.errorLog):
+ self._historyView.scroll_to_bottom()
+
+ @misc_utils.log_exception(_moduleLogger)
def _on_child_close(self, something = None):
with qui_utils.notify_error(self._app.errorLog):
self._child = None
def _on_child_close(self, something = None):
with qui_utils.notify_error(self._app.errorLog):
self._child = None
diff --git
a/src/qhistory.py
b/src/qhistory.py
index
759ba49
..
fdd48dd
100644
(file)
--- a/
src/qhistory.py
+++ b/
src/qhistory.py
@@
-86,7
+86,7
@@
class QCalcHistory(history.AbstractHistory):
self._historyStore.appendRow(row)
index = result.index()
self._historyStore.appendRow(row)
index = result.index()
- self._historyView.scrollTo(index)
+ self._historyView.scrollToBottom()
self._rowCount += 1
def pop(self):
self._rowCount += 1
def pop(self):
@@
-111,6
+111,9
@@
class QCalcHistory(history.AbstractHistory):
self._historyStore.clear()
self._rowCount = 0
self._historyStore.clear()
self._rowCount = 0
+ def scroll_to_bottom(self):
+ self._historyView.scrollToBottom()
+
@misc_utils.log_exception(_moduleLogger)
def _on_row_activated(self, index):
with qui_utils.notify_error(self._errorLog):
@misc_utils.log_exception(_moduleLogger)
def _on_row_activated(self, index):
with qui_utils.notify_error(self._errorLog):