Skip to content

Commit

Permalink
osx: Meld looking much better with sane font sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
yousseb committed Dec 16, 2018
1 parent db06065 commit 20c7de0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 0 additions & 2 deletions meld/meldwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def app_action(*args):
def osx_menu_setup(self, widget, event, callback_data=None):
if self.osx_ready == False:
import gi
from gi.repository import Pango
gi.require_version('GtkosxApplication', '1.0')
from gi.repository import GtkosxApplication as gtkosx_application
self.macapp = gtkosx_application.Application()
Expand All @@ -295,7 +294,6 @@ def osx_menu_setup(self, widget, event, callback_data=None):
self.macapp.insert_app_menu_item(Gtk.SeparatorMenuItem(), 3)
#self.macapp.ready()
NSApp.activateIgnoringOtherApps_(True)
self.widget.modify_font(Pango.FontDescription("Lucida Grande 10"))
self.osx_ready = True

def _on_recentmenu_map(self, recentmenu):
Expand Down
8 changes: 8 additions & 0 deletions meld/ui/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def __init__(
# file comparisons, not in folder or version-control.
self.props.local_only = action not in FILE_ACTIONS

try:
from AppKit import NSFont
from gi.repository import Pango
system_font = NSFont.systemFontOfSize_(10)
self.modify_font(Pango.FontDescription(system_font.displayName() + " 10"))
except:
pass

def make_encoding_combo(self):
"""Create the combo box for text encoding selection"""
codecs = []
Expand Down
7 changes: 7 additions & 0 deletions meld/ui/gnomeglade.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def __init__(self, filename, root, extra=None):
self.builder.connect_signals(self)
self.widget = getattr(self, root)
self.widget.pyobject = self
try:
from AppKit import NSFont
from gi.repository import Pango
system_font = NSFont.systemFontOfSize_(10)
self.widget.modify_font(Pango.FontDescription(system_font.displayName() + " 10"))
except:
pass

def __getattr__(self, key):
"""Allow UI builder widgets to be accessed as self.widgetname"""
Expand Down
8 changes: 8 additions & 0 deletions meld/ui/statusbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ def __init__(self):
self.props.margin = 0
self.props.spacing = 6

try:
from AppKit import NSFont
from gi.repository import Pango
system_font = NSFont.systemFontOfSize_(10)
self.modify_font(Pango.FontDescription(system_font.displayName() + " 9"))
except:
pass

hbox = self.get_message_area()
label = hbox.get_children()[0]
hbox.props.spacing = 6
Expand Down

0 comments on commit 20c7de0

Please sign in to comment.