summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2021-06-03LibGUI: Hide TextEditor dbgln spew under TEXTEDITOR_DEBUGBrian Gianforcaro
2021-06-03LibGUI: Properly wrap multiple lines in IconView search highlightingMatthew B. Jones
2021-06-03LibGUI: ComboBox now goes upwards when running out of room to renderMatthew Jones
2021-06-03LibGUI: ComboBox now correctly sizes height in relation to taskbarMatthew Jones
2021-06-03LibGUI: Desktop.h should get actual value from TaskbarWindow.hMatthew Jones
2021-06-03LibGUI: Show pressed state for Space and Return key eventsMatthew Jones
Also allows the user to press Esc while the button is being pressed to cancel the button action.
2021-06-02LibGUI+LibGfx+WindowServer: Sanity check window size dimensionsMatthew Jones
Previous to this commit, if a `Window` wanted to set its width or height greater than `INT16_MAX` (32768), both the application owning the Window and the WindowServer would crash. The root of this issue is that `size_would_overflow` check in `Bitmap` has checks for `INT16_MAX`, and `Window.cpp:786` that is called by `Gfx::Bitmap::create_with_anonymous_buffer` would get null back, then causing a chain of events resulting in crashes. Crashes can still occur but with `VERIFY` and `did_misbehave` the causes of the crash can be more readily identified.
2021-06-02LibGUI: Tooltip no longer exceeds screen width, now truncatesMatthew Jones
2021-06-02LibGUI: Fixes Widget->set_visible(false) still maintains focus bugMatthew Jones
When setting a Widget->set_visible(false), if that Widget->has_focus() it will continue to have focus, even though it's not visible to the user anymore. Now calling Widget->set_visible(false) will remove focus from the Widget if it had focus, and the Window will give focus back to the Widget that had it previously, if there was one.
2021-06-02Terminal/LibGUI::TextEditor: Add shift+return to search forwardsMarcus Nilsson
This adds support for shift+return key combo in single line TextEditor fields. Used in this case for searching backwards/forwards in the Terminal find window.
2021-06-01Everywhere: codepoint => code pointAndreas Kling
2021-06-01LibGUI+Shell+bt+ls: Use proper APIs for creating file URLsMax Wipfli
This patch replaces ad-hoc generation of file URL strings with using URL::create_with_file_scheme().
2021-06-01LibGUI: Add a FIXME about race in AutocompleteBox::apply_suggestion()Itamar
2021-06-01LibGUI: Check that AutocompleteBox's selection row is validItamar
Previously we didn't check that the selection's row index is in a valid range before attempting to access its data via the model. This could cause an out-of-bounds access to the model's Vector of suggestions. I think this should fix #7404, but I can't verify it does because I wasn't able to reproduce it on my machine.
2021-06-01LibGUI/TreeView: Select parent on collapseJelle Raaijmakers
When collapsing a tree that contains the current selection, the parent node becomes selected instead.
2021-05-31LibGUI: Replace fprintf(stderr)/printf() with warnln()/dbgln()Linus Groh
2021-05-30LibGUI: Don't scroll TreeView horizontally to bring index into viewAndreas Kling
This behavior was really irritating and basically never what you wanted so let's stop doing it.
2021-05-30LibGUI: Avoid a bunch of virtual calls during TreeView paintingAndreas Kling
The index of the tree column will not change while painting. Neither will the number of columsn. So avoid a whole bunch of virtual function calls by caching these two values at the start of painting.
2021-05-29LibGUI/TreeView: Implement Home/End/PageUp/PageDn navigationJelle Raaijmakers
This adds an implementation for the Home, End, Page Up and Page Down cursor movements for TreeView. Also, the Up and Down movement implementations are replaced by a more efficient traversal mechanism: whereas the old code would walk over all visible nodes every time, the new code only evaluates relevant sibling and parent indices.
2021-05-29LibGUI: Distribute remaining pixels in BoxLayout to fill the entire areaMart G
Previously, the layout algorithm preferred to give every item an equally sized slice of the remaining space. This meant that not the entire area was used when the remaining size did not divide evenly by the number of items. This caused, for example, the ResizeCorner in HexEditor to be a couple of pixels left of the actual corner for some sizes of the window. Now, the remaining pixels are distributed on a first come, first served basis. However, only one pixel is distributed at a time. This means items towards the left might me a pixel larger than their siblings towards the right.
2021-05-29LibGUI: Make HeaderView act only on the visible sectionsAli Mohammad Pur
i.e. Drawing them, or handling mouse events on them. Fixes #7505.
2021-05-28LibGUI: Add u64 type to LibGUI::VariantJesse Buhagiar
`uint` has also been more appropriately renamed to u32.
2021-05-27LibGUI+TextEditor: Add the calculation of selected wordsry-sev
This moves the calculation of selected words that was originally in the TextEditor application to TextEditor in LibGUI. This allows all applications with text editors to get this number without having to calculating it themselves.
2021-05-26LibGUI: Paint some knurling in the middle of GUI::SplitterAndreas Kling
This makes splitters stand out visually so you can actually spot them. Before this, you had to guess/know where they were, which was weird. The look of the knurling is the same as GUI::ResizeCorner, to build on the established visual language.
2021-05-26LibGUI: Have GUI::Splitter track all grabbable areasAndreas Kling
Instead of computing the grabbable areas on the fly in mouse event handlers, we now figure out which parts of the splitter are grabbable when something moves around, and then remember it. This makes the code a lot easier to follow.
2021-05-26LibGUI/AbstractView: Remove `on_selection`Jelle Raaijmakers
Since the introduction of multi-select, we have had both `on_selection` and `on_selection_change`, the latter of which was only invoked when a change in selection came in through the model. This removes `AbstractView::on_selection` and replaces it usage with the more explicit `on_selection_change` everywhere.
2021-05-24LibGUI/AbstractView: Expose `activates_on_selection`Jelle Raaijmakers
2021-05-24LibGfx: Use anonymous buffer instead of raw anon_fd for Gfx::BitmapJean-Baptiste Boric
Instead of using a low-level, proprietary API inside LibGfx, let's use Core::AnonymousBuffer which already abstracts anon_fd and offers a higher-level API too.
2021-05-23LibCore: Make ProcessStatisticsReader return results in a VectorAndreas Kling
The HashMap API was overkill and made using this less ergonomic than it should be.
2021-05-23Userland: Mark subclasses of IPC::{Client,Server}Connection finalAndreas Kling
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-23LibGUI: Handle fast_greet stuff in WindowServerConnection constructorAndreas Kling
Move the from handshake() to the constructor (and move the constructor out-of-line while we're at it.) This prepares getting rid of the handshake() mechanism since this is the only remaining user.
2021-05-23NotificationServer: Remove unnecessary greet() messageAndreas Kling
2021-05-22TextEditor: Prevent pasting with empty clipboardCarlos César Neves Enumo
Prevent erasing selected text when pasting with empty clipboard
2021-05-22LibGUI: Make GUI::Variant stringify floats with 2 decimalsAndreas Kling
The extremely high default precision was obnoxious in user interfaces.
2021-05-22Userland: Rename LibThread => LibThreadingAndreas Kling
Also rename the "LibThread" namespace to "Threading"
2021-05-22CppLanguageServer+LibGUI: Autocomplete #include pathsItamar
The C++ language-server can now autocomplete include paths. Paths that start with '<' will be searched in /usr/include, and paths that start with '"' will be searched in the project's root directory.
2021-05-22LibGUI: Increase width of Autocomplete suggestions boxItamar
2021-05-21WindowServer+LibGUI: Add an IPC API to change the current system fontsAndreas Kling
This patch adds a set_system_fonts() IPC API that takes the two main font queries as parameters. We'll probably expand this with additional queries when we figure out what they should be. Note that changing the system fonts on a live system mostly takes effect in newly launched programs. This is because GUI::Widget will currently cache a pointer to the Gfx::FontDatabase::default_font() when first constructed. This is something we'll have to fix somehow. Also note that the settings are not yet persisted.
2021-05-21LibGfx+WindowServer: Have WindowServer broadcast system font settingsAndreas Kling
Instead of everybody getting their system fonts from Gfx::FontDatabase (where it's all hardcoded), they now get it from WindowServer. These are then plumbed into the usual Gfx::FontDatabase places so that the old default_font() and default_fixed_width_font() APIs keep working.
2021-05-21Applications: Use titlecase and distinct underlined characters in menusMax Wipfli
This changes (context) menus across the system to conform to titlecase capitalization and to not underline the same character twice (for accessing actions with Alt).
2021-05-21Revert "Userland: static vs non-static constexpr variables"Linus Groh
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a. Booting the system no longer worked after these changes.
2021-05-21Userland: static vs non-static constexpr variablesLenny Maiorani
Problem: - `static` variables consume memory and sometimes are less optimizable. - `static const` variables can be `constexpr`, usually. - `static` function-local variables require an initialization check every time the function is run. Solution: - If a global `static` variable is only used in a single function then move it into the function and make it non-`static` and `constexpr`. - Make all global `static` variables `constexpr` instead of `const`. - Change function-local `static const[expr]` variables to be just `constexpr`.
2021-05-20Clipboard+LibGUI: Remove unnecessary client/server greeting messageAndreas Kling
2021-05-20WindowServer+LibGUI: Make client/server greeting fasterAndreas Kling
Instead of doing a full IPC round-trip for the client and server to greet each other upon connecting, the server now automatically sends a "fast_greet" message when a client connects. The client simply waits for that message to arrive before proceeding. (Waiting is necessary since LibGUI relies on the palette information included in the greeting.)
2021-05-20LibGUI: Don't mark "open" FilePicker as done if the file is not foundAndreas Kling
If you type in a filename that doesn't exist, show an error message instead of closing the FilePicker "successfully."
2021-05-20LibGUI: Make GUI::FilePicker handle absolute paths betterAndreas Kling
Some people apparently like to type in full absolute paths into the filename box of GUI::FilePicker. So let's handle that as you'd expect by using the full path as the selected path.
2021-05-20LibGUI: Tweak API for getting the selected pathAndreas Kling
Return a String instead of a LexicalPath. Also call it a path instead of a file since that's what we're really returning.
2021-05-20LibGfx: Remove Gfx::FontDatabase::default_bold_font()Andreas Kling
Instead use default_font().bold_variant() in cases where we want a bold variant of the default font. :^)
2021-05-20LibGUI: Don't invalidate FileSystemModel indices on thumbnail updateAndreas Kling
Finishing a thumbnail generation doesn't affect indices at all.