Ticket #261 (closed task: completed)

Opened 8 weeks ago

Last modified 8 days ago

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.

Change History

Changed 8 weeks ago by borning

  • milestone changed from AZ-SMART Phase 2+ to GUI enhancements

Changed 6 weeks ago by borning

  • description modified (diff)

Changed 6 weeks ago by koos

  • owner changed from cuspa to koos

Changed 6 weeks ago by koos

  • status changed from new to assigned

Changed 6 weeks ago by koos

ctrl++ increases the font size, ctrl+- decreases the font size both can be found in the utilities menu.

opusmain.ui will have to be updated to support the menu items permanently.

font size settings have yet to be saved.

when a project is loaded, the project xml browser comes up with it's default size, regardless of previous tweaks to the font size.

Changed 6 weeks ago by koos

font size adjustment can be loaded from xml, but cannot yet be saved back to xml

Changed 5 weeks ago by koos

latest changes:
*added preferences dialog *font size slider was added *changes to font size are saved to xml *if the current gui configuration xml file doesn't have the font settings in it, it is updated. *font size should change for all newly opened tabs as well. *differences between the font sizes are kept
These changes have been committed, but I will need to test this out on Mac and linux.

Changed 5 weeks ago by travis

works for me on mac.

one thing: the size of the containers of text whose font is changed does not also change. This causes strange sizing.

Changed 8 days ago by koos

  • status changed from assigned to closed
  • resolution set to completed
Note: See TracTickets for help on using tickets.