Skip to content

Commit

Permalink
wxGUI/mapdisp: Always respect user-set background color in Map Display (
Browse files Browse the repository at this point in the history
#1167)

The background color from user settings was applied only when actual rendering
happened. So with no layers at the start and when all unchecked the color was
the hardcoded white.

Now the color is always the same although it comes from different sources
(backround by default and g.pnmcomp result when displaying data).

This creates consistent behavior and it is a plus for the dark theme support
because when user manually the dark background to fit with the dark theme,
the big empty white area is no longer displayed when no data is there.

This applies to all components which use mapwin.BufferedMapWindow,
e.g., Map Swipe.
  • Loading branch information
wenzeslaus committed Feb 11, 2021
1 parent 1384f52 commit 6fd5eb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gui/wxpython/mapwin/buffered.py
Expand Up @@ -78,7 +78,11 @@ def __init__(self, parent, giface, Map, properties,
"""
MapWindowBase.__init__(self, parent=parent, giface=giface, Map=Map)
wx.Window.__init__(self, parent=parent, id=id, style=style, **kwargs)
self.SetBackgroundColour("white")
# This is applied when no layers are rendered and thus the background
# color is not applied in rendering itself (it would be applied always
# if rendering would use transparent background).
self.SetBackgroundColour(wx.Colour(*UserSettings.Get(
group='display', key='bgcolor', subkey='color')))

self._properties = properties
# this class should not ask for digit, this is a hack
Expand Down

0 comments on commit 6fd5eb9

Please sign in to comment.