summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2023-03-31LibGUI: Rename TextEditor::LineVisualData -> LineDataSam Atkins
This is going to hold other per-line data too.
2023-03-31LibGUI: Extract repeated code for populating TextEditor per-line dataSam Atkins
2023-03-26LibGUI: Allow updating the names of menus and submenusMacDue
2023-03-25LibGUI: Allow blocking modals and popups to handle their own shortcutsLucas CHOLLET
Since ef7d9c0, shortcut propagation was blocked for blocking modals and popups. This however is an issue as some blocking modals (like FilePicker) use shortcuts. This patch allows propagation of shortcuts but only until the current window.
2023-03-25LibGUI: Make `propagate_shortcuts` handle different level of propagationLucas CHOLLET
First, this patch renames the function `propagate_shortcuts_up_to_application` to `propagate_shortcuts`. Handling those levels, will allow us to differentiate shortcuts at `Window` level and `Application` level. Which will be convenient to handle dialog-specific shortcuts.
2023-03-24LibGUI: Allow passing working directory to spawn_or_show_error()MacDue
2023-03-24Libraries: Convert `DeprecatedFile` usages to `LibFileSystem`Cameron Youell
2023-03-24LibGUI: Paint slider track shorter to ensure the knob covers itAndreas Oppebøen
A 1px drop shadow from the track was peeking out behind the knob when at rightmost or lowest position. That made it look like it was possible to drag the knob even further right or down. Painting the track 1px shorter seems like a good compromise to avoid the problem.
2023-03-24LibGUI: Fix slightly wrong value slider knob positionAndreas Oppebøen
When clicking the value slider bar, the knob was not positioned as close to the mouse as expected. When moving the mouse right, the knob would lag a bit behind, and the cursor would eventually be outside the knob. The bug was due to knob_rect() taking knob_thickness into account to prevent the knob from protruding outside the bar. The value_at(pos) calculated the relative position based on the entire width of the bar. This discrepancy is fixed by taking knob_thickness into account in value_at(position).
2023-03-24LibGUI: Fix value slider so dragging left and right feels similarAndreas Oppebøen
When dragging value slider left, the handle would snap to lower value with the slightest move of the mouse. When dragging to the right however, it would take a lot more movement to cause a change in value. This asymmetry made it feel awkward to drag the mouse around. It was caused by always rounding down using a cast to int. By rounding to the nearest integer first, we ensure symmetric behavior.
2023-03-24LibGUI: Fix slider so dragging handle left and right feels similarAndreas Oppebøen
When dragging the slider handle left/down, the handle would snap to lower value with the slightest move of the mouse. When dragging to the right/up however, it would take a lot more movement to cause a change in value. This asymmetry made it feel really awkward to drag the slider. It was caused by always rounding down using a cast to int. By rounding to the nearest integer first, we ensure symmetric behavior.
2023-03-22LibGUI: Add IPC encode and decode for FileTypeFilterhuttongrabiel
Allows the use of GUI::FileTypeFilter in IPC.
2023-03-22LibGUI: Resolve use-after-free errorLucas CHOLLET
Objects taken by reference are no longer valid when used in `deferred_invoke`. Explicitly copying them solve the issue.
2023-03-21LibGfx: Move all image loaders and writers to a subdirectoryLucas CHOLLET
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-21LibGUI: Make Desktop::set_wallpaper accept an Optional<StringView>implicitfield
2023-03-19LibGUI: Update progress of thumbnail generations on failureLucas CHOLLET
Not doing it result in FileManager's progress bar being left as incomplete even if all jobs were finish.
2023-03-19LibThreading: Execute `on_error` on the original `EventLoop`Lucas CHOLLET
As the user might want to have interactions with LibGUI while handling errors, this code should be executed in the original `EventLoop`. Similarly to what is done with the error-free path.
2023-03-16LibGUI+Userland: Port TabWidget set_tab_title to new stringKarol Kosek
2023-03-16LibGUI: Store Tab titles using the new string classKarol Kosek
2023-03-16LibGUI+Applications: Port SettingsWindow::add_tab() to the new stringKarol Kosek
2023-03-16LibGUI+Userland: Make TabWidget::*add_tab() take title using new stringKarol Kosek
2023-03-16LibGUI+HackStudio+PixelPaint: Port Widget title to the new StringKarol Kosek
I had to add a set_title(String) helper function for ImageEditor because TabWidget requires it. This is a temporary fix and will be handled in subsequent commit.
2023-03-16LibCore: Add new REGISTER_STRING_PROPERTY macroKarol Kosek
2023-03-16LibCore+Userland: Add DEPRECATED infix to REGISTER_STRING_PROPERTY macroKarol Kosek
2023-03-16LibGUI: Store correct address in TreeViewModel's ModelIndicesTim Ledbetter
After `8a48246` m_nodes[row] amd m_child_nodes[row] return a NonnullRefPtr<Node>, so we were putting the wrong address into the ModelIndex's data.
2023-03-16LibGUI: Don't invoke non-visible shortcutsTim Ledbetter
2023-03-15LibSyntax+Libraries: Replace TextStyle with Gfx::TextAttributesSam Atkins
Rather than creating a TextStyle struct, and then copying its fields over to a TextAttributes, let's just create a TextAttributes to start with. This also simplifies the syntax highlighting code by letting us define underlines along with the other text styling.
2023-03-15LibGfx+Userland: Make TextAttributes::underline_style optionalSam Atkins
Rather than having a style AND a field saying whether to use the style, just make the style Optional.
2023-03-15LibGUI: Do not attempt to close non-existent notificationsimplicitfield
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-13LibGUI: Make thumbnail generation resilient between FileSystemModelskleines Filmröllchen
With the new canceled background actions, some thumbnail generation callbacks are not executed if the user closes the window with a FileSystemModel quickly enough. Therefore, we remember which thumbnails we started to generate and consider the associated promises if we're looking up a thumbnail. Since the thumbnail generation itself continues running and the cache is application-global, instead of never displaying thumbnails for images that were "interrupted" generating thumbnails the first time, we can now fetch their images immediately and reliably.
2023-03-09AK: Remove infallible version of StringBuilder::to_byte_bufferLinus Groh
Also drop the try_ prefix from the fallible function, as it is no longer needed to distinguish the two.
2023-03-09WebServer+LibGUI: Use fallible version of StringBuilder::to_byte_bufferLinus Groh
...and simply ignore the errors for now. This allows us to remove the infallible function and avoid accumulating more callers of it.
2023-03-09LibGUI: Use the global setting to show dotfiles in `FilePicker`Lucas CHOLLET
`FilePicker` will now look at the global setting at startup. Note that changing this parameter inside `FilePicker` won't affect the global parameter.
2023-03-09LibGUI: Add "New Directory" to the contextual menu in `FilePicker`Lucas CHOLLET
2023-03-06Everywhere: Remove NonnullOwnPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullOwnPtrVectorAndreas Kling
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06Everywhere: Remove NonnullRefPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-05LibCore+Everywhere: Return an Error from DirIterator::error()Sam Atkins
This also removes DirIterator::error_string(), since the same strerror() string will be included when you print the Error itself. Except in `ls` which is still using fprintf() for now.
2023-03-05LibGUI: Paint emoji using text in the EmojiInputDialogTimothy Flynn
This widget originally used text, but at the time we did not support painting multi-code point emoji as text at all. So it was changed to paint emoji with their bitmaps in commit 8190120f9531693176ca499c12. Now that we can paint text with multi-code point emoji, revert this widget to use text again. This has the added benefit that the dialog has a what-you-see-is-what-you-get effect; any emoji with text presentation in the font (e.g. U+00A9 Copyright) will be displayed as such in the dialog, which is how the text would be painted when selected anyways. Note that to accommodate some emoji sizes, this also had to bump the button sizes a bit, otherwise they would be displayed with an ellipsis.
2023-03-05LibGUI: Fix typo in the name of the EmojiCategory structTimothy Flynn
2023-03-05LibGUI: Allow overriding toolbar button tooltipsTimothy Flynn
The EmojiInputDialog, for example, will want its toolbar buttons to have a tooltip which differs from its text. If no tooltip override has been provided, we fall back to the button text still.
2023-03-04LibGUI: Make Button height adapt to the current font sizeAndreas Kling
2023-03-04Userland: Use Font::pixel_size_rounded_up() in more placesAndreas Kling
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-03-04LibGUI: Paint the GroupBox title with left alignmentAndreas Kling
This fixes an issue where the title would shift around at the subpixel level when appended to. (Only matters for vector fonts.)
2023-03-03LibGUI: Compute syntax-highlighted visual text spans using float rectsTimothy Flynn
For vector fonts in particular, we need to take care to compute offsets using floating point math. For example, with Berkeley Mono at font size 16, with syntax highlighting enabled, we are currently truncating these offsets to integers. This results in a leftward-drift when we paint the text. This changes the rect in which we paint syntax-highlighted text spans to a float rect. As we traverse the spans, we now no longer truncate any of the text offsets, and we draw the text in the correct positions. This is likely not a complete solution. TextEditor blindly casts ints to floats all over, and we will want to make all of these (hundred+) float- aware. But this should be a step in the right direction and makes vector fonts immediately more comfortable to use.