Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This should be a more convenient API and a better UX for apps that
want simple integer input from the user.
|
|
|
|
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.
|
|
InputBox can now be given a bitmap to display alongside its
prompt and editor. Prompts are now optional to allow for
compact dialogs.
|
|
Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
|
|
TextBox now shrinks to fit the current font based on preferred line
height, maintaining its historical minimum size of 40x22
|
|
|
|
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.
|
|
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
|
|
And set fixed preferred heights when autosizing.
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
|
|
This feels a bit nicer and always places the current index at the top
of visible content in long scrollable lists.
|
|
Fixes ComboBox ListView erroneously setting and scrolling to
indicies just outside its inner rect when mousing along the
bottom or top of the frame.
|
|
Similar to increment/decrement buttons on SpinBoxes, Scrollbar
buttons now draw with the correct highlights after reaching their
min or max.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This is going to hold other per-line data too.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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.
|
|
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).
|
|
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.
|
|
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.
|
|
Allows the use of GUI::FileTypeFilter in IPC.
|
|
Objects taken by reference are no longer valid when used in
`deferred_invoke`. Explicitly copying them solve the issue.
|
|
|
|
|
|
|
|
Not doing it result in FileManager's progress bar being left as
incomplete even if all jobs were finish.
|