Skip to content

Commit

Permalink
Show ModelRelation in white on dark mode (#2997)
Browse files Browse the repository at this point in the history
* use black brush when exporting model to image
  • Loading branch information
landam authored Jun 4, 2023
1 parent 99cf88c commit e887353
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
from core.settings import UserSettings
from gui_core.forms import GUI, CmdPanel
from gui_core.widgets import GNotebook
from gui_core.wrap import Button
from gui_core.wrap import Button, IsDark
from gmodeler.giface import GraphicalModelerGrassInterface

from grass.script import task as gtask
Expand Down Expand Up @@ -1622,14 +1622,15 @@ def GetControlPoints(self):
"""Get list of control points"""
return self._points

def _setPen(self):
def _setPen(self, bg_white=False):
"""Set pen"""
pen = wx.Pen(wx.BLACK, 1, wx.SOLID)
self.SetPen(pen)
self.SetPen(
wx.Pen(wx.WHITE if IsDark() and not bg_white else wx.BLACK, 1, wx.SOLID)
)

def OnDraw(self, dc):
"""Draw relation"""
self._setPen()
self._setPen(dc.GetBackground() == wx.WHITE_BRUSH)
ogl.LineShape.OnDraw(self, dc)

def SetName(self, param):
Expand Down

0 comments on commit e887353

Please sign in to comment.