From 3b246f55e08cefac1286b29b86de1efebd4b8cdf Mon Sep 17 00:00:00 2001 From: Tsu Jan Date: Sun, 16 Aug 2020 23:23:35 +0430 Subject: [PATCH] =?UTF-8?q?GUI=20fixes:=20Elide=20playback=20name=20label?= =?UTF-8?q?=20if=20needed=20and=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the name is too long, elide it centrally, so that a horizontal scrollbar isn't needed (and isn't shown). Also, don't force a height on progressbars because some widget styles may not show any bar with a forced height. Closes https://github.com/lxqt/pavucontrol-qt/issues/99 and closes https://github.com/lxqt/pavucontrol-qt/issues/75 --- src/CMakeLists.txt | 2 ++ src/minimalstreamwidget.cc | 1 - src/streamwidget.ui | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 89b02725..c686632b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,6 +16,7 @@ set(pavucontrol-qt_HDRS sourceoutputwidget.h sourcewidget.h streamwidget.h + elidinglabel.h ) set(pavucontrol-qt_SRCS @@ -31,6 +32,7 @@ set(pavucontrol-qt_SRCS sourceoutputwidget.cc sourcewidget.cc streamwidget.cc + elidinglabel.cc ) set(pavucontrol-qt_UI diff --git a/src/minimalstreamwidget.cc b/src/minimalstreamwidget.cc index ae6d9243..a1d27738 100644 --- a/src/minimalstreamwidget.cc +++ b/src/minimalstreamwidget.cc @@ -38,7 +38,6 @@ MinimalStreamWidget::MinimalStreamWidget(QWidget *parent) : volumeMeterVisible(true) { peakProgressBar->setTextVisible(false); - peakProgressBar->setMaximumHeight(4 /* FIXME: hardcoded */); peakProgressBar->hide(); } diff --git a/src/streamwidget.ui b/src/streamwidget.ui index d0aa23ec..b4f7d692 100644 --- a/src/streamwidget.ui +++ b/src/streamwidget.ui @@ -27,7 +27,7 @@ - + Device Title @@ -103,6 +103,13 @@ + + + ElidingLabel + QLabel +
elidinglabel.h
+
+