Commit Graph

18 Commits

Author SHA1 Message Date
Linus Groh
0cab3bca2f LibGUI: Add and use Window::center_on_screen()
Various applications were using the same slightly verbose code to center
themselves on the screen/desktop:

Gfx::IntRect window_rect { 0, 0, width, height };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_rect(window_rect);

Which now becomes:

window->resize(width, height);
window->center_on_screen();
2020-08-15 17:38:19 +02:00
Andreas Kling
6e1cb2bae8 SystemMenu: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
7219f069a5 SystemMenu: Disown spawned programs 2020-08-04 18:17:16 +02:00
Ben Wiederhake
58dd9f2d2a SystemMenu: Add 'Themes' icon 2020-07-28 16:29:44 +02:00
Ben Wiederhake
a9d30a59d9 SystemMenu: Add icons for categories 2020-07-28 16:29:44 +02:00
Ben Wiederhake
404981a892 SystemMenu: Untangle app/category discovery and GUI building
I was a bit confused by the fact that a method named `build_system_menu()`
first enumerates a directory. Moving the app/category discovery to a dedicated
function that returns the GUI-relevant information makes this process a bit
less surprising.

As an added bonus, `g_app_category_menus` was actually only a temporary mapping,
and didn't need to be global. In theory, SystemMenu should use a handful fewer
of bytes now.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
e8ed7f829e SystemMenu: Add icon to 'Exit' menu item 2020-07-28 16:29:44 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Nico Weber
12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
sppmacd
abdf36b171 SystemMenu: Fix shutdown dialog
It was shutting down even if selected Restart.
2020-06-28 14:32:17 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Emanuele Torre
937d0be762 Meta: Add a script check the presence of "#pragma once" in header files
.. and make travis run it.

I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.

It also checks the presence of a (single) blank line above and below the
"#pragma once" line.

I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.

I also ran clang-format on the files I modified.
2020-05-29 07:59:45 +02:00
Sergey Bugaev
602c3fdb3a AK: Rename FileSystemPath -> LexicalPath
And move canonicalized_path() to a static method on LexicalPath.

This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
2020-05-26 14:35:10 +02:00
Andreas Kling
bc7bf727dd SystemMenu: Don't exit if the shutdown dialog is opened but cancelled
Previously opening the shutdown dialog and cancelling out of it would
cause SystemMenu to exit due to the exit-when-there-are-no-more-windows
mechanism in GUI::Application. Fix this by opting out of it.
2020-05-19 17:46:28 +02:00
Andreas Kling
efb3a34e43 SystemMenu: Rename PowerDialog => ShutdownDialog 2020-05-19 17:46:28 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
239fd33405 Services: Move Taskbar and SystemMenu from Applications to Services 2020-05-08 22:00:41 +02:00