| ... |
... |
@@ -12,6 +12,8 @@ |
|
12
|
12
|
# You should have received a copy of the GNU General Public License
|
|
13
|
13
|
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
|
14
|
14
|
|
|
|
15
|
+from __future__ import annotations
|
|
|
16
|
+
|
|
15
|
17
|
from typing import Optional
|
|
16
|
18
|
|
|
17
|
19
|
from gi.repository import Gtk
|
| ... |
... |
@@ -35,8 +37,8 @@ class ScrolledView(Gtk.ScrolledWindow): |
|
35
|
37
|
)
|
|
36
|
38
|
}
|
|
37
|
39
|
|
|
38
|
|
- def __init__(self, *args, **kwargs):
|
|
39
|
|
- Gtk.ScrolledWindow.__init__(self, *args, **kwargs)
|
|
|
40
|
+ def __init__(self) -> None:
|
|
|
41
|
+ Gtk.ScrolledWindow.__init__(self)
|
|
40
|
42
|
|
|
41
|
43
|
self.set_overlay_scrolling(False)
|
|
42
|
44
|
self.get_style_context().add_class('scrolled-no-border')
|
| ... |
... |
@@ -56,7 +58,7 @@ def __init__(self, *args, **kwargs): |
|
56
|
58
|
# horizontally under certain conditions (applies to GroupchatControl)
|
|
57
|
59
|
self.get_hscrollbar().hide()
|
|
58
|
60
|
|
|
59
|
|
- self._current_upper: int = 0
|
|
|
61
|
+ self._current_upper: float = 0
|
|
60
|
62
|
self._autoscroll: bool = True
|
|
61
|
63
|
self._request_history_at_upper: Optional[float] = None
|
|
62
|
64
|
self._upper_complete: bool = False
|
| ... |
... |
@@ -91,7 +93,10 @@ def set_history_complete(self, before: bool, complete: bool) -> None: |
|
91
|
93
|
def get_lower_complete(self) -> bool:
|
|
92
|
94
|
return self._lower_complete
|
|
93
|
95
|
|
|
94
|
|
- def _on_adj_upper_changed(self, adj, *args):
|
|
|
96
|
+ def _on_adj_upper_changed(self,
|
|
|
97
|
+ adj: Gtk.Adjustment,
|
|
|
98
|
+ _pspec: GObject.ParamSpec) -> None:
|
|
|
99
|
+
|
|
95
|
100
|
upper = adj.get_upper()
|
|
96
|
101
|
diff = upper - self._current_upper
|
|
97
|
102
|
|
| ... |
... |
@@ -114,7 +119,10 @@ def _on_adj_upper_changed(self, adj, *args): |
|
114
|
119
|
self.emit('autoscroll-changed', self._autoscroll)
|
|
115
|
120
|
self._requesting = None
|
|
116
|
121
|
|
|
117
|
|
- def _on_adj_value_changed(self, adj, *args):
|
|
|
122
|
+ def _on_adj_value_changed(self,
|
|
|
123
|
+ adj: Gtk.Adjustment,
|
|
|
124
|
+ _pspec: GObject.ParamSpec) -> None:
|
|
|
125
|
+
|
|
118
|
126
|
if self._requesting is not None:
|
|
119
|
127
|
return
|
|
120
|
128
|
|