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:
Ben Wiederhake 2020-07-26 23:14:33 +02:00 committed by Andreas Kling
parent be89627bf5
commit 5692fa6c39
Notes: sideshowbarker 2024-07-19 04:28:42 +09:00
4 changed files with 20 additions and 0 deletions

View file

@ -2,3 +2,7 @@
Name=Eyes
Executable=/bin/Eyes
Category=Demos
[Icons]
16x16=/res/icons/16x16/app-eyes.png
32x32=/res/icons/32x32/app-eyes.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -26,8 +26,12 @@
#include "EyesWidget.h"
#include <LibCore/ArgsParser.h>
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Application.h>
#include <LibGUI/Menu.h>
#include <LibGUI/MenuBar.h>
#include <LibGUI/Window.h>
#include <LibGfx/Bitmap.h>
int main(int argc, char* argv[])
{
@ -76,10 +80,22 @@ int main(int argc, char* argv[])
auto window = GUI::Window::construct();
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_has_alpha_channel(true);
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();
eyes.track_cursor_globally();