# HG changeset patch # User Dan Drogichen # Date 1403125682 25200 # Wed Jun 18 14:08:02 2014 -0700 # Node ID 293cf2f7da0fa9d4000faf71bf8b4872f78f0bb1 # Parent 7b7f83319e43dd19ce1ba1c63d8eabada53160ce [developer] Control fontsize of file browser display - #1697 Add user specification of the font size to use for the developer tools file browser display, without affecting any other Chirp displays. This is done with a new chirp.config integer property browser_fontsize in the [developer] section. The default size is unchanged at 10. Values between 4 and 144 are accepted; others result in the default. Add documentation of browser_fontsize to the README.developers file. #1697 diff -r 7b7f83319e43 -r 293cf2f7da0f README.developers --- a/README.developers Sat Jun 07 09:46:34 2014 -0700 +++ b/README.developers Wed Jun 18 14:08:02 2014 -0700 @@ -18,6 +18,7 @@ =================================== [developer] diff_fontsize = 16 +browser_fontsize = 13 =================================== @@ -29,3 +30,13 @@ The default size is 11. Values less than 4, greater than 144, or not recognized as an integer will result in a log message and the default size will be used. + +======== +browser_fontsize = +This specifies the fontsize used in the file browser, invoked by selecting +the "Browser" tab in the left sidebar, which is visible when the Developer +tools are enabled. + +The default size is 10. Values less than 4, greater than 144, or not +recognized as an integer will result in a log message and the default +size will be used. diff -r 7b7f83319e43 -r 293cf2f7da0f chirpui/radiobrowser.py --- a/chirpui/radiobrowser.py Sat Jun 07 09:46:34 2014 -0700 +++ b/chirpui/radiobrowser.py Wed Jun 18 14:08:02 2014 -0700 @@ -5,7 +5,9 @@ import os from chirp import bitwise -from chirpui import common +from chirpui import common, config + +CONF = config.get() def do_insert_line_with_tags(b, line): def i(text, *tags): @@ -77,7 +79,16 @@ class FixedEntry(gtk.Entry): def __init__(self, *args, **kwargs): super(FixedEntry, self).__init__(*args, **kwargs) - fontdesc = pango.FontDescription("Courier bold 10") + + try: + fontsize = CONF.get_int("browser_fontsize", "developer") + except Exception: + fontsize = 10 + if fontsize < 4 or fontsize > 144: + print "Unsupported browser_fontsize %i. Using 10." % fontsize + fontsize = 11 + + fontdesc = pango.FontDescription("Courier bold %i" % fontsize) self.modify_font(fontdesc) class IntegerEntry(FixedEntry):