summaryrefslogtreecommitdiff
path: root/Userland/Applications/KeyboardMapper
AgeCommit message (Collapse)Author
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.
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
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.
2021-08-01Applications: Remove unused header includesBrian Gianforcaro
2021-07-31KeyboardMapper: Add menus before showing the windowLuK1337
Otherwise, space is reserved but menus aren't shown.
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
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. :^)
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-08Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&>Ali Mohammad Pur
2021-06-06KeyboardMapper: Add GUI alert in case load from file failsNonStdModel
Previously there was no visual clue letting the user know that loading from file failed.
2021-06-03KeyboardMapper: Fix crash upon loading an invalid JSON fileNonStandardModel
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.
2021-06-02KeyboardMapper: Add default path to keymapsNonStandardModel
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
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!
2021-05-12KeyboardMapper: Embed icon in executableLinus Groh
By using serenity_app() instead of serenity_bin() in the CMakeLists.txt, we can embed an icon as usual.
2021-05-12KeyboardMapper: Stylize title as "Keyboard Mapper"Linus Groh
We already do this in the about dialog and across the system in general.
2021-05-12KeyboardMapper: Remove two useless commentsLinus Groh
2021-05-12Everywhere: Add Alt shortcuts to remaining top-level menusLinus Groh
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.
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling
2021-04-29Everywhere: "file name" => "filename"Andreas Kling
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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 *
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
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. :^)
2021-03-25Userland: Turn all application menus into window menus :^)Andreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-26Everywhere: Remove a bunch of redundant 'AK::' namespace prefixesLinus Groh
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. :^)
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...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.
2021-02-20LibGUI: Swap order of InputBox value and parent window argsLinus Groh
This is now consistent with the other dialog classes.
2021-02-01Kernel+keymap+KeyboardMapper: New pledge for getkeymapBen Wiederhake