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/devicewidget.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/devicewidget.cpp')
| -rw-r--r-- | src/ui/devicewidget.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ui/devicewidget.cpp b/src/ui/devicewidget.cpp index e6401d2..22e2995 100644 --- a/src/ui/devicewidget.cpp +++ b/src/ui/devicewidget.cpp @@ -17,6 +17,7 @@ #include <kled.h> #include <kiconloader.h> #include <tdeglobal.h> +#include <tdeconfig.h> #include <kstandarddirs.h> #include <tdepopupmenu.h> #include <tdelocale.h> @@ -287,6 +288,17 @@ void DeviceWidget::onDeviceName( const TQString &name ) static_cast<VerticalLabel*>(m_label)->setText( name ); } +void DeviceWidget::wheelEvent( TQWheelEvent *e ) +{ + TDEConfig *cfg = TDEGlobal::config(); + cfg->setGroup("General"); + int step = cfg->readNumEntry("ScrollStep", 5); + int delta = e->delta() > 0 ? step : -step; + int vol = TQMAX( 0, TQMIN( 100, m_device->volume() + delta ) ); + m_device->setVolume( vol ); + e->accept(); +} + void DeviceWidget::contextMenuEvent( TQContextMenuEvent *e ) { TDEPopupMenu menu( this ); @@ -300,11 +312,13 @@ void DeviceWidget::contextMenuEvent( TQContextMenuEvent *e ) if ( cat == AudioDevice::Output ) { menu.insertSeparator(); - menu.insertItem( i18n("Set as Default Output"), this, TQ_SLOT(onSetDefault()) ); + int id = menu.insertItem( i18n("Set as Default Output"), this, TQ_SLOT(onSetDefault()) ); + menu.setItemChecked( id, m_model->defaultOutput() == m_device ); } else if ( cat == AudioDevice::Input ) { menu.insertSeparator(); - menu.insertItem( i18n("Set as Default Input"), this, TQ_SLOT(onSetDefault()) ); + int id = menu.insertItem( i18n("Set as Default Input"), this, TQ_SLOT(onSetDefault()) ); + menu.setItemChecked( id, m_model->defaultInput() == m_device ); } else if ( cat == AudioDevice::Playback ) { TQPtrList<AudioDevice> sinks = m_model->devices( AudioDevice::Output ); |
