The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

HiDPI support on Linux

These changes was commited to the Birdfont repository Tue, 22 Sep 2015 21:42:58 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 22 Sep 2015 21:42:58 +0000 (23:42 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 22 Sep 2015 21:44:03 +0000 (23:44 +0200)
commit 7c50656beb22c79364fafd224a1379f5c2da2dcb
tree eb1778a21b0c834c716c32b67ecedae011004b91
parent 722fbc22afc92930599537cbf811af3904c9495c
HiDPI support on Linux

birdfont/GtkWindow.vala
libbirdfont/OverViewItem.vala
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -601,6 +601,17 @@ } public double get_screen_scale () { + string? scale = Environment.get_variable ("GDK_SCALE"); + double factor; + + if (scale == null) { + return 1; + } + + if (double.try_parse ((!) scale, out factor)) { + return factor; + } + return 1; } }
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -283,7 +283,7 @@ Surface cache; // unselected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); @@ -302,7 +302,7 @@ label_background = (!) cache; // selected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); @@ -336,10 +336,10 @@ label_background_no_menu = (!) cache; // selected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); - cc.rectangle (0, 0, width - 1, 20 - 1); + cc.rectangle (0, 0, width, 20 - 1); Theme.color (cc, "Selected Overview Item"); cc.fill ();