summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCalvin Morrison <calvin@pobox.com>2026-05-22 12:07:16 -0400
committerCalvin Morrison <calvin@pobox.com>2026-05-22 12:07:16 -0400
commit120aa93813715351105b683a93cc3ea6a890db76 (patch)
treec505a73d4373cc830983972f65ba8d411e08ba1c /src
parentcdf72828e599a63fca4a0f1ceeb3145fba581aa3 (diff)
fix volume percent length change from expanding overall width by setting itinitially to the full width. fixes resize bug reported by pitriss
Diffstat (limited to 'src')
-rw-r--r--src/ui/alsa/alsadevicewidget.cpp5
-rw-r--r--src/ui/devicewidget.cpp6
-rw-r--r--src/ui/oss/ossdevicewidget.cpp5
3 files changed, 12 insertions, 4 deletions
diff --git a/src/ui/alsa/alsadevicewidget.cpp b/src/ui/alsa/alsadevicewidget.cpp
index 214d931..6297640 100644
--- a/src/ui/alsa/alsadevicewidget.cpp
+++ b/src/ui/alsa/alsadevicewidget.cpp
@@ -99,7 +99,10 @@ AlsaDeviceWidget::AlsaDeviceWidget( AlsaDevice *dev, TQWidget *parent )
TQPixmap px = iconForDevice(dev);
if ( !px.isNull() ) icon->setPixmap(px);
topRow->addWidget(icon, 0, TQt::AlignVCenter);
- m_volLabel = new TQLabel(TQString("%1%").arg(dev->volume()), this);
+ m_volLabel = new TQLabel("100%", this);
+ m_volLabel->setFixedWidth( m_volLabel->sizeHint().width() + 2 );
+ m_volLabel->setAlignment( TQt::AlignRight | TQt::AlignVCenter );
+ m_volLabel->setText( TQString("%1%").arg(dev->volume()) );
topRow->addWidget(m_volLabel, 0, TQt::AlignVCenter);
col->addLayout(topRow);
diff --git a/src/ui/devicewidget.cpp b/src/ui/devicewidget.cpp
index 645ffaa..6bcef6d 100644
--- a/src/ui/devicewidget.cpp
+++ b/src/ui/devicewidget.cpp
@@ -128,8 +128,10 @@ DeviceWidget::DeviceWidget( AudioDevice *device, PulseModel *model, TQWidget *pa
m_iconLabel->setPixmap( px );
}
- m_volLabel = new TQLabel( TQString::number(device->volume()) + "%", this );
- m_volLabel->setAlignment( TQLabel::AlignHCenter );
+ m_volLabel = new TQLabel( "100%", this );
+ m_volLabel->setFixedWidth( m_volLabel->sizeHint().width() + 2 );
+ m_volLabel->setAlignment( TQLabel::AlignRight | TQLabel::AlignVCenter );
+ m_volLabel->setText( TQString::number(device->volume()) + "%" );
m_levelMeter = new LevelMeter( this );
m_levelMeter->setFixedWidth( 14 );
diff --git a/src/ui/oss/ossdevicewidget.cpp b/src/ui/oss/ossdevicewidget.cpp
index 03fd91b..7a08698 100644
--- a/src/ui/oss/ossdevicewidget.cpp
+++ b/src/ui/oss/ossdevicewidget.cpp
@@ -81,7 +81,10 @@ OssDeviceWidget::OssDeviceWidget( OssDevice *dev, TQWidget *parent )
TQPixmap px = iconForDevice(dev);
if ( !px.isNull() ) icon->setPixmap(px);
topRow->addWidget(icon, 0, TQt::AlignVCenter);
- m_volLabel = new TQLabel(TQString("%1%").arg(dev->volume()), this);
+ m_volLabel = new TQLabel("100%", this);
+ m_volLabel->setFixedWidth( m_volLabel->sizeHint().width() + 2 );
+ m_volLabel->setAlignment( TQt::AlignRight | TQt::AlignVCenter );
+ m_volLabel->setText( TQString("%1%").arg(dev->volume()) );
topRow->addWidget(m_volLabel, 0, TQt::AlignVCenter);
col->addLayout(topRow);