open-pulse / OpenPulse

OpenPulse: Open Source Software for Pulsation Analysis of Pipeline Systems
https://open-pulse.readthedocs.io
MIT License
36 stars 18 forks source link

Make some user preferences configurable #256

Open andrefpf opened 1 month ago

andrefpf commented 1 month ago

The user may want to configure the font size, set custom colors for the renderer background, the points color and things like that. We should implement this behaviour (that was already implemented for the old renderer).

My sugestion is to create a dataclass that contains all the parameters, instantiate it somewhere in the code (probably in Application or MainWindow) and make the interface access this object whenever it needs to update the renderer or the theme.

from molde.colors import Color, colornames

@dataclass
class InterfacePreferences:
    background_color_0: Color = colornames.BLACK
    background_color_1: Color = colornames.WHITE
    renderer_points_color: Color = colornames.YELLOW