Skip to content

Commit

Permalink
Update gl background color every frame, to react to changes in dark/l…
Browse files Browse the repository at this point in the history
…ight theme.
  • Loading branch information
cmbruns committed Jun 20, 2024
1 parent a6ddb9a commit 0b7c0de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vmg/image_widget_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def wheelEvent(self, event: QtGui.QWheelEvent):
self.update()

def paintGL(self) -> None:
bg_color = self.palette().color(self.backgroundRole()).getRgbF()
GL.glClearColor(*bg_color)
GL.glClear(GL.GL_COLOR_BUFFER_BIT)
if self.image is None:
return
Expand Down

0 comments on commit 0b7c0de

Please sign in to comment.