summaryrefslogtreecommitdiff
path: root/Userland/Applications/KeyboardMapper
AgeCommit message (Collapse)Author
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
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-04-24AK: Add new failable `JsonArray::{append/set}` functionsCameron Youell
Move all old usages to the more explicit `JsonArray:must_{append/set}`
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-04-18LibGUI+Userland: Improve error and font handling for InputBoxthankyouverycool
Adds fallible factories, ports DeprecatedString, and rebuilds the layout to accomodate system font changes.
2023-04-15LibGfx+Userland: Add width_rounded_up() helperthankyouverycool
2023-03-13Everywhere: Remove unintentional partial stream reads and writesTim Schumacher
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
2023-03-04Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()Andreas Kling
The only remaining clients of this API are specific to bitmap fonts and editing thereof.
2023-02-25Everywhere: Use _{short_,}string to create Strings from literalsLinus Groh
2023-02-18Userland: Specify margins and spacing in the GUI::Layout constructorSam Atkins
2023-02-18Userland: Use Widget::add_spacer() everywhereSam Atkins
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13Userland: Set Button text using the new String classKarol Kosek
2023-02-13Userland: Replace usages of AbstractButton::text_deprecated with text()Karol Kosek
2023-02-13LibGUI+Userland: Add `_deprecated` suffix to AbstractButton::{set_,}textKarol Kosek
2023-02-10Everywhere: Remove needless copies of Error / ErrorOr instancesTimothy Flynn
Either take the underlying objects with release_* methods or move() the instances around.
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
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-03LibGfx: Make Font::width() return a floatAndreas Kling
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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-11-14KeyboardMapper: Call event.ignore() on keydown in the main widgetZaggy1024
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
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-10-25Userland: Let applications make use of make_command_palette_action()demostanis
2022-10-04AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most placesNico Weber
Doesn't use them in libc headers so that those don't have to pull in AK/Platform.h. AK_COMPILER_GCC is set _only_ for gcc, not for clang too. (__GNUC__ is defined in clang builds as well.) Using AK_COMPILER_GCC simplifies things some. AK_COMPILER_CLANG isn't as much of a win, other than that it's consistent with AK_COMPILER_GCC.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-08KeyboardMapper: Ask for unsaved changes on window close and file openKarol Kosek
2022-03-08KeyboardMapper: Reset modified flag after loading a fileKarol Kosek
2022-03-08KeyboardMapper: Display dirty close icon when the file is changedKarol Kosek
2022-02-14Applications: Use default constructors/destructorsLenny Maiorani
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-01-13LibCore+Userland+Tests: Convert Stream APIs to construct on heapsin-ack
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.
2022-01-09KeyboardMapper: Propagate errors using try_set_main_widget in maincreator1creeper1
2022-01-08KeyboardMapper: Add support for dynamic keyboard visualizationJean-Paul Balabanian
2022-01-06KeyboardMapper: Port to Core::StreamRasmusNylander
Port KeyboardMapperWidget to use the new Core::Stream instead of the old IODevice. If you can't beat 'em, join 'em.
2022-01-06KeyboardMapper: Propagate errors using ErrorOr and TRYRasmusNylander
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 :^).
2022-01-06KeyboardMapper: Port to LibMainRasmusNylander
2022-01-06KeyboardMapper: Fix discrepancy between cursor and button clickabilityRasmusNylander
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.
2022-01-06KeyboardMapper: Fix displaying null charactersRasmusNylander
Fixes a bug where KeyButtons would display null characters. A single null character should be handled as an empty string.
2022-01-06KeyboardMapper: Name formerly inlined variablesRasmusNylander
Renames some variables in KeyButton.cpp to increase clarity and grants some slightly opaque inline variables names.
2022-01-06KeyboardMapper: Show multiple pressed keys at onceRasmusNylander
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.
2022-01-06KeyboardMapper: Extract method map_from_nameRasmusNylander
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.
2022-01-06KeyboardMapper: Extract creation of map-selection buttonsRasmusNylander
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. :^)
2022-01-04Userland: Locally suppress -Wc99-designator and re-enable globallyAndrew Kaster
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.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-02Applications: Fix visibility of Object-derivative constructorsBen Wiederhake
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.
2021-09-06Keyboard Mapper: Better text color for buttons in dark themeAnders Fimreite
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.