mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
This commit is contained in:
parent
939a605334
commit
11580babbf
269 changed files with 1513 additions and 1315 deletions
|
@ -32,8 +32,8 @@
|
|||
SampleWidget::SampleWidget(GUI::Widget* parent)
|
||||
: GUI::Frame(parent)
|
||||
{
|
||||
set_frame_shape(FrameShape::Container);
|
||||
set_frame_shadow(FrameShadow::Sunken);
|
||||
set_frame_shape(Gfx::FrameShape::Container);
|
||||
set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
set_frame_thickness(2);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
|||
status_widget->set_layout(make<GUI::HBoxLayout>());
|
||||
|
||||
m_elapsed = GUI::Label::construct(status_widget);
|
||||
m_elapsed->set_frame_shape(FrameShape::Container);
|
||||
m_elapsed->set_frame_shadow(FrameShadow::Sunken);
|
||||
m_elapsed->set_frame_shape(Gfx::FrameShape::Container);
|
||||
m_elapsed->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
m_elapsed->set_frame_thickness(2);
|
||||
m_elapsed->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_elapsed->set_preferred_size(80, 0);
|
||||
|
@ -59,8 +59,8 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
|||
m_sample_widget = SampleWidget::construct(sample_widget_container);
|
||||
|
||||
m_remaining = GUI::Label::construct(status_widget);
|
||||
m_remaining->set_frame_shape(FrameShape::Container);
|
||||
m_remaining->set_frame_shadow(FrameShadow::Sunken);
|
||||
m_remaining->set_frame_shape(Gfx::FrameShape::Container);
|
||||
m_remaining->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
m_remaining->set_frame_thickness(2);
|
||||
m_remaining->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_remaining->set_preferred_size(80, 0);
|
||||
|
@ -87,14 +87,14 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
|||
|
||||
m_stop = GUI::Button::construct(control_widget);
|
||||
m_stop->set_enabled(false);
|
||||
m_stop->set_icon(GraphicsBitmap::load_from_file("/res/icons/16x16/stop.png"));
|
||||
m_stop->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/stop.png"));
|
||||
m_stop->on_click = [&](GUI::Button&) { m_manager.stop(); };
|
||||
|
||||
m_status = GUI::Label::construct(this);
|
||||
m_status->set_frame_shape(FrameShape::Box);
|
||||
m_status->set_frame_shadow(FrameShadow::Raised);
|
||||
m_status->set_frame_shape(Gfx::FrameShape::Box);
|
||||
m_status->set_frame_shadow(Gfx::FrameShadow::Raised);
|
||||
m_status->set_frame_thickness(4);
|
||||
m_status->set_text_alignment(TextAlignment::CenterLeft);
|
||||
m_status->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
m_status->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||
m_status->set_preferred_size(0, 18);
|
||||
m_status->set_text("No file open!");
|
||||
|
|
|
@ -85,8 +85,8 @@ private:
|
|||
RefPtr<GUI::Label> m_remaining;
|
||||
RefPtr<Slider> m_slider;
|
||||
RefPtr<SampleWidget> m_sample_widget;
|
||||
RefPtr<GraphicsBitmap> m_play_icon { GraphicsBitmap::load_from_file("/res/icons/16x16/play.png") };
|
||||
RefPtr<GraphicsBitmap> m_pause_icon { GraphicsBitmap::load_from_file("/res/icons/16x16/pause.png") };
|
||||
RefPtr<Gfx::Bitmap> m_play_icon { Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png") };
|
||||
RefPtr<Gfx::Bitmap> m_pause_icon { Gfx::Bitmap::load_from_file("/res/icons/16x16/pause.png") };
|
||||
RefPtr<GUI::Button> m_play;
|
||||
RefPtr<GUI::Button> m_stop;
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ int main(int argc, char** argv)
|
|||
window->set_title("SoundPlayer");
|
||||
window->set_resizable(false);
|
||||
window->set_rect(300, 300, 350, 140);
|
||||
window->set_icon(GraphicsBitmap::load_from_file("/res/icons/16x16/app-sound-player.png"));
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-sound-player.png"));
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
auto app_menu = GUI::Menu::construct("SoundPlayer");
|
||||
|
@ -94,7 +94,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto help_menu = GUI::Menu::construct("Help");
|
||||
help_menu->add_action(GUI::Action::create("About", [](auto&) {
|
||||
GUI::AboutDialog::show("SoundPlayer", GraphicsBitmap::load_from_file("/res/icons/32x32/app-sound-player.png"));
|
||||
GUI::AboutDialog::show("SoundPlayer", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-sound-player.png"));
|
||||
}));
|
||||
|
||||
menubar->add_menu(move(app_menu));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue