Ticket #261 (closed task: completed)
add font size preferences to menu and save to gui config
| Reported by: | travis | Owned by: | koos |
|---|---|---|---|
| Priority: | normal | Milestone: | GUI enhancements |
| Component: | Opus/UrbanSim GUI | Version: | |
| Keywords: | Cc: |
Description (last modified by borning) (diff)
Some notes on how to do this:
For changing the font size for a demo, you can look in opus_gui.main.opusmain_ui and change the four places where font.setPointSize is called. None of the fonts are currently set to be greater then 12 point.
Changing the font in this way would be OK for a demo, but we don't want this for the long-term solution, since that file is automatically generated by PyQt from a Qt designer file, and as far as I know, we can't specify a font size programatically in Designer.
And if we edit the automatically generated file, the changes will be wiped out the next time we regenerate it from the .ui file. Instead, one way to handle this would be to add some code that sets the font size from outside opus_gui.main.opusmain_ui -- then this would continue working even if the file is regenerated.
You can test whether you're changing all the font sizes you want to by editing this file though.
In addition to changing the font size programatically, we need to hook this up to the preferences. We could add a 'preferences' menu item to the GUI. Under 'Python' would be consistent with other applications, and there is an existing 'preferences' menu item, although greyed out. Can we enable this?
The file opus_home/gui/gui_config.xml is the right place to store these preferences in between sessions. This file is automatically created if it doesn't exist -- a final convenience step is to test what system we're running on, and add a good font size to the gui_config.xml file when it is created, depending on whether it's Windows or Mac.
Also check what font sizes look ok on linux, and add an appropriate one if running on linux.
