Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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."
|
|
As per previous discussion, it was decided that the Stream classes
should be constructed on the heap.
While I don't personally agree with this change, it does have the
benefit of avoiding Function object reconstructions due to the lambda
passed to Notifier pointing to a stale object reference. This also has
the benefit of not having to "box" objects for virtual usage, as the
objects come pre-boxed.
However, it means that we now hit the heap everytime we construct a
TCPSocket for instance, which might not be desirable.
|
|
|
|
|
|
Port KeyboardMapperWidget to use the new Core::Stream instead of the old
IODevice.
If you can't beat 'em, join 'em.
|
|
KeyboardMapperWidget's load_map_from_file, load_map_from_system, save,
and save_to_file now all return ErrorOr<void> and no longer handles
alerting the user to potential errors.
main is now responsible for handling errors originating from its calls
to these four functions; it will simply alert the user using the new
method KeyboardMapperWidget::show_error_to_user(Error), which simply
creates a MassageBox displaying the error's string_literal.
This makes the whole program slight more clean feeling :^).
|
|
|
|
KeyButton now only responds to clicks on the key-cap's face. This
corresponds to when the cursor switches from the default arrow to a
hand.
|
|
Fixes a bug where KeyButtons would display null characters. A single
null character should be handled as an empty string.
|
|
Renames some variables in KeyButton.cpp to increase clarity and grants
some slightly opaque inline variables names.
|
|
When depressing a key, KeyboardMapperWidget::keydown_event() will now
update only the pressed state of the button associated with the specific
key, instead of also setting the pressed state of the all the buttons to
false.
This makes it possible to highlight multiple pressed keys at once and
makes the code more consistent; the implementation of keyup_event
implied that this was a feature of the program.
|
|
Extract the mapping of a name to a character map into its own method.
This only slightly reduces the number of lines, going from 24 to 17
lines, but makes the code somewhat more readable and reduces repetition.
|
|
Extract the creation of map-selection radio buttons from create_frame
into the new private method add_map_radio_button(map_name, button_text)
turning 24 lines into 4 + 6 lines. This makes create_frame a little
easier to read. :^)
|
|
There's only two places where we're using the C99 feature of array
designated initalizers. This feature seemingly wasn't included with
C++20 designated initalizers for classes and structs. The only two
places we were using this feature are suitably old and isolated that
it makes sense to just suppress the warning at the usage sites while
discouraging future array designated intializers in new code.
|
|
|
|
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
|
|
When using a dark theme the name of the key does not show up well at
all. This is due to it being set with pallete().button_text(), which for
dark themes is a light color. As Keyboard Mapper does not follow the
system color theme, the text on the keys should not either.
|
|
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same
margin on all edges, for example. The constructors follow CSS' style of
specifying margins. The added constructors are:
- Margins(int all): Sets the same margin on all edges.
- Margins(int vertical, int horizontal): Sets the first argument to top
and bottom margins, and the second argument to left and right margins.
- Margins(int top, int vertical, int bottom): Sets the first argument to
the top margin, the second argument to the left and right margins,
and the third argument to the bottom margin.
|
|
|
|
Otherwise, space is reserved but menus aren't shown.
|
|
Applications previously had to create a GUI::Menubar object, add menus
to it, and then call GUI::Window::set_menubar().
This patch introduces GUI::Window::add_menu() which creates the menubar
automatically and adds items to it. Application code becomes slightly
simpler as a result. :^)
|
|
This adds component declarations so that users can select to not build
certain parts of the OS.
|
|
|
|
Previously there was no visual clue letting the user know that loading
from file failed.
|
|
This fixes #7699.
It would be nice to also show a GUI alert informing about the failure,
but I will leave that for the future.
|
|
|
|
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
|
|
By using serenity_app() instead of serenity_bin() in the CMakeLists.txt,
we can embed an icon as usual.
|
|
We already do this in the about dialog and across the system in general.
|
|
|
|
Not sure why some menus did have one and others didn't, even in the
same application - now they all do. :^)
I added character shortcuts to some menu actions as well.
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:
- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar
This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
|
|
|
|
Good-bye LogStream. Long live AK::Format!
|
|
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
This is now consistent with the other dialog classes.
|
|
|