Age | Commit message (Collapse) | Author |
|
This adds automatic scrolling when dragging items in TreeViews and other
widgets that inherit from AbstractView when the overloaded
accepts_drag() returns true. This is implemented in FileSystemModel to
allow directories and files to be dragged.
|
|
|
|
This replaces some actions with CommonActions and also adds '...' to
menu items that require user input.
|
|
Previously the code couldn't handle leaving the AbstractButton through
tab, while having it pressed through space or enter.
|
|
|
|
FontPickerWeightModel is no longer necessary as variants contain
weight as part of a complete typeface description. This fixes fonts
not inventorying correctly in picker when they contained more than
bold and regular typefaces. Weight mapping has been moved into
LibGfx/FontStyleMapping.h
|
|
Large enough content ranges produced unclamped scrubbers sized zero,
effectively clamped by their integer type. This led to zero sized
page_increments and scrubbers which didn't budge on gutter events.
This fixes broken gutters in FontEditor and TextEditor for large
files.
|
|
This is a helpful option to prevent unwanted side effects, distinguish
between user and programmatic input, etc. Sliders and SpinBoxes were
implementing it idiosyncratically, so let's generalize the API and
give Buttons and TextEditors the same ability.
|
|
This condition rejected almost every bitmap cursor change.
|
|
This makes it possible to avoid messy situations where a slider
controlled value can be changed from multiple sources.
|
|
Returns the total number of words in a document.
|
|
Using StringView instead of C strings is basically always preferable.
The only reason to use a C string is because you are calling a C API.
|
|
This commit adds a timer to AbstractScrollableWidget that can be used
when implementing automatic scrolling. By overriding
on_automatic_scrolling_timer_fired() we can calculate the scrolling
delta when dragging objects, and redraw as needed. A helper function,
automatic_scroll_delta_from_position() gives us a delta that
we can use to calculate speed and direction. By default
m_autoscroll_threshold is 20 pixels from the edge, and gives a linear
change in scroll delta.
|
|
|
|
Default implementations allow for more optimizations.
See: https://pvs-studio.com/en/docs/warnings/v832/
|
|
When a file deletion event happens, we now iterate over all views of the
FileSystemModel and remove any selection & cursor indices that hold
dangling references do the deleted filesystem node.
This fixes #9602.
|
|
We can just use the current opened directory as a path in that mode. :^)
|
|
Prior this change, the button was updated on user selection change
in the file view.
This isn't quite right, as you could remove the text from the text box
or (even worse) start typing a filename there and the button state
wouldn't change.
|
|
|
|
This commit adds a `ColorSelectOverlay` class, and uses it to
allow the user to pick a color from the screen. The API for
`ColorSelectOverlay` is inspired from the `SelectableOverlay`
in `Utilities/shot.cpp`. In particular, it opens up it's own
window, so that we can have control over the cursor over the
whole screen.
There's one thing notably different: In addition to returning the
final selected color from the `exec()` function, it also provides
an `on_color_changed()` hook, which can be used to (optionally)
get live updated as the mouse is moving around.
This is a bit odd, but allows us to use the preview widget of the
color picker to see the current color under the mouse (which will
be selected upon clicking). When trying to select the color from
text / other small elements, this is very useful.
|
|
This makes the user-facing type only take the node member pointer, and
lets the compiler figure out the other needed types from that.
|
|
The existing behaviour is that filename_textbox is cleared if a node of
the wrong type is selected. Here we reflect that state update in the
state of the ok_button.
This change helps the user to avoid confirming (and seeing an alert) if
they press "Open" after clicking on an invalid node.
|
|
|
|
|
|
Without this, the highlighting would stay on the initial index even if
the matching row is no longer there.
|
|
This change splits the do_search() into find_next_search_match() and
highlight_search() to allow the given index be independently highlighted
when needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This feature was problematic for several reasons:
- Tracking *all* the user activity seems like a privacy nightmare.
- LibGUI actually only supports one globally tracking widget per window,
even if no window is necessary, or if multiple callbacks are desired.
- Widgets can easily get confused whether an event is actually directed
at it, or is actually just the result of global tracking.
The third item caused an issue where right-clicking CatDog opened two
context menus instead of one.
|
|
|
|
|
|
This makes IconView aware of the text width of the
ModelEditingDelegate widget when editing an index and allows us to
resize the content rect as needed.
This also removes the border from the textbox since it could collide
with the icon in ColumnsView. While editing we also skip painting the
inactive selection rect since it would otherwise show when the content
rect gets smaller.
|
|
For Theme Editor. :^)
|
|
|
|
Pior to this change when the user added text after having saved the file
the Text Editor wouldn't enable the modified flag, unless this new text
was a new line.
This happened because the UndoStack was merging the Command added by
the new text with the old text one, and when is_current_modified()
was called, the m_stack_index would not have been incremented, and
it would return false.
In this change was added a condition to verify if the modified tag is
active, and the merge is only done if the document is already modified.
|
|
|
|
Prior this change, clicking on a slider with set jump_to_cursor() flag
didn't exactly match the knob to the mouse position, and therefore
the slider values were a bit off in the corners.
The calculation used the whole widget size to set new values, which
isn't correct as the track slider has margins on both ends.
I noticed this while seeking in the Sound Player.
|
|
Less magic numbers! :^)
|
|
This allows applications to specify a version string to appear in the
`AboutDialog`.
|
|
Before, `AboutDialog` and `ArgsParser` read from a build-time created
file called `/res/version.ini`. This caused problems with utilities
unveiling specific paths leaving the version file unaccessible.
This commit hard-codes a serenity version in `LibCore`, and use it in
`ArgsParser` and `AboutDialog`.
The previous version contained the hash of the last GIT commit, this is
omitted for the default use for the sake of simplicity.
|
|
Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.
This commit contains no changes.
|
|
Fixes null scrubbers drawing over the decrement button when
window dimensions dictate they disappear.
|
|
These suffered the same visual defect as scrollbars when styled
as normal buttons: against backgrounds with the same color as
their highlighting, aspect was lost.
|
|
The first attempt in #9037 used a special label as a view, if it wanted
to communicate any kind of error, but that sure did look a bit ugly.
Here, we are just showing a message box right before setting the new
path as:
- the contents of the previous directory will be visible in background,
which I find pretty nice, and
- I don't have to deal with adding a path history vector to reopen
the previous directory (which might not even exist then). :^)
|
|
This commit relayouts the BreadcrumbButtons on resize to a shrunken
state if they don't fit. It also caps the button width to 100px to
avoid overflowing the widget.
|
|
|