mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Base+Demos: Add icons to WidgetGallery
This commit is contained in:
parent
ce5ae83963
commit
066ae29c07
Notes:
sideshowbarker
2024-07-19 05:00:47 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/066ae29c07b Pull-request: https://github.com/SerenityOS/serenity/pull/2745
4 changed files with 25 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
|||
[App]
|
||||
Name=WidgetGallery
|
||||
Name=Widget Gallery
|
||||
Executable=/bin/WidgetGallery
|
||||
Category=Demos
|
||||
|
||||
[Icons]
|
||||
16x16=/res/icons/16x16/app-widget-gallery.png
|
||||
32x32=/res/icons/32x32/app-widget-gallery.png
|
||||
|
|
BIN
Base/res/icons/16x16/app-widget-gallery.png
Executable file
BIN
Base/res/icons/16x16/app-widget-gallery.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 195 B |
BIN
Base/res/icons/32x32/app-widget-gallery.png
Executable file
BIN
Base/res/icons/32x32/app-widget-gallery.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 471 B |
|
@ -26,14 +26,19 @@
|
|||
*/
|
||||
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/AboutDialog.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/CheckBox.h>
|
||||
#include <LibGUI/ColorInput.h>
|
||||
#include <LibGUI/GroupBox.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/Image.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/ProgressBar.h>
|
||||
#include <LibGUI/RadioButton.h>
|
||||
|
@ -49,9 +54,22 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-widget-gallery");
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_rect(100, 100, 433, 487);
|
||||
window->set_title("Widget Gallery");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
||||
auto menubar = GUI::MenuBar::construct();
|
||||
|
||||
auto& app_menu = menubar->add_menu("Widget Gallery");
|
||||
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
|
||||
|
||||
auto& help_menu = menubar->add_menu("Help");
|
||||
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
||||
GUI::AboutDialog::show("Widget Gallery", app_icon.bitmap_for_size(32), window);
|
||||
}));
|
||||
|
||||
auto& root_widget = window->set_main_widget<GUI::Widget>();
|
||||
root_widget.set_fill_with_background_color(true);
|
||||
|
@ -314,6 +332,8 @@ int main(int argc, char** argv)
|
|||
window->set_override_cursor(GUI::StandardCursor::Wait);
|
||||
};
|
||||
|
||||
app->set_menubar(move(menubar));
|
||||
|
||||
window->show();
|
||||
|
||||
return app->exec();
|
||||
|
|
Loading…
Reference in a new issue