ladybird/Userland/Applications/SoundPlayer/NoVisualizationWidget.cpp
Andreas Kling 235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00

31 lines
751 B
C++

/*
* Copyright (c) 2021, Cesar Torres <shortanemoia@protonmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "NoVisualizationWidget.h"
#include <LibGUI/Painter.h>
NoVisualizationWidget::NoVisualizationWidget()
{
}
NoVisualizationWidget::~NoVisualizationWidget()
{
}
void NoVisualizationWidget::paint_event(GUI::PaintEvent& event)
{
Frame::paint_event(event);
GUI::Painter painter(*this);
if (!m_serenity_bg)
m_serenity_bg = Gfx::Bitmap::try_load_from_file("/res/wallpapers/sunset-retro.png").release_value_but_fixme_should_propagate_errors();
painter.draw_scaled_bitmap(frame_inner_rect(), *m_serenity_bg, m_serenity_bg->rect(), 1.0f);
}
void NoVisualizationWidget::set_buffer(RefPtr<Audio::Buffer>)
{
}