mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Eyes: Introduce and use icons
The icons are made using a screenshot which was then scaled down. The 16x16 icon needed some light post-processing to look good.
This commit is contained in:
parent
be89627bf5
commit
5692fa6c39
Notes:
sideshowbarker
2024-07-19 04:28:42 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/5692fa6c393 Pull-request: https://github.com/SerenityOS/serenity/pull/2914
4 changed files with 20 additions and 0 deletions
|
@ -2,3 +2,7 @@
|
||||||
Name=Eyes
|
Name=Eyes
|
||||||
Executable=/bin/Eyes
|
Executable=/bin/Eyes
|
||||||
Category=Demos
|
Category=Demos
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
16x16=/res/icons/16x16/app-eyes.png
|
||||||
|
32x32=/res/icons/32x32/app-eyes.png
|
||||||
|
|
BIN
Base/res/icons/16x16/app-eyes.png
Normal file
BIN
Base/res/icons/16x16/app-eyes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Base/res/icons/32x32/app-eyes.png
Normal file
BIN
Base/res/icons/32x32/app-eyes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
|
@ -26,8 +26,12 @@
|
||||||
|
|
||||||
#include "EyesWidget.h"
|
#include "EyesWidget.h"
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
|
#include <LibGUI/AboutDialog.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
|
#include <LibGUI/Menu.h>
|
||||||
|
#include <LibGUI/MenuBar.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
|
#include <LibGfx/Bitmap.h>
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
@ -76,10 +80,22 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
window->set_title("Eyes");
|
window->set_title("Eyes");
|
||||||
|
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-eyes.png"));
|
||||||
window->set_rect(350, 270, 75 * (full_rows > 0 ? max_in_row : extra_columns), 100 * (full_rows + (extra_columns > 0 ? 1 : 0)));
|
window->set_rect(350, 270, 75 * (full_rows > 0 ? max_in_row : extra_columns), 100 * (full_rows + (extra_columns > 0 ? 1 : 0)));
|
||||||
window->set_has_alpha_channel(true);
|
window->set_has_alpha_channel(true);
|
||||||
|
|
||||||
auto& eyes = window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns);
|
auto& eyes = window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns);
|
||||||
|
|
||||||
|
auto menubar = GUI::MenuBar::construct();
|
||||||
|
auto& app_menu = menubar->add_menu("Eyes Demo");
|
||||||
|
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("Mouse Demo", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-eyes.png"), window);
|
||||||
|
}));
|
||||||
|
|
||||||
|
app->set_menubar(move(menubar));
|
||||||
window->show();
|
window->show();
|
||||||
eyes.track_cursor_globally();
|
eyes.track_cursor_globally();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue