From e43a4866cf9b0e945ec540e14ee9e9b1dcb5d2c8 Mon Sep 17 00:00:00 2001 From: houston Date: Tue, 21 Jul 2020 10:50:44 +0200 Subject: [PATCH] add icons to source/sink combo box --- src/bridgesourcesink.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bridgesourcesink.py b/src/bridgesourcesink.py index 3e49850..cabbe10 100755 --- a/src/bridgesourcesink.py +++ b/src/bridgesourcesink.py @@ -87,7 +87,18 @@ class BridgeSourceSink(QTableWidget): # Type combo_box = QComboBox() - combo_box.addItems(["source", "sink"]) + + microphone_icon = QIcon.fromTheme('audio-input-microphone') + if microphone_icon.isNull(): + microphone_icon = QIcon.fromTheme('microphone') + + loudspeaker_icon = QIcon.fromTheme('audio-volume-high') + if loudspeaker_icon.isNull(): + loudspeaker_icon = QIcon.fromTheme('player-volume') + + combo_box.addItem(microphone_icon, "source") + combo_box.addItem(loudspeaker_icon, "sink") + combo_box.setCurrentIndex(0 if data.s_type == "source" else 1) combo_box.currentTextChanged.connect(self.enable_buttons) self.setCellWidget(row, 1, combo_box)