Merge pull request #144 from goncalossilva/various-improvements

Fix opening recents popover affecting font size
github/fork/yochananmarqos/patch-1
somas95 2019-04-19 13:29:09 +02:00 committed by GitHub
commit 2b5140dada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<requires lib="gtk+" version="3.20"/>
<object class="GtkRecentFilter" id="recent_md_filter">
<mime-types>
<mime-type>text/markdown</mime-type>
<mime-type>text/x-markdown</mime-type>
</mime-types>
</object>

View File

@ -141,7 +141,7 @@ def buttons(app):
btn.open_recent.pack_start(open_button, False, False, 0)
btn.open_recent.pack_end(recents_button, False, False, 0)
btn.search.set_tooltip_text(_("Search and replace"))
btn.search.set_tooltip_text(_("Search and Replace"))
btn.menu.set_tooltip_text(_("Menu"))
btn.menu.set_image(Gtk.Image.new_from_icon_name("open-menu-symbolic",
Gtk.IconSize.BUTTON))

View File

@ -262,6 +262,11 @@ class Window(Gtk.ApplicationWindow):
"""set paddings dependant of the window size
"""
# Ensure the window receiving the event is the one we care about, ie. the main window.
# On Wayland (bug?), sub-windows such as the recents popover will also trigger this.
if event and event.window != window.get_window():
return
# Adjust text editor width depending on window width, so that:
# - The number of characters per line is adequate (http://webtypography.net/2.1.2)
# - The number of characters stays constant while resizing the window / font