mirror of
https://github.com/kk7ds/chirp.git
synced 2024-09-21 10:37:15 +00:00
[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
This commit is contained in:
parent
f12aadbbf6
commit
98eb5e463f
@ -18,6 +18,7 @@ followed by an explanation of each directive:
|
||||
===================================
|
||||
[developer]
|
||||
diff_fontsize = 16
|
||||
browser_fontsize = 13
|
||||
|
||||
===================================
|
||||
|
||||
@ -29,3 +30,13 @@ invoked by selecting View -> Developer -> Diff tabs, and then in the
|
||||
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 = <integer>
|
||||
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.
|
||||
|
@ -5,7 +5,9 @@ import re
|
||||
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 @@ def bitwise_type(classname):
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user