Commit graph

26 commits

Author SHA1 Message Date
Vukašin Vojinović
990e2e291b refactor(calendar): use jiff instead of chrono
This refactors the calendar widget to use `jiff` instead of `chrono`.
Also mostly matches the design of the widget to the time applet.
2026-02-17 21:18:55 +01:00
Michael Aaron Murphy
f39ad728c9
examples(calendar): update and fix compile 2025-12-05 17:29:11 +01:00
Kyle Scheuing
62f661e077 fix: compile errors on windows
calendar.rs had some left over icon! macro_rules macros referencing now
deleted files.

bundle::get was defined twice on non-unix platforms.

A known remaining issue is that projects using libcosmic need to have
cosmic-icons in their project root, since the crabtime macro uses
crabtime::WORKSPACE_PATH rather than the path to wherever cargo puts
libcosmic's git submodule.

See: 639326fcc3
2025-11-26 15:39:32 -05:00
Ashley Wulber
0c6c85429e
chore: update iced (#1029) 2025-10-27 16:24:02 +01:00
UchiWerfer
e49a30104b added localization for month and weekday to calendar-widget 2025-10-22 04:31:38 +02:00
Cheong Lau
bd438a8581 perf: reduce memory allocations
This also changes `widget::column::with_children` and
`widget::row::with_children` to take an `impl IntoIterator` instead
of a `Vec`, like the `iced` variants of these functions do.

This shouldn't be a breaking change since passing in a `Vec` will still
compile and function exactly as before.

(Using `iced::widget::Column::from_vec` or
`iced::widget::Row::from_vec` isn't possible, since the elements of the
`Vec` aren't checked, so the size of the resulting `Column` or `Row`
won't adapt to the size of its children. Perhaps a new function could
be added to mirror `iced`'s?)
2025-10-22 04:30:57 +02:00
Cheong Lau
a27bb5e05d chore: apply clippy suggestions 2025-10-05 04:40:51 +02:00
Vukašin Vojinović
ea349aca82 chore: use std::syncLazyLock
Also migrates workspace members to Rust 2024.
2025-09-03 21:54:46 +02:00
UchiWerfer
c5df9dcf88
fix(calendar): show button icons on non-Linux targets 2025-09-03 19:35:37 +02:00
Ashley Wulber
1fce5df160 refactor: add optional parameter for layout offset and bounds for button handlers
Buttons are often used for toggling popups, so something allowing more straightforward positioning is important.
2025-05-23 19:19:42 +02:00
Ashley Wulber
2a1af3a24f
chore: update iced 2025-05-19 19:06:09 +02:00
UchiWerfer
b7aed0e4d6
feat(calendar): add first day of week parameter 2025-05-16 17:02:16 +02:00
Michael Aaron Murphy
8cf372c9b9
perf: inline public getters/setters, and use non-generic inner functions
To reduce compile-times and avoid some overhead to binary size, this will modify some of our
generic functions to use non-generic inner functions where possible. The inner functions are
marked carefully with `#[inline(never)]` to prevent being inlined by LLVM at their callsites

While looking for generic functions to optimize, I have also taken the opportunity to annotate
public non-generic getters and setters with `#[inline]` to ensure that LLVM will inline them
across crate boundaries. By default, only generic functions are automatically inlined, and
only when enabling fat LTO are constant functions reliably inlined across crate boundaries.
2025-03-21 13:31:34 +01:00
Ashley Wulber
337b80d4ca
feat: Tooltips and Better Surface Management 2025-03-14 16:56:21 +01:00
Tony4dev
def11c6c96
improv(calendar): make visible public 2025-01-19 15:37:07 +01:00
Eduardo Flores
00a4042c40
chore(calendar): add derive attributes 2025-01-19 12:58:57 +01:00
Tony4dev
8211fb68bd
improv!(calendar): do not select date when navigating prev/next months 2025-01-16 06:30:21 +01:00
Vukašin Vojinović
127ce17b85 improv: add window border 2024-11-05 10:02:19 +01:00
Ashley Wulber
0491c4baaa libcosmic updates 2024-10-18 14:04:39 -04:00
Michael Aaron Murphy
f12de010ec fix!(widget): rename button function to button::custom 2024-09-16 11:36:42 -06:00
Victoria Brekenfeld
b40839638a fix: Use globals instead of thread-locals
Better support for multi-threaded applications,
especially cosmic-comp rendering in parallel on
multiple threads, each potentially accessing
global configurations such as the active theme,
icon_theme and more...
2024-08-02 20:27:08 +02:00
Michael Aaron Murphy
f4936344f0
chore(doc): add documentation for a handful of widgets 2024-05-20 20:01:47 +02:00
Michael Aaron Murphy
1355588723 improv(button): specialize button for cosmic, and apply alpha to header buttons 2024-05-17 20:58:38 +02:00
Eduardo Flores
5d600c70c2 improv(calendar): simplify message handling 2024-03-15 13:40:31 +01:00
Michael Aaron Murphy
ccb0dbed65 refactor(calendar): add setters for managing selected date logic 2024-03-15 13:40:31 +01:00
Michael Aaron Murphy
d68488de47 feat(widget): add calendar widget 2024-03-15 13:40:31 +01:00