Change volume icon based on volume
This commit is contained in:
@@ -520,6 +520,17 @@ class RoomWidget(QWidget):
|
|||||||
|
|
||||||
def on_volume_changed(self, value):
|
def on_volume_changed(self, value):
|
||||||
self.vlc_player.set_volume(value)
|
self.vlc_player.set_volume(value)
|
||||||
|
self._update_vol_icon(value)
|
||||||
|
|
||||||
|
def _update_vol_icon(self, volume):
|
||||||
|
if volume == 0:
|
||||||
|
self.vol_icon.setText("🔇")
|
||||||
|
elif volume < 33:
|
||||||
|
self.vol_icon.setText("🔈")
|
||||||
|
elif volume < 66:
|
||||||
|
self.vol_icon.setText("🔉")
|
||||||
|
else:
|
||||||
|
self.vol_icon.setText("🔊")
|
||||||
|
|
||||||
# --- Incoming Sync Logic ---
|
# --- Incoming Sync Logic ---
|
||||||
def handle_sync_event(self, msg: dict):
|
def handle_sync_event(self, msg: dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user