Age | Commit message (Collapse) | Author |
|
Now, weekends can finally be displayed in the Calender Widget as they
are supposed to. They even update when the settings are changed!
|
|
Now the Calendar living in LibGUI knows about FirstDayOfWeekend and
WeekendLength.
|
|
Previously, changing the time format caused Taskbar to crash.
This commit also simplifies TaskbarWindow::config_string_did_change()
so that it is in line with the changes made to
Calendar::config_string_did_change().
Fixes #15384
|
|
Now when the user changes their preferred first day of the week in the
Calendar Settings, the Calendar application and applet views are update
accordingly without needing to restart them.
|
|
This commit adds an entry to the Calendar Settings to allow the user to
select between the month and year views as the startup default.
|
|
This commit adds a new settings dialog for the Calendar application and
applet. It allows the user to specify their preferred first day of the
week.
|
|
|
|
Currently, navigating through different years in the Year view of the
Calendar app or the taskbar is very slow.
Profiling results show that almost all the time is spent in
`Calendar::update_tiles`, and specifically, in `DateTime::create` and
`DateTime::set_time`.
Performance can improve substantially if the `TZ` environment variable
is set [0], but we can improve the current code to perform better
nevertheless :^)
This diff focuses on removing the need of the `Tile` struct to require
the instantiation of a `DateTime` object, which avoids _at least_ 365
object instantiations in the Year view, on each `update_tiles` call.
Instead, as the `date_time` isn't used often, we can instantiate it on
demand when a particular date is selected.
[0] https://blog.packagecloud.io/set-environment-variable-save-thousands-of-system-calls/
|
|
|
|
|
|
Day and month name constants are defined in numerous places. This
pulls them together into a single place and eliminates the
duplication. It also ensures they are `constexpr`.
|
|
`static const` variables can be computed and initialized at run-time
during initialization or the first time a function is called. Change
them to `static constexpr` to ensure they are computed at
compile-time.
This allows some removal of `strlen` because the length of the
`StringView` can be used which is pre-computed at compile-time.
|
|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
|
|
This reverts commit 800ea8ea969835297dc7e7da345a45b9dc5e751a.
Booting the system no longer worked after these changes.
|
|
Problem:
- `static` variables consume memory and sometimes are less
optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
every time the function is run.
Solution:
- If a global `static` variable is only used in a single function then
move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
`constexpr`.
|
|
We had some inconsistencies before:
- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."
I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.
By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
Fixes selected dates and today's date not painting correctly when
viewed from adjacent months
|
|
Fixes incorrect painting with variable thickness and cuts down
on some layout boilerplate.
|
|
And overhaul resize and paint events to fix layout edge cases in
which Calendar wasn't filling its parent widget completely. Ensures
month views always display prior month days for click navigation.
Converts Calendar app layout to GML.
|
|
|