make headerbar autohidding toggeable

ft.font-size
Manuel Genovés 2018-12-06 14:29:10 +01:00
parent d664308efd
commit 4bb6862f0e
2 changed files with 11 additions and 2 deletions

View File

@ -21,6 +21,13 @@
It can cause performance problems to some users
</description>
</key>
<key name='poll-motion' type='b'>
<default>true</default>
<summary>Allow Uberwriter to poll cursor motion</summary>
<description>
Used for hidding the headerbar after 3 seconds if the cursor is not moving.
</description>
</key>
<key name='open-file-path' type='s'>
<default>"/tmp"</default>
<summary>Open file base path</summary>

View File

@ -104,8 +104,10 @@ class UberwriterWindow(Gtk.ApplicationWindow):
self.status_bar_visible = True
self.was_motion = True
self.buffer_modified_for_status_bar = False
self.connect("motion-notify-event", self.on_motion_notify)
GObject.timeout_add(3000, self.poll_for_motion)
if self.settings.get_value("poll-motion"):
self.connect("motion-notify-event", self.on_motion_notify)
GObject.timeout_add(3000, self.poll_for_motion)
self.accel_group = Gtk.AccelGroup()
self.add_accel_group(self.accel_group)