summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2023-04-19WindowServer+LibGUI: Port WindowServer's Menu name to new StringKarol Kosek
2023-04-19LibGUI+Userland: Make Menu::*add_submmenu take name using new stringKarol Kosek
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-04-19LibGUI: Port Menubar to new stringKarol Kosek
2023-04-19LibGUI+Browser: Set menu names using the new String classKarol Kosek
2023-04-19Userland: Construct Menus with name using the non-deprecated StringKarol Kosek
2023-04-19LibGUI: Store Menu names as new StringKarol Kosek
2023-04-18LibGUI: Add a numeric input type to InputBoxthankyouverycool
This should be a more convenient API and a better UX for apps that want simple integer input from the user.
2023-04-18LibGUI: Implement calculated_min_size() for SpinBoxthankyouverycool
2023-04-18LibGUI: Allow SpinBox to set its value with return keythankyouverycool
Previously SpinBox did not update on return or changes to the editor. The widget had to lose focus or be manually incremented. This lets the editor update on return and now always displays the most recent clamped value. set_value_from_current_text() will also be useful to programmatically set SpinBox within layouts whose default buttons consume return key presses.
2023-04-18LibGUI: Let InputBox display an ImageWidgetthankyouverycool
InputBox can now be given a bitmap to display alongside its prompt and editor. Prompts are now optional to allow for compact dialogs.
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-18LibGUI: Improve calculated_min_size() for single-line TextEditorthankyouverycool
TextBox now shrinks to fit the current font based on preferred line height, maintaining its historical minimum size of 40x22
2023-04-18LibGUI: Add Window::on_font_change() hookthankyouverycool
2023-04-17LibGUI: Always paint Statusbar's vertical lines when not maximizedthankyouverycool
Fixes MasterWord's single Statusbar::Segment not painting vertical lines despite its window being unmaximized. This was only an issue for non-resizable windows as the Statusbar resizing corner otherwise negates spans_entire_window_horizontally() when not maximized.
2023-04-17FileManager+LibGUI: Cache the FileSystem::can_delete_or_move valueTom
Add the function FileSystemModel::Node::can_delete_or_move which will cache the result of FileSystem::can_delete_or_move for a node. This prevents having to make system calls repeatedly to obtain this information. Fixes #18399
2023-04-15LibGUI: Resize Label on font changesthankyouverycool
And set fixed preferred heights when autosizing.
2023-04-15LibGUI: Implement calculated_min_size() for Labelthankyouverycool
2023-04-15LibGUI: Implement calculated_min_size() for DialogButtonthankyouverycool
Dialog buttons now scale based on presentation size to accomodate larger fonts while retaining uniform widths. Scaling by 8 is arbitrary but preserves the historical 80 pixel width with Katica 10. This needs improvement but works well for most fonts as a start.
2023-04-15LibGUI: Improve calculated_min_size() for Buttonthankyouverycool
Previously min_width() was fixed, rendering width calculations in calculated_min_size() useless for layout. Minimum width now shrinks to 22, the historical minimum for height as well, and takes into account elided text and icons. Height no longer sums the icon, fixing a layout regression for icon buttons. Also removes an unnecessary FIXME: Calculated size should only need to account for the height of a single line of elided text plus padding. Font's pixel_size_rounded_up() is the right solution even though it and the underlying pixel metrics of some ScaledFonts don't always correspond yet.
2023-04-15LibGfx+Userland: Add width_rounded_up() helperthankyouverycool
2023-04-15LibGUI+Userland: Convert MessageBox to fallible constructionthankyouverycool
Adds fallible versions of MessageBox's helper factories, ports DeprecatedString, and rewrites build() to be both fallible and more responsive to font changes. MessageBox now auto shrinks and no longer has to re-build its layout when text changes. It is manually resized once at creation to position properly as a Dialog before being shown.
2023-04-15LibGUI: Allow Windows to auto shrinkthankyouverycool
Previously Windows automatically grew to accomodate layout changes when obeying minimum widget size but would not automatically shrink if so desired. Setting auto shrink true now automatically resizes windows to their effective_min_size() every time their minimum size updates. This will be useful for making fixed size windows responsive to layout and font changes in the future.
2023-04-14LibGUI: Only redraw sliders after the `on_change` callback has finishedZaggy1024
This prevents the seek slider in VideoPlayer from skipping forward and then back when fast seeking is enabled. Previously, it was possible for a single frame to render before the actual seek position in the seek bar was set.
2023-04-14Spreadsheet+LibSyntax: Never insert spans directlyMatteo Benetti
Function `CellSyntaxHighlighter::rehighlight()` direct inserted spans to TextDocument `m_span` vector missing out important reordering and merging operation carried out by `TextDocument::set_spans()`. This caused overlapping spans for a cell with only a `=` symbol (one for the actual token and one for the highlighting) to miscalculate `start` and `end` value and a `length` value (of `size_t` type) with a `0-1` substraction (result: 18446744073709551615) causing `Utf32View::substring_view()` to fail the `!Checked<size_t>::addition_would_overflow(offset, length)` assertion This remove the possibility to directly alter `TextDocument`'s spans thus forcing the utilization of `HighlighterClient::do_set_spans()` interface function. Proper refactor have been applied to `CellSyntaxHighlighter::rehighlight()` function
2023-04-09Everywhere: Remove unused DeprecatedString includesBen Wiederhake
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.