summaryrefslogtreecommitdiff
path: root/src/ui/preferencesdlg.cpp
diff options
context:
space:
mode:
authorCalvin Morrison <calvin@pobox.com>2026-05-15 15:02:25 -0400
committerCalvin Morrison <calvin@pobox.com>2026-05-15 15:02:25 -0400
commite0c8fb0cdcb9c95e3efa60322c1733df0a965650 (patch)
treefac3f3dfd2b7d0c0e4e854387be91117088288af /src/ui/preferencesdlg.cpp
parente776bc768cf9afca1867200e25d64d315cd72a3e (diff)
Recording popup, level meters, UX polish
- Recording tray icon opens popup (mics + active recording streams) - Recording stream level meters forward from parent source signal - RecordingTray subclass for single-click (no double-click needed) - Context menu Set Default Output/Input shows checkmark when active - Last DeviceWidget in each row hides its right separator - Popup horizontal layout, configurable content (output/mic/apps) - Single-click tray, right-click menu for Open Mixer - Desktop file, icon, CMake install rules - Window bring-to-front across workspaces (KWin::forceActiveWindow) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/ui/preferencesdlg.cpp')
-rw-r--r--src/ui/preferencesdlg.cpp62
1 files changed, 52 insertions, 10 deletions
diff --git a/src/ui/preferencesdlg.cpp b/src/ui/preferencesdlg.cpp
index b6df120..b263850 100644
--- a/src/ui/preferencesdlg.cpp
+++ b/src/ui/preferencesdlg.cpp
@@ -2,16 +2,18 @@
#include <tqlayout.h>
#include <tqcheckbox.h>
+#include <tqcombobox.h>
#include <tqspinbox.h>
#include <tqlabel.h>
#include <tqframe.h>
+#include <tqgroupbox.h>
#include <tdeglobal.h>
#include <tdeconfig.h>
#include <tdelocale.h>
PreferencesDlg::PreferencesDlg( TQWidget *parent )
: KDialogBase( Tabbed, i18n("Configure TMix"),
- Ok | Apply | Cancel, Ok, parent )
+ Ok | Apply | Cancel, Ok, parent, 0, false )
{
// ---- General -------------------------------------------------------------
TQFrame *gen = addPage( i18n("General") );
@@ -20,8 +22,33 @@ PreferencesDlg::PreferencesDlg( TQWidget *parent )
m_dockInTray = new TQCheckBox( i18n("Dock in system tray"), gen );
gl->addWidget( m_dockInTray );
- m_showPopup = new TQCheckBox( i18n("Show mini volume popup on tray click"), gen );
- gl->addWidget( m_showPopup );
+ gl->addSpacing( 4 );
+
+ TQHBoxLayout *popupRow = new TQHBoxLayout( 0, 0, spacingHint() );
+ popupRow->addWidget( new TQLabel( i18n("Tray left-click:"), gen ) );
+ m_popupMode = new TQComboBox( false, gen );
+ m_popupMode->insertItem( i18n("Show mixer window") );
+ m_popupMode->insertItem( i18n("Show mini popup") );
+ popupRow->addWidget( m_popupMode );
+ popupRow->addStretch();
+ gl->addLayout( popupRow );
+
+ TQGroupBox *popupContent = new TQGroupBox( i18n("Mini popup shows:"), gen );
+ popupContent->setColumnLayout( 0, Qt::Vertical );
+ popupContent->layout()->setSpacing( spacingHint() );
+ popupContent->layout()->setMargin( marginHint() );
+ TQVBoxLayout *pcl = new TQVBoxLayout( popupContent->layout() );
+ m_popupShowOutput = new TQCheckBox( i18n("Default output (speakers/headphones)"), popupContent );
+ m_popupShowMic = new TQCheckBox( i18n("Microphone inputs"), popupContent );
+ m_popupShowApps = new TQCheckBox( i18n("Active app streams"), popupContent );
+ pcl->addWidget( m_popupShowOutput );
+ pcl->addWidget( m_popupShowMic );
+ pcl->addWidget( m_popupShowApps );
+ gl->addWidget( popupContent );
+
+ connect( m_popupMode, TQ_SIGNAL(activated(int)), this, TQ_SLOT(onPopupModeChanged(int)) );
+
+ gl->addSpacing( 4 );
m_showRecTray = new TQCheckBox( i18n("Show microphone-in-use icon in tray"), gen );
gl->addWidget( m_showRecTray );
@@ -29,7 +56,6 @@ PreferencesDlg::PreferencesDlg( TQWidget *parent )
m_confirmQuit = new TQCheckBox( i18n("Ask for confirmation before quitting"), gen );
gl->addWidget( m_confirmQuit );
-
gl->addSpacing( 8 );
TQHBoxLayout *stepRow = new TQHBoxLayout( 0, 0, spacingHint() );
@@ -64,13 +90,26 @@ PreferencesDlg::PreferencesDlg( TQWidget *parent )
load();
}
+void PreferencesDlg::onPopupModeChanged( int idx )
+{
+ bool popupEnabled = ( idx == 1 );
+ m_popupShowOutput->setEnabled( popupEnabled );
+ m_popupShowMic->setEnabled( popupEnabled );
+ m_popupShowApps->setEnabled( popupEnabled );
+}
+
void PreferencesDlg::load()
{
TDEConfig *cfg = TDEGlobal::config();
cfg->setGroup("General");
m_dockInTray->setChecked( cfg->readBoolEntry("DockInTray", true) );
- m_showPopup->setChecked( cfg->readBoolEntry("ShowPopup", true) );
+ int mode = cfg->readNumEntry("PopupMode", 1);
+ m_popupMode->setCurrentItem( mode );
+ m_popupShowOutput->setChecked( cfg->readBoolEntry("PopupShowOutput", true) );
+ m_popupShowMic->setChecked( cfg->readBoolEntry("PopupShowMic", false) );
+ m_popupShowApps->setChecked( cfg->readBoolEntry("PopupShowApps", true) );
+ onPopupModeChanged( mode );
m_showRecTray->setChecked( cfg->readBoolEntry("ShowRecordingTray", true) );
m_confirmQuit->setChecked( cfg->readBoolEntry("ConfirmQuit", false) );
m_scrollStep->setValue( cfg->readNumEntry( "ScrollStep", 5) );
@@ -88,11 +127,14 @@ void PreferencesDlg::save()
TDEConfig *cfg = TDEGlobal::config();
cfg->setGroup("General");
- cfg->writeEntry( "DockInTray", m_dockInTray->isChecked() );
- cfg->writeEntry( "ShowPopup", m_showPopup->isChecked() );
- cfg->writeEntry( "ShowRecordingTray", m_showRecTray->isChecked() );
- cfg->writeEntry( "ConfirmQuit", m_confirmQuit->isChecked() );
- cfg->writeEntry( "ScrollStep", m_scrollStep->value() );
+ cfg->writeEntry( "DockInTray", m_dockInTray->isChecked() );
+ cfg->writeEntry( "PopupMode", m_popupMode->currentItem() );
+ cfg->writeEntry( "PopupShowOutput", m_popupShowOutput->isChecked() );
+ cfg->writeEntry( "PopupShowMic", m_popupShowMic->isChecked() );
+ cfg->writeEntry( "PopupShowApps", m_popupShowApps->isChecked() );
+ cfg->writeEntry( "ShowRecordingTray", m_showRecTray->isChecked() );
+ cfg->writeEntry( "ConfirmQuit", m_confirmQuit->isChecked() );
+ cfg->writeEntry( "ScrollStep", m_scrollStep->value() );
cfg->setGroup("View");
cfg->writeEntry( "NoTabs", m_noTabs->isChecked() );