summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2023-04-04LibGUI: Open and increment ComboBox ListViews by exact stepsthankyouverycool
This feels a bit nicer and always places the current index at the top of visible content in long scrollable lists.
2023-04-04LibGUI: Don't hover AbstractView indicies outside visible contentthankyouverycool
Fixes ComboBox ListView erroneously setting and scrolling to indicies just outside its inner rect when mousing along the bottom or top of the frame.
2023-04-04LibGUI: Paint Scrollbar buttons with appropriate thread highlightingthankyouverycool
Similar to increment/decrement buttons on SpinBoxes, Scrollbar buttons now draw with the correct highlights after reaching their min or max.
2023-04-04LibGUI: Allow ComboBox windows to intersect Desktop's entire heightthankyouverycool
Minus a tasteful item height remainder. Ignoring Taskbar is okay now that the window is a PopUp. Also expands its width if intersection with the Desktop makes its ListView scrollable. ComboBox windows no longer intersect horizontally, remaining firmly "attached" to the editor, similar to other classic UIs.
2023-04-04LibGUI: Remove calculated_min_size() for ListViewsthankyouverycool
Originally implemented to handle resizable ComboBox windows, this "feature" no longer exists, so calculating min size is no longer necessary. The calculation was also failing to account for dynamic ListViews properly. This patch simplifies things by setting ComboBox ListView's minimum size explicitly and deferring to AbstractScrollableWidget's more flexible calculated implementation otherwise. Fixes FontPicker resizing incorrectly due to overly rigid ListViews.
2023-04-03LibGUI+CertificateSettings: Use custom SortingProxyFabian Dellwing
The default SortingProxyModel does not allow to react to reodering. As we would like to keep the column width on sorting, we create a subclass and inject our code into the sorting method.
2023-03-31LibGUI: Add gutter indicators to TextEditor :^)Sam Atkins
HackStudio's Editor has displayed indicators in its gutter for a long time, but each required manual code to paint them in the right place and respond to click events. All indicators on a line would be painted in the same location. If any other applications wanted to have gutter indicators, they would also need to manually implement the same code. This commit adds an API to GUI::TextEditor so it deals with these indicators. It makes sure that multiple indicators on the same line each have their own area to paint in, and provides a callback for when one is clicked. - `register_gutter_indicator()` should be called early on. It returns a `GutterIndicatorID` that is then used by the other methods. Indicators on a line are painted from right to left, in the order they were registered. - `add_gutter_indicator()` and `remove_gutter_indicator()` add the indicator to the given line. - `clear_gutter_indicators()` removes a given indicator from every line. - The `on_gutter_click` callback is called whenever the user clicks on the gutter, but *not* on an indicator.
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.