mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Fixed light theme slider colors in voice mixer
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- Added tooltip indicators in queue manager to display book handler options (`Save chapters separately` and `Merge chapters at the end`) for queued items.
|
||||
- Added `Open processed file` and `Open input file` options for items in the queue manager, instead of just `Open file` option.
|
||||
- Added loading gif animation to book handler window.
|
||||
- Fixed light theme slider colors in voice mixer for better visibility (for non-Windows users).
|
||||
- Fixed subtitle word-count splitting logic for more accurate segmentation.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
+44
-14
@@ -242,20 +242,8 @@ class VoiceMixer(QWidget):
|
||||
)
|
||||
self.slider.setFixedWidth(SLIDER_WIDTH)
|
||||
|
||||
# Fix slider in Windows
|
||||
if platform.system() == "Windows":
|
||||
appstyle = QApplication.instance().style().objectName().lower()
|
||||
if appstyle != "windowsvista":
|
||||
# Set custom groove color for disabled state using COLORS["GREY_BACKGROUND"]
|
||||
self.slider.setStyleSheet(
|
||||
f"""
|
||||
QSlider::groove:vertical:disabled {{
|
||||
background: {COLORS.get("GREY_BACKGROUND")};
|
||||
width: 4px;
|
||||
border-radius: 4px;
|
||||
}}
|
||||
"""
|
||||
)
|
||||
# Apply slider styling after widget is added to window (see showEvent)
|
||||
self._slider_style_applied = False
|
||||
|
||||
# Connect controls
|
||||
self.slider.valueChanged.connect(lambda val: self.spin_box.setValue(val / 100))
|
||||
@@ -285,6 +273,48 @@ class VoiceMixer(QWidget):
|
||||
self.setLayout(layout)
|
||||
self.toggle_inputs()
|
||||
|
||||
def showEvent(self, event):
|
||||
super().showEvent(event)
|
||||
# Apply slider styling once when widget is shown and has access to parent
|
||||
if not self._slider_style_applied:
|
||||
self._slider_style_applied = True
|
||||
|
||||
# Fix slider in Windows
|
||||
if platform.system() == "Windows":
|
||||
appstyle = QApplication.instance().style().objectName().lower()
|
||||
if appstyle != "windowsvista":
|
||||
# Set custom groove color for disabled state using COLORS["GREY_BACKGROUND"]
|
||||
self.slider.setStyleSheet(
|
||||
f"""
|
||||
QSlider::groove:vertical:disabled {{
|
||||
background: {COLORS.get("GREY_BACKGROUND")};
|
||||
width: 4px;
|
||||
border-radius: 4px;
|
||||
}}
|
||||
"""
|
||||
)
|
||||
else:
|
||||
# Apply same fix for Light theme on non-Windows systems
|
||||
# Get theme from parent window's config
|
||||
parent_window = self.window()
|
||||
theme = "system"
|
||||
while parent_window:
|
||||
if hasattr(parent_window, "config"):
|
||||
theme = parent_window.config.get("theme", "system")
|
||||
break
|
||||
parent_window = parent_window.parent()
|
||||
|
||||
if theme == "light":
|
||||
self.slider.setStyleSheet(
|
||||
f"""
|
||||
QSlider::groove:vertical:disabled {{
|
||||
background: {COLORS.get("GREY_BACKGROUND")};
|
||||
width: 4px;
|
||||
border-radius: 4px;
|
||||
}}
|
||||
"""
|
||||
)
|
||||
|
||||
def toggle_inputs(self):
|
||||
is_enabled = self.checkbox.isChecked()
|
||||
self.spin_box.setEnabled(is_enabled)
|
||||
|
||||
Reference in New Issue
Block a user