Verified Commit 9359128c authored by Todd Weaver's avatar Todd Weaver
Browse files

Scrolling and focus grabbing

Line-wrap long error messages
parent 7722ed16
......@@ -362,6 +362,9 @@ class ResultsBox(Gtk.Box):
self.poster_image.set_size_request(width, height)
self.video_widget.set_size_request(width, height)
def delay_grab(self):
self.grab_focus()
@Gtk.Template.Callback()
def fullscreen_button(self, button):
self.fullscreen.set_visible(False)
......@@ -381,11 +384,14 @@ class ResultsBox(Gtk.Box):
results_context.remove_class("results")
results_context.add_class("fullscreen")
# grabbing happens before resize completes
# adding a slight delay to grab focus after resize completes
GLib.timeout_add(50, self.delay_grab)
# horizonal scrollbar, vertical scrollbar (do last)
scroller = self.app_window.scroller_stack.get_visible_child()
scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.EXTERNAL)
self.grab_focus()
scroller.set_kinetic_scrolling(False)
@Gtk.Template.Callback()
def unfullscreen_button(self, button):
......@@ -410,6 +416,7 @@ class ResultsBox(Gtk.Box):
scroller = self.app_window.scroller_stack.get_visible_child()
scroller.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroller.set_kinetic_scrolling(True)
self.grab_focus()
......
......@@ -57,6 +57,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">12</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Error</property>
<attributes>
<attribute name="weight" value="bold"/>
......@@ -74,6 +75,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">6</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">...</property>
</object>
<packing>
......
......@@ -234,6 +234,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">12</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">Error</property>
<attributes>
<attribute name="weight" value="bold"/>
......@@ -251,6 +252,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">6</property>
<property name="wrap">True</property>
<property name="label" translatable="yes">...</property>
</object>
<packing>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment