Commit graph

283 commits

Author SHA1 Message Date
Ali Mohammad Pur eaa2d69d73 LibGUI+Everywhere: Rename the 'style' frame property to 'frame_style'
'set_frame_style' is what Frame itself uses to set the value, and a
significant number of GML files use 'frame_style' instead of just
'style', so let's switch to it and use it everywhere consistently.
2024-04-30 17:46:41 -06:00
Shannon Booth e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Sam Atkins 44ca55aaf8 LibFileSystemAccessClient+Userland: Return file paths as ByteStrings
Where it was straightforward to do so, I've updated the users to also
use ByteStrings for their file paths, but most of them have a temporary
String::from_byte_string() call instead.
2024-01-29 23:14:39 +00:00
Sam Atkins 9657f4cabb LibGUI+Userland: Take ByteString in set_most_recently_open_file() 2024-01-24 11:07:03 +00:00
Hugh Davenport 13c66ebf12 DevTools: Add fullscreen option
All except SQLStudio, as that causes a crash
2024-01-14 15:18:43 -07:00
Sam Atkins e0fd5beb36 LibGUI+Applications: Default the SpinBox min/max to the full int range
By default, a SpinBox's value should be unlimited, (or as close as we
can get to that,) and then the GML or code can impose a limit if
needed. This saves the developer from entering an arbitrary "big" max
value when they want the value to have no maximum.

I've audited the use of SpinBox and added `min: 0`, and removed a `max`,
where appropriate. All existing SpinBoxes constructed in code have a
range set explicitly as far as I can tell.
2024-01-14 13:46:14 +00:00
Shannon Booth e2e7c4d574 Everywhere: Use to_number<T> instead of to_{int,uint,float,double}
In a bunch of cases, this actually ends up simplifying the code as
to_number will handle something such as:

```
Optional<I> opt;
if constexpr (IsSigned<I>)
    opt = view.to_int<I>();
else
    opt = view.to_uint<I>();
```

For us.

The main goal here however is to have a single generic number conversion
API between all of the String classes.
2023-12-23 20:41:07 +01:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Shannon Booth d1ed04a6cb FontEditor: Use String.to_uppercase
Remove the last user of Unicode::to_unicode_uppercase_full
2023-11-28 17:15:27 -05:00
Sam Atkins 18dfc61280 LibGfx: Expose BitmapFont glyph data as Spans instead of raw pointers 2023-10-10 14:36:25 +02:00
Sam Atkins a1c24ef3ad LibGfx: Remove infallible BitmapFont::create() factory function
This was only used in TestFontHandling. So, let's remove it, and use
the "create" name for the fallible one.
2023-10-10 14:36:25 +02:00
Karol Kosek e75d694974 Userland: Compare event MIME type list with a StringView
The following commit will port MIME types to String. Traits<String>
- used in Vector::contains_slow - can't compare String type with char*,
so we need to use StringView instead.
2023-09-29 14:40:21 +01:00
kleines Filmröllchen 062e0db46c LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
2023-09-27 03:22:56 +02:00
Bastiaan van der Plaat 5d37e1c220 Userland: Remember window state of productivity / editor applications 2023-09-24 20:00:00 -06:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Tim Ledbetter a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Tim Ledbetter 0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Tim Ledbetter ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Tim Ledbetter c74f7e5f2a Userland: Don't use String::from_utf8() for literal strings 2023-09-15 08:44:52 +02:00
Andreas Kling 545d8336b8 LibGfx: Convert Font APIs to return String instead of DeprecatedString 2023-09-06 11:29:03 -04: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 676ef0cc3d LibGUI: Make Menu::add_recent_files_list() infallible 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
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
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 27011cf55d LibFSAC+Userland: Pass options for FSAC::open_file() using a struct
It was rather inconvenient having to specify all arguments if you wanted
to modify only the last one.
2023-06-11 09:40:17 +01:00
thankyouverycool caa8f43dbe Applications+Demos+LibGUI: Migrate to fallible WizardDialogs and Pages
And port page text to String. Also removes WizardDialog::show() helper
as all current implementations prefer to derive their own Dialog.
2023-06-09 17:21:43 +02:00
thankyouverycool 96e60c98cf FontEditor: Propagate errors in update_statusbar()
Errors are sent only to stderr as they can be spammy
2023-06-09 17:21:43 +02:00
thankyouverycool fe6b36507f FontEditor: Check complete mime type on paste_glyphs() 2023-06-09 17:21:43 +02:00
thankyouverycool 9b431bc2ab FontEditor: Don't add ineffectual glyph moves to the undo stack
And fix effectual glyph paints failing to create new undo events when
beginning at unmodifiable cells but mousing to settable ones.
2023-06-09 17:21:43 +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
thankyouverycool 444470b238 Applications: Improve FSAC error message handling
Fixes apps showing redundant error messages and terminating
unnecessarily on failed file requests. It's nicer to drop the
user off at the equivalent of a default document on failure if
possible.

Also fixes TextEditor not showing response errors for missing files
in the recently opened list.
2023-05-19 06:20:41 +02:00
thankyouverycool 587c44cfbb FontEditor: Filter files by BitmapFont in FilePicker 2023-05-17 06:47:57 +02:00
thankyouverycool a62f204b25 FontEditor: Show complete filename in error messages
And clean up Save and Open action code style.
2023-05-17 06:47:57 +02:00
thankyouverycool 19b8b9d187 FontEditor: Show recently opened files in File menu
And update GlyphEditorWidget on initialize(). Fixes Editor not showing
the new active glyph when loading recent fonts from a menu.
2023-05-17 06:47:57 +02:00
thankyouverycool c10b1e3aea FontEditor: Add action text to Undo and Redo 2023-05-17 06:47:57 +02:00
thankyouverycool 7fa8fae786 FontEditor: Allow application to launch without a font
Since LibFSAC requires a reified window before loading a font, it
makes sense to have a safe null state for the app.

This lets us stay alive after a failed file request on startup,
handle failure at any point during initialization, and claw back
memory from all our font RefPtrs.

A default startup font or none at all can now be set in FontEditor.ini
2023-05-13 12:53:49 +02:00
thankyouverycool 24046f9adf FontEditor: Let GlyphEditorWidget initialize a null BitmapFont
And remove public reference getters as there is no guarantee they are
nonnull.
2023-05-13 12:53:49 +02:00
thankyouverycool 0ad5e85163 LibGUI+Applications: Let GlyphMapWidget initialize a null Font
FontEditor will need to clear references to its mutable font in
the future while CharacterMap has no use for the highlights clone,
so let's convert GlyphMapWidget's set_font wrapper into a separate
initialize function for the editor and stop hiding the base function
for others. Setting font null in either ultimately points the map to
the system's default font.
2023-05-13 12:53:49 +02:00
thankyouverycool cf4ddd1dcf FontEditor: Move common restoration work into restore_state() 2023-05-13 12:53:49 +02:00
thankyouverycool c7eee16292 FontEditor: Use resultant FSAC filename when Saving-as
Fixes desync between file and title.
2023-05-13 12:53:49 +02:00
thankyouverycool a0f160bfc4 FontEditor: Use fallible {Input,Message}Boxes
And replace DeprecatedString and fix misnamed argument in show_error()
2023-05-13 12:53:49 +02:00
thankyouverycool 6212e5b1f0 FontEditor: Don't crash on missing icons
Instead of crashing on failed icon loading with TRY(), let's report
missing but non-critical resources in detail and gracefully move on.
2023-05-13 12:53:49 +02:00