Skip to content

Commit 6edaebd

Browse files
committed
Switch video preview widget background color to use stylesheet and palette. To prevent a freeze on Windows.
1 parent 47e6248 commit 6edaebd

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

src/themes/cosmic/theme.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def __init__(self, app):
442442
background-color: #FABE0A;
443443
}
444444
445-
.video_widget {
445+
QWidget#videoPreview {
446446
background-color: #141923;
447447
}
448448
"""

src/themes/humanity/theme.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, app):
5151
background-color: #ff0024;
5252
}
5353
54-
.video_widget {
54+
QWidget#videoPreview {
5555
background-color: #191919;
5656
}
5757
"""
@@ -94,7 +94,7 @@ def __init__(self, app):
9494
background-color: #ff0024;
9595
}
9696
97-
.video_widget {
97+
QWidget#videoPreview {
9898
background-color: #dedede;
9999
}
100100
"""

src/windows/video_widget.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -330,17 +330,7 @@ def paintEvent(self, event, *args):
330330
True)
331331

332332
# Get theme colors (if any)
333-
# if get_app().theme_manager:
334-
# theme = get_app().theme_manager.get_current_theme()
335-
# if not theme:
336-
# log.warning("No theme loaded yet. Skip rendering video preview widget.")
337-
# return
338-
# background_color = theme.get_color(".video_widget", "background-color")
339-
# painter.fillRect(event.rect(), background_color)
340-
# else:
341-
# log.warning("No ThemeManager loaded yet. Skip rendering video preview widget.")
342-
343-
background_color = QColor("#191919")
333+
background_color = self.palette().color(self.backgroundRole())
344334
painter.fillRect(event.rect(), background_color)
345335

346336
# Find centered viewport

0 commit comments

Comments
 (0)