Commit Graph

12 Commits

Author SHA1 Message Date
Ben Wiederhake
70fe126d01 LibGUI: Enable icons for SubMenus
It doesn't make sense for a top-level menu to have an icon, however
we do not have dedicated classes to distinguish these.

Furthermore, the only other place to store an icon is MenuItem.
Storing it there would be highly confusing, as MenuItem-with-Action
then would have two icons: one in Action and one in MenuItem.
And because we need to be able to replace the icon during realization,
this would need to write-through to Action somehow.

That's why I went with Menu, not MenuItem.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
048f149f51 LibGUI: Refactor icon realization in Menu
This factors out icon realization into its own function, making it possible to
use the same code with other classes that have icon() and set_icon() methods.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
082b7d6b0c LibGUI: Set correct default value during menu destruction 2020-07-28 16:29:44 +02:00
Tom
8ae37bccf1 LibGUI: Fix menu leak when default action changed 2020-07-15 00:11:30 +02:00
Tom
1c1ab71692 WindowServer/LibGUI: Add default menu items and allow default action for context menu
By specifying an optional Action for Menu::popup an application
can specify what item should be displayed as a default item.
2020-07-11 11:45:49 +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
Andreas Kling
f0cde70c18 LibGUI: Simplify submenu construction
The API for adding a submenu to a menu is now:

auto& submenu = menu.add_submenu("Name");
submenu.add_action(my_action);
2020-04-29 11:48:11 +02:00
Andreas Kling
f72e5bbb17 Kernel+LibC: Rename shared buffer syscalls to use a prefix
This feels a lot more consistent and Unixy:

    create_shared_buffer()   => shbuf_create()
    share_buffer_with()      => shbuf_allow_pid()
    share_buffer_globally()  => shbuf_allow_all()
    get_shared_buffer()      => shbuf_get()
    release_shared_buffer()  => shbuf_release()
    seal_shared_buffer()     => shbuf_seal()
    get_shared_buffer_size() => shbuf_get_size()

Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-28 12:55:58 +01:00
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Andreas Kling
b011ea9962 LibGUI: Reduce menu-related header dependencies 2020-02-15 01:56:30 +01:00
Andreas Kling
3fe2640c8c LibGfx: Add forward declaration header
This patch adds <LibGfx/Forward.h> with forward declarations for Gfx.
2020-02-14 23:31:18 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00