Skip to content

Commit

Permalink
GUI fixes: Elide playback name label if needed and…
Browse files Browse the repository at this point in the history
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 #99 and closes #75
  • Loading branch information
tsujan committed Aug 16, 2020
1 parent c0f31f8 commit 3b246f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(pavucontrol-qt_HDRS
sourceoutputwidget.h
sourcewidget.h
streamwidget.h
elidinglabel.h
)

set(pavucontrol-qt_SRCS
Expand All @@ -31,6 +32,7 @@ set(pavucontrol-qt_SRCS
sourceoutputwidget.cc
sourcewidget.cc
streamwidget.cc
elidinglabel.cc
)

set(pavucontrol-qt_UI
Expand Down
1 change: 0 additions & 1 deletion src/minimalstreamwidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ MinimalStreamWidget::MinimalStreamWidget(QWidget *parent) :
volumeMeterVisible(true) {

peakProgressBar->setTextVisible(false);
peakProgressBar->setMaximumHeight(4 /* FIXME: hardcoded */);
peakProgressBar->hide();
}

Expand Down
9 changes: 8 additions & 1 deletion src/streamwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="nameLabel">
<widget class="ElidingLabel" name="nameLabel">
<property name="text">
<string>Device Title</string>
</property>
Expand Down Expand Up @@ -103,6 +103,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ElidingLabel</class>
<extends>QLabel</extends>
<header>elidinglabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit 3b246f5

Please sign in to comment.