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:
parent
56cd8b4d17
commit
b4c18870de
3 changed files with 21 additions and 5 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue