Make the overlay toggable

ft.font-size
Manuel Genovés 2018-12-05 20:27:19 +01:00
parent d084f24d89
commit 772b1ba6db
2 changed files with 14 additions and 1 deletions

View File

@ -13,6 +13,14 @@
asked to install them manually.
</description>
</key>
<key name='gradient-overlay' type='b'>
<default>true</default>
<summary>Show gradient overlay</summary>
<description>
Show a gradient overlay over the text at the top anf bottom of the window.
It can cause performance problems to some users
</description>
</key>
<key name='open-file-path' type='s'>
<default>"/tmp"</default>
<summary>Open file base path</summary>

View File

@ -146,7 +146,12 @@ class UberwriterWindow(Gtk.ApplicationWindow):
self.scrolled_window.add(self.text_editor)
self.alignment_padding = 40
self.editor_viewport = self.builder.get_object('editor_viewport')
self.scrolled_window.connect_after("draw", self.draw_gradient)
# some people seems to have performance problems with the overlay.
# Let them disable it
if self.settings.get_value("gradient-overlay"):
self.scrolled_window.connect_after("draw", self.draw_gradient)
self.smooth_scroll_starttime = 0
self.smooth_scroll_endtime = 0