Commit graph

27 commits

Author SHA1 Message Date
Ashley Wulber
e10459fb37 wip rebase updates 2026-03-04 12:04:32 -05:00
Michael Aaron Murphy
6793950bbc
fix(icon): from_svg_bytes should not default to symbolic 2025-12-05 17:16:35 +01:00
Kyle Scheuing
80875d5962
fix: compiling on windows requires cosmic-icons in project root
* fix: compiling on windows requires cosmic-icons in project root

crabtime provides crabtime::WORKSPACE_PATH to refer to the
CARGO_MANIFEST_DIR of the top level crate being built, which means when
building libcosmic directly, crabtime::WORKSPACE_PATH will work, but
when building it as a dependency of another crate,
crabtime::WORKSPACE_PATH will no longer refer to the path to libcosmic.

I don't think there's a good workaround, since when in the context of
crabtime, CARGO_MANIFEST_DIR refers to the path to the crate generated
by crabtime rather than to libcosmic.

This replaces crabtime with a simple build.rs script that generates a
file in OUT_DIR.

* fix: do not generate icon bundle for unix targets

---------

Co-authored-by: Michael Aaron Murphy <michael@mmurphy.dev>
2025-12-04 17:31:47 +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
Michael Aaron Murphy
639326fcc3 feat(icon): optimize & bundle icons with crabtime for non-unix platforms 2025-11-21 18:37:49 +01:00
Michael Aaron Murphy
6439507aa2
fix(icon): default to prefer_svg if symbolic 2025-11-06 07:57:03 +01:00
Vukašin Vojinović
e83e43bf1e fix(icon): always set size
Fixes an oversight in my previous commit 39a5607400.
2025-09-09 16:53:18 +02:00
Vukašin Vojinović
39a5607400 improv(icon): use correct size variant for Named
Update`Icon::size` method to correctly handle `Named` icons by using the provided size retroactively.
2025-09-09 15:57:11 +02:00
Michael Aaron Murphy
0aa518984e
chore: format for 2024 edition 2025-03-21 13:33:07 +01: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
ellieplayswow
900fc34444
feat(icon): add rotation property 2025-01-20 11:08:36 +01:00
Michael Aaron Murphy
52ab37c1eb
feat(icon): add draw method for renderer 2024-11-25 06:50:59 +01:00
Ashley Wulber
842cd2ec94
fix: specify width and height when importing raster images 2024-10-30 11:00:30 +01:00
Ashley Wulber
0491c4baaa libcosmic updates 2024-10-18 14:04:39 -04: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
3a8cbec6ae improv(icon): remove static lifetime restriction from messages 2024-05-30 13:57:47 +02:00
Ashley Wulber
61427b25b0 fix: fallback to Cosmic icon theme 2024-03-19 14:14:30 -06:00
Ashley Wulber
f4ad098647 wip: update to use latest iced 2024-02-06 11:28:27 -05:00
Ashley Wulber
5cb818a5f9 fix: icon fallback 2024-01-03 11:06:28 -05:00
Ashley Wulber
8cc0c3b469 chore: export IconFallback 2024-01-02 12:36:58 -05:00
Ashley Wulber
983d4d3378 feat: custom icon fallbacks 2024-01-02 15:09:29 +01:00
danieleades
8e99406a8b
chore: fixing linter warnings 2023-11-28 20:02:08 +01:00
Jeremy Soller
1caae11e8f
fix: compilation on Windows 2023-11-17 01:36:29 +01:00
Michael Aaron Murphy
34386561b3 feat(button): add ImageButton widget variant 2023-11-03 16:41:31 +01:00
Michael Aaron Murphy
9dbc1be269 refactor(widget): improvements to button and icon widgets 2023-09-14 01:38:56 +02:00
Michael Aaron Murphy
4e4eeaac12 feat!(widget): rewrite button & icon widget APIs 2023-09-14 01:38:56 +02:00