diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-05-15 15:02:25 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-05-15 15:02:25 -0400 |
| commit | e0c8fb0cdcb9c95e3efa60322c1733df0a965650 (patch) | |
| tree | fac3f3dfd2b7d0c0e4e854387be91117088288af /src/ui/mixerwindow.cpp | |
| parent | e776bc768cf9afca1867200e25d64d315cd72a3e (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/mixerwindow.cpp')
| -rw-r--r-- | src/ui/mixerwindow.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/ui/mixerwindow.cpp b/src/ui/mixerwindow.cpp index caa6af5..53113e6 100644 --- a/src/ui/mixerwindow.cpp +++ b/src/ui/mixerwindow.cpp @@ -1,5 +1,6 @@ #include "mixerwindow.h" #include "preferencesdlg.h" +#include "devicewidget.h" #include "../model/pulsemodel.h" #include <tqlayout.h> @@ -20,6 +21,7 @@ #include <tdeaboutapplication.h> #include <tdeaboutdata.h> #include <tdeapplication.h> +#include <twin.h> #include "tmixtray.h" #include "devicespage.h" #include <tdeconfig.h> @@ -202,6 +204,12 @@ bool MixerWindow::queryClose() } +void MixerWindow::bringToFront() +{ + show(); + KWin::forceActiveWindow( winId() ); +} + void MixerWindow::showAbout() { TDEAboutData about( @@ -224,6 +232,21 @@ MixerWindow::Tab &MixerWindow::tabForCategory( AudioDevice::Category cat ) return m_output; } +static void updateSeparators( TQHBoxLayout *layout ) +{ + TQLayoutIterator it = layout->iterator(); + DeviceWidget *last = 0; + while ( TQLayoutItem *item = it.current() ) { + DeviceWidget *dw = dynamic_cast<DeviceWidget*>( item->widget() ); + if ( dw ) { + if ( last ) last->setSeparatorVisible( true ); + last = dw; + } + ++it; + } + if ( last ) last->setSeparatorVisible( false ); +} + void MixerWindow::onDeviceAdded( AudioDevice *dev ) { if ( m_stack->id( m_stack->visibleWidget() ) == 1 ) { @@ -232,6 +255,7 @@ void MixerWindow::onDeviceAdded( AudioDevice *dev ) m_allCount++; w->show(); m_widgets.insert( dev, w ); + updateSeparators( m_allLayout ); } else { Tab &t = tabForCategory( dev->category() ); TQWidget *w = dev->createWidget( t.page ); @@ -239,6 +263,7 @@ void MixerWindow::onDeviceAdded( AudioDevice *dev ) t.count++; w->show(); m_widgets.insert( dev, w ); + updateSeparators( t.layout ); } } @@ -255,13 +280,17 @@ void MixerWindow::onDeviceRemoved( AudioDevice *dev ) if ( m_stack->id( m_stack->visibleWidget() ) == 1 ) { m_allLayout->remove( w ); m_allCount--; + m_widgets.remove( dev ); + delete w; + updateSeparators( m_allLayout ); } else { Tab &t = tabForCategory( dev->category() ); t.layout->remove( w ); t.count--; + m_widgets.remove( dev ); + delete w; + updateSeparators( t.layout ); } - m_widgets.remove( dev ); - delete w; } |
