Commit Graph

581 Commits

Author SHA1 Message Date
Tim Ledbetter
19dfdeeaec GameOfLife: Add a tick counter to the status bar
The counter is incremented after each new generation and reset
whenever any cell on the board is toggled. Resizing the board
does not reset the tick count.
2023-09-17 16:51:58 -06:00
Tim Ledbetter
0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Tim Ledbetter
3c9dee5d5a GameOfLife: Use the same play/pause action in the menu and toolbar
This prevents the menu and toolbar action state getting out of sync,
which could happen previously. The menu item also now shows the
appropriate icon rather than a checkbox.
2023-09-16 11:06:33 +02:00
Tim Ledbetter
ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Tim Ledbetter
9a6927c575 GameOfLife: Ensure BoardWidget can always contain the board
Previously, when there were more rows or columns than the BoardWidget
could contain, nothing was displayed. The BoardWidget minimum size is
now set whenever the number of rows or columns changes.
2023-09-13 07:45:49 +01:00
Tim Ledbetter
871f5ba431 2048: Disable the undo and redo actions when unavailable
This change also ensures that the redo stack is cleared when a move is
made, so that it isn't possible to redo a previous move after having
made a new one.
2023-09-13 07:27:01 +02:00
Bastiaan van der Plaat
494a8cb816 AK: Add to_radians and to_degrees math functions 2023-09-10 08:38:29 +01:00
Reza
ffc0046d74 Snake: Replace DeprecatedString with String 2023-09-09 10:50:03 -06:00
Andreas Kling
545d8336b8 LibGfx: Convert Font APIs to return String instead of DeprecatedString 2023-09-06 11:29:03 -04:00
Cubic Love
91269a8064 Chess: Capitalize chess set names + Rename 'stelar7' to 'Classic'
Now when selecting a chess set in Games Settings, the names of the sets
are capitalized which looks much neater.

The default set 'stelar7' has been renamed to 'Classic' to reflect its
default vanilla design, as opposed to more stylized sets.
This commit also updates any code references to this set.
2023-08-29 10:28:24 +02:00
implicitfield
2114c27656 Flood: Replace usage of DeprecatedString 2023-08-23 13:28:07 +02:00
implicitfield
adaf4a9ed5 Flood: Use the new GML compiler 2023-08-23 13:28:07 +02:00
implicitfield
8434b3a0c6 Flood: Propagate errors when creating SettingsDialog 2023-08-23 13:28:07 +02:00
thankyouverycool
57f3b18109 LibGUI+Userland: Remove Toolbar::try_add_{action,separator}()
These calls largely occur during initialization before there's
unsaved state worth preserving
2023-08-15 15:56:34 +02:00
Andreas Kling
bd61e75e0b LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
2023-08-14 14:57:54 +02:00
Andreas Kling
f2faf2767f LibGUI: Remove Menu::try_add_action()
And fall back to the infallible add_action().
2023-08-14 14:57:54 +02:00
Andreas Kling
eec328e2ab LibGUI: Remove Menu::try_add_submenu()
And fall back to the infallible add_submenu().
2023-08-14 14:57:54 +02:00
Andreas Kling
1525fa3b8f LibGUI: Remove Menu::try_add_separator()
And fall back to the infallible add_separator().
2023-08-14 14:57:54 +02:00
Andreas Kling
8322b31b97 LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>().

Work towards #20557.
2023-08-14 14:57:54 +02:00
kleines Filmröllchen
1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
Lucas CHOLLET
3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Andreas Kling
34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
aryanbaburajan
eb85291a18 Chess: Replace usage of DeprecatedString 2023-08-06 22:21:10 +02:00
aryanbaburajan
bc8cad31de 2048: Replace usage of DeprecatedString 2023-08-06 22:21:10 +02:00
Valtteri Koskivuori
d1f6540196 Snake: Update snake skin color interactively while picking
The snake now changes color while interacting with `GUI::ColorPicker`
2023-07-24 11:30:54 +03:30
Sam Atkins
7d0f70bfa0 Userland: Use AK::human_readable_digital_time() instead of custom code
Use this handy AK function instead of reimplementing the formatting code
several times. The one minor difference is that now, hours are only
shown if the duration is at least an hour long, but that seems like an
improvement to me. :^)
2023-07-19 08:45:43 -04:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Daniel
4314ed72e6 FlappyBug: Replace usage of DeprecatedString 2023-07-05 12:13:44 +01:00
Daniel
0eb09a0b59 BrickGame: Propagate errors 2023-07-05 08:48:10 +02:00
kleines Filmröllchen
33829f05fe Userland: Convert config listener callbacks to use StringView
The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
2023-06-27 15:37:00 +01:00
Sam Atkins
b264d29515 Snake: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins
46f365df5c MasterWord: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Sam Atkins
2dc96155f7 GameOfLife: Show status tips in Statusbar 2023-06-17 20:36:03 +02:00
Karol Kosek
92ff12a0d0 LibGUI+Userland: Port StatusBar::set_override_text() to String 2023-06-15 13:53:22 +01:00
Karol Kosek
5234a30731 LibGUI+Userland: Port Action status tips to String 2023-06-15 13:53:22 +01:00
Karol Kosek
4b169cf25f LibGUI+Userland: Use action text as a fallback in Action::status_tip()
Many applications already do this in their code. This change will simply
move the logic to a single function to stop repeating ourselves!
2023-06-15 13:53:22 +01:00
Karol Kosek
2029750519 LibGUI+Userland: Port StatusBar::text() and set_text functions to String 2023-06-15 13:53:22 +01:00
Karol Kosek
8bd68198d6 Userland: Filter out unsupported file types in open dialogs in more apps 2023-06-11 09:40:17 +01:00
Ben Wiederhake
f20d04726a LibFileSystem+Everything: Remove resolve_executable_from_environment 2023-06-06 23:46:36 +02:00
Ben Wiederhake
bdeccf8844 Chess+ChessEngine: Fix stockfish by setting correct blocking flag
Stockfish apparently cannot handle non-blocking I/O, and it does not
make sense to assume that all chess engines can do so.

Fixes #18946.
2023-05-27 18:44:21 +02:00
kleines Filmröllchen
effcd080ca Userland: Remove remaining users of Duration::now_realtime()
This is a clear sign that they want to use a UnixDateTime instead.

This also adds support for placing durations and date times into SQL
databases via their millisecond offset to UTC.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen
213025f210 AK: Rename Time to Duration
That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
2023-05-24 23:18:07 +02:00
Jelle Raaijmakers
f391ccfe53 LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive
Previously, calling `.right()` on a `Gfx::Rect` would return the last
column's coordinate still inside the rectangle, or `left + width - 1`.
This is called 'endpoint inclusive' and does not make a lot of sense for
`Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would
return 4 as its right side. This same problem exists for `.bottom()`.

This changes `Gfx::Rect` to be endpoint exclusive, which gives us the
nice property that `width = right - left` and `height = bottom - top`.
It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly
the same.

All users of `Gfx::Rect` have been updated accordingly.
2023-05-23 12:35:42 +02:00
Tim Ledbetter
b7f4363791 Chess: Make the resign button have no effect after the game ends 2023-05-23 11:43:22 +02:00
Tim Ledbetter
5a25082be5 Chess: Don't ask the engine to make a move if the game is finished
Previously, the engine would attempt to make a move if the engine was
changed after the game had ended.

This change also allows the player to always flip the board when the
game is finished, instead of only being able to flip the board on
their turn.
2023-05-23 11:43:22 +02:00
thankyouverycool
02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
Tim Ledbetter
cf4a43e4c0 Chess+GameSettings: Optionally highlight the king when in check
When either king is in check, its square is now highlighted with a red
background. This behavior can be toggled in GameSettings.
2023-05-10 12:13:35 +01:00
Lucas CHOLLET
8c34959b53 AK: Add the Input word to input-only buffered streams
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09 11:18:46 +02:00
Ben Wiederhake
449911c286 Chess: Slightly improve error propagation during startup 2023-05-07 14:04:55 +02:00
Ben Wiederhake
0fe29a48ad Chess: Avoid IODevice and DeprecatedFile 2023-05-07 14:04:55 +02:00