1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

SoundPlayer: Add option to hide scope

Fixes #521. The scope can be hidden using the option in the app menu.
This commit is contained in:
Till Mayer 2019-11-09 18:03:12 +01:00 committed by Andreas Kling
parent 56cd8b4d17
commit b4c18870de
3 changed files with 21 additions and 5 deletions

View file

@ -26,7 +26,11 @@ SoundPlayerWidget::SoundPlayerWidget(GWindow& window, NonnullRefPtr<AClientConne
m_elapsed->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
m_elapsed->set_preferred_size(80, 0);
m_sample_widget = SampleWidget::construct(status_widget);
auto sample_widget_container = GWidget::construct(status_widget.ptr());
sample_widget_container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
sample_widget_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
m_sample_widget = SampleWidget::construct(sample_widget_container);
m_remaining = GLabel::construct(status_widget);
m_remaining->set_frame_shape(FrameShape::Container);
@ -82,6 +86,11 @@ SoundPlayerWidget::Slider::~Slider()
{
}
void SoundPlayerWidget::hide_scope(bool hide)
{
m_sample_widget->set_visible(!hide);
}
void SoundPlayerWidget::open_file(String path)
{
if (!path.ends_with(".wav")) {