Commit graph

25 commits

Author SHA1 Message Date
Timothy Flynn 2d40df821a Keymap: Draw the current keymap text with the correct theme color
Otherwise it is dark and hard to read against dark themes.
2024-03-02 19:24:53 +00: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
Karol Kosek 03a54a519a Userland: Port remaining calls to Widget::set_tooltip_deprecated()
Replaces `set_tooltip_deprecated(string);` with
`set_tooltip(MUST(String::from_deprecated_string(string)));`
purely to get rid of the deprecated function in the following commit.
2023-10-06 08:20:11 +02:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
camc d978dd4af8 LibGUI: Add deprecated suffix to {set_,}tooltip in Widget 2023-08-18 10:43:37 +01:00
Lucas CHOLLET 1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
Lucas CHOLLET 7d6908d9a5 Applets/Keymap: Repaint applet on keymap change 2023-03-09 21:42:23 +01:00
Andreas Kling 5979ce8316 Applets/Keymap: Repaint applet on demand only
Instead of poking into the the applet window backing store whenever
the keymap changes, we now drive the GUI updates properly via
update() and paint_event().

This fixes an issue where changing the system font would cause a
"ghosting" effect in the keymap applet.
2023-03-04 00:29:38 +01:00
Tim Schumacher 82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Sam Atkins 0c24522635 LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off!

This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
  the only one.

The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06 13:36:02 -07:00
Ben Wiederhake b83cb09db1 Everywhere: Fix badly-formatted includes
In 7c5e30daaa, the focus was "only" on
Userland/Libraries/, whereas this commit cleans up the remaining
headers in the repo, and any new badly-formatted include.
2023-01-02 11:06:15 -05:00
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Tim Schumacher ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
Cr4xy ac60633694 Keymap: Rename context menu item "Settings" to "Keyboard Settings"
This is a very small change to improve consistency between applet
context menu item names.
2022-09-09 18:59:04 +01:00
Timur Sultanov 9906f41e01 Keymap+WindowServer: Add context menu to keymap applet
Adding a context menu which lists configured keymaps and allows
setting the active keymap
2022-07-21 16:40:47 +02:00
sin-ack 3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Olivier De Cannière 6c202ee4a9 LibGUI: Fix typo in ConnectionToWindowManagerServer 2022-06-01 19:31:34 +02:00
MacDue 7c8541b914 Userland: Use GUI::Process::spawn_or_show_error() for spawn() from a GUI 2022-05-25 23:14:22 +01:00
MacDue 3fc0350caf LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawn
This makes the wrapper more like the rest in LibCore, and also
removes the annoying limitation of not supporting arguments.

There are three overloads one for String, char const *, and StringView
argument lists. As long as there are <= 10 arguments the argv list
will be allocated inline, otherwise on the heap.
2022-05-25 23:14:22 +01:00
Idan Horowitz 086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Andreas Kling a6a8ba80fc LibGfx: Rename Color::from_rgba() => Color::from_argb()
This matches the rename of RGBA32 to ARGB32. It also makes more sense
when you see it used with 32-bit hexadecimal literals:

Before:
    Color::from_rgba(0xaarrggbb)

After:
    Color::from_argb(0xaarrggbb)
2022-03-04 23:40:21 +01:00
Itamar af132fdbd1 Userland: Rename WindowManagerServerConnection
Rename WindowManagerServerConnection=>ConnectionToWindowManagerServer.

This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +01:00
Lenny Maiorani f2d8c488ec Userland/Applets: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-13 21:27:17 +00:00
Maciej 99e3e42fa5 Keymap Applet: Spawn KeyboardSettings when clicking 2022-02-04 21:30:31 +01:00
Timur Sultanov b9c558f6c6 WindowServer+Keymap+LibGUI: Add widget to display current keymap 2022-02-03 00:47:22 +01:00