Commit Graph

16 Commits

Author SHA1 Message Date
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
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Andreas Kling
52a250cb61 LibGUI: Make MenuBar a Core::Object
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-21 16:19:18 +02:00
Andreas Kling
8311b24620 Solitaire: Use a pre-scaled buggie image for the back of cards
Instead of scaling on the fly, which is not super aesthetic yet.
2020-04-20 15:24:59 +02:00
Andreas Kling
228ace854c LibGfx: Don't allow creating bitmaps whose sizes would overflow
If the area or size_in_bytes calculation for a Gfx::Bitmap would
overflow, we now refuse to create such a bitmap and return nullptr.

Thanks to @itamar8910 for finding this! :^)
2020-04-15 12:28:49 +02:00
Andreas Kling
26eeaef0a8 LibGUI: Add MenuBar::add_menu(name)
This allows us to construct menus in a more natural way:

    auto& file_menu = menubar->add_menu("File");
    file_menu.add_action(...);

Instead of the old way:

    auto file_menu = GUI::Menu::construct();
    file_menu->add_action(...);
    menubar->add_menu(file_menu);
2020-04-04 12:58:05 +02:00
Tibor Nagy
cfd1e783a5 Solitaire: Set parent window for AboutDialog 2020-03-30 10:52:09 +02:00
Tibor Nagy
809490dcb6 Solitaire: Use dark green for empty stack outlines
Looks nicer than using dark gray. Derived from the background color.
2020-03-19 22:52:18 +01:00
Tibor Nagy
f347dd5c5e Applications: Use "Document - AppName" window title format
Fixes #1444
2020-03-13 23:30:12 +01:00
Till Mayer
de6f697eba Solitaire: Fix automatic moving of cards
A previous change trying to fix an assertion error completely broke
the automatic moving of cards, this commit will fix this problem
2020-03-13 10:40:45 +01:00
Till Mayer
3e25c58755 Solitaire: Minor tweaks to animation x_velocity and bouncyness 2020-03-13 10:40:45 +01:00
Till Mayer
62422eecdc Solitaire: Add about dialog and 32x32 icon 2020-03-13 10:40:45 +01:00
Till Mayer
2af94bbf48 Solitaire: Remove redundant check and fix formatting mistakes 2020-03-11 10:06:00 +01:00
Till Mayer
629036edfe Solitaire: Make sure to not add card twice to m_focused_cards
There is a possibility that the same card gets added twice to
m_focused_cards when first mousedown_event fires and then
doubleclick_event, without the cards redrawing first. This would cause
mouseup_event to try to pop too many cards from the stack, causing an
assertion to fail.

When the system is laggy there is also a high possibility that
mousedown_event would fire twice without redrawing the cards first,
causing another assertion to fail. Addditional mousedown_events will
just be ignored now.
2020-03-11 10:06:00 +01:00
Till Mayer
fe5cc7ce68 Games: Added solitaire
Added a solitaire game. Currently there are graphics missing on some
of the cards, but the game is fully functional.

Press F12 to show the game-over animation manually.
2020-03-09 21:36:59 +01:00