Age | Commit message (Collapse) | Author |
|
This overload use the `Core::Stream` API instead of the now deprecated
one `Core::File`.
|
|
Simplify a lot of uses of ElapsedTimer by converting the callers to
elapsed_time from elapsed, as the AK::Time returned is better for unit
conversions and comparisons against constants.
|
|
It's the only one, so the `try` prefix is unnecessary now.
|
|
|
|
MOAR FIXMES! ;^)
|
|
|
|
Rip that bandaid off!
This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
the only one.
The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
|
|
No need to use a TextLayout here, we can just count the number of lines
and multiply that by the font's preferred line height.
In addition to being much simpler, it also fixes a bug where labels were
got too tall if we calculated their preferred height before assigning
a final width to them.
|
|
This is achieved by simplifying the logic in TextLayout. We get rid
of all the various ways that the layout bounding rect can get cropped.
Then we make sure to use the right pixel metrics.
Finally we use the font's own line gap metrics instead of hard-coding 4.
The end result is that text painted with vector fonts now gets pretty
reasonable vertical alignment in most cases.
|
|
We have to ceil the font size or we risk being 1px too small.
|
|
Also store the Font as a const reference instead of a raw pointer,
since we don't allow a null Font here.
|
|
Return a float, and fix a bogus calculation of ascender + descender.
|
|
This keeps some overloads that accept ints to avoid adding calls to
.to_type<float>() all over the place.
|
|
Previously we didn't always return when there was an automatic cursor
tracking widget. This meant for certain events e.g. a MouseUp over
the tracking widget, the event would be fired twice on the same widget
(once on `m_automatic_cursor_tracking_widget` then again on
`result.widget` outside the if).
Fixes #16737
|
|
By default, only highlight the base name of the file to-be-saved. When
the file includes an extension, it's useful to be able to just start
typing a file name without having to manually de-select the extension
(or having to rewrite the extension).
|
|
|
|
Previously, incorrect items were highlighted when hovering over
elements in TreeView when there was a column header.
|
|
These instances were detected by searching for files that include
stdlib.h, but don't match the regex:
\\b(_abort|abort|abs|aligned_alloc|arc4random|arc4random_buf|arc4random_
uniform|atexit|atof|atoi|atol|atoll|bsearch|calloc|clearenv|div|div_t|ex
it|_Exit|EXIT_FAILURE|EXIT_SUCCESS|free|getenv|getprogname|grantpt|labs|
ldiv|ldiv_t|llabs|lldiv|lldiv_t|malloc|malloc_good_size|malloc_size|mble
n|mbstowcs|mbtowc|mkdtemp|mkstemp|mkstemps|mktemp|posix_memalign|posix_o
penpt|ptsname|ptsname_r|putenv|qsort|qsort_r|rand|RAND_MAX|random|reallo
c|realpath|secure_getenv|serenity_dump_malloc_stats|serenity_setenv|sete
nv|setprogname|srand|srandom|strtod|strtof|strtol|strtold|strtoll|strtou
l|strtoull|system|unlockpt|unsetenv|wcstombs|wctomb)\\b
(Without the linebreaks.)
This regex is pessimistic, so there might be more files that don't
actually use anything from the stdlib.
In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
|
|
These instances were detected by searching for files that include
AK/Format.h, but don't match the regex:
\\b(CheckedFormatString|critical_dmesgln|dbgln|dbgln_if|dmesgln|FormatBu
ilder|__FormatIfSupported|FormatIfSupported|FormatParser|FormatString|Fo
rmattable|Formatter|__format_value|HasFormatter|max_format_arguments|out
|outln|set_debug_enabled|StandardFormatter|TypeErasedFormatParams|TypeEr
asedParameter|VariadicFormatParams|v_critical_dmesgln|vdbgln|vdmesgln|vf
ormat|vout|warn|warnln|warnln_if)\\b
(Without the linebreaks.)
This regex is pessimistic, so there might be more files that don't
actually use any formatting functions.
Observe that this revealed that Userland/Libraries/LibC/signal.cpp is
missing an include.
In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
|
|
These instances were detected by searching for files that include
IterationDecision.h, but don't match the regex:
\\bIterationDecision(?!\.h>)\\b
This is the only symbol defined by IterationDecision.h.
In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
|
|
This patch fixes the wrong email domain being used for the copyright
header change in f828bf64791c976d75d53dc73a41790adc727017
|
|
|
|
The existing `load_from_gml()` methods look the same as before from the
outside. Inside though, they now forward to `try_load_from_gml()` which
returns Error when things go wrong. It also now calls the `try_create()`
factory method for Objects instead of the `construct()` one.
|
|
|
|
This patch adds a base color to OpacitySlider which will be used to
render the alpha gradient.
|
|
Previously, If the widget was unfocused, the selection start index
would be invalid. This would result in invalid selections when doing
shift+click on the widget (while it is unfocused).
Now, we reassign the selection start index to current index
before we initiate multiselection, if selection start index is invalid.
Should Fix SerenityOS#11999 and the same bug inside FileManager.
|
|
|
|
This makes the view to scroll when pressing arrow keys! :^)
|
|
|
|
We didn't take the scroll value into account when we were converting
a position to an index, which basically prevented us from selecting a
desired file if a list wasn't small enough to fit entirely in the widget
box.
|
|
|
|
|
|
Having a `Point`, `Rect` or `Size` claim it's `null` is silly. We have
`Optional<T>` for that. For `Point`, rename `is_null` to `is_zero` to
better reflect what we're testing. For `Rect` and `Size`, `is_null` is
removed outright.
Also, remove `is_empty` from `Point`. Points can't be empty.
|
|
Both widgets now make use of their base class's scrolling timer and
now always accept drag selection updates on mousemove_event().
This guarantees much snappier feeling selections when actively moving
the mouse.
|
|
Renames on_automatic_scrolling_timer_fired() =>
automatic_scrolling_timer_did_fire()
The 'on_' prefix is usually reserved for AK::Function hooks.
Renames set_automatic_scrolling_{active,timer}() =>
set_automatic_scrolling_timer_active()
For consistency, accuracy, and header file A E S T H E T I C S
|
|
Previously, automatic cursor tracking widgets consumed all mouse
events but did not update their own hover state while active, meaning
Enter and Leave events were not being dispatched.
Fixes TextEditor's automatic selection scroll timer failing to stop
and start while autotracking. Its manual workaround in mousedown
is no longer needed.
|
|
Before this patch, when having the initial spinbox color value
(Color::White), if you changed the color value in the vertical color
picker it didn't update the spinbox's colors.
This is fixed by manually calling update() in the color picker's
onchange() handler if the new color is equal to the previous color,
which is the case in the initial spinbox's case as it will always be
white unless it is changed (and won't be affected by the vertical
color picker).
I added a NOTE in the source to explain this "opaque" update() call :))
|
|
Selections are always normalized when saving undo commands.
The restore_selection() function reverses this process so
negatively sized selections (created right-to-left) continue
to resize correctly with the keyboard when restored.
|
|
Fixes being teleported to the old location when scrolling on a
previously browsed range.
|
|
|
|
and when using unmodified arrows.
|
|
|
|
Previously the widget used a very rough estimate for visible glyphs
based on viewport and glyph areas. Now it simply figures rows times
columns with a two row overdraw to accommodate fractional glyphs
on either end of visible content. For KaticaRegular10, this ends up
reducing unnecessary glyph iterations during painting by about 30%.
|
|
Fixes a slightly oversized content rect and erroneous glyph outer
rect values. Increases glyph rect padding to guarantee at least 1px
between the focus rect and glyph.
|
|
|
|
Fixes crashing on invalid code points when creating selections
with the keyboard and applying actions to them.
Also adds Home/End key support for selections. Ctrl+Shift+{Home,End}
now extends the selection to the beginning or end of the active range,
respectively. Shift+{Home,End} extends the selection to the start or
end of the row. Alt+{Home,End} resets the selection and moves the
active glyph to the beginning or end of the active range.
|
|
Previously selection reset was ignored on active glyph change if the
old glyph equaled the new one. This was an intentional behavior that
allowed selections to resize by dragging the focused glyph, but has
proved more counterintuitive than useful.
Now the widget behaves like other text selection controls: selections
can be reset by clicking anywhere in them or shift can be held to
grow the selection.
|
|
This is a bogus size as the map must always have at least 1 glyph
selected, and it was causing occasional desync between selection
contents and the focused glyph when manipulating selections with
the keyboard.
|
|
Allows focus to be passed using the keyboard.
|
|
This just corrects an oversight in EditingEngine where we do not
properly signal "we handled this event" for Key_Up and Key_Down like we
do for the other keys
|