libcosmic-yoda/examples
leyoda 6736a596ac yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification
The initial hard rename (255cf7cc) broke because Cargo's [patch] with
`package = libcosmic-yoda` does NOT unify across the transitive graph.
cosmic-files (still upstream) asks for "libcosmic"; patched with a
renamed package it ends up as a separate crate, leading to two copies
of cosmic::Theme/Action with incompatible types.

Soft fork keeps the yoda identity where it counts and stays compatible:
- Cargo name  : libcosmic (for patch/unification)
- Version     : 1.0.0 (same major as upstream so [patch] semver-accepts it)
- Lib name    : cosmic (unchanged)
- Repo        : leyoda/libcosmic-yoda on Forgejo (yoda lineage)
- Branch      : main (vs upstream master)

Revert parts:
- examples/*/Cargo.toml dep refs back to libcosmic
- i18n/*/libcosmic_yoda.ftl renamed back to libcosmic.ftl

Added:
- Compat stub features: winit = [], x11 = [] — empty so Cargo can satisfy
  upstream deps asking for these, but no code is actually gated on them
  any more (all removed in Phase 2).

Ungates done to make the Wayland path self-sufficient after winit removal:
- src/lib.rs: pub mod app + pub use Application/ApplicationExt no longer
  gated on winit; prelude exports ApplicationExt unconditionally
- src/surface/action.rs: 6 functions had #[cfg(all(wayland, linux, winit))]
  triple-gates; simplified to #[cfg(all(wayland, linux))] since winit is
  no longer a meaningful gate (wayland is now the only shell)
- 12 standalone #[cfg(feature = "winit")] annotations removed from src/
  (their gated code is now always compiled)

cargo check --lib + cargo check in cosmic-yoterm both pass with a single
libcosmic v1.0.0 in the tree.
2026-04-23 15:05:31 +02:00
..
about yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
applet yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
application yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
calendar yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
config examples: fix libcosmic features, warnings, etc. 2025-12-05 17:59:42 +01:00
context-menu yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
cosmic yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
image-button yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
menu yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
multi-window yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
nav-context yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
open-dialog yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
spin-button yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
subscriptions yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
table-view yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
text-input yoda: soft-fork pivot — keep Cargo name "libcosmic" for dep unification 2026-04-23 15:05:31 +02:00
README.md chore: document examples 2024-09-19 13:11:24 +02:00

Examples

applet

Demonstrates how to create an applet.

just run applet

application

Start here as a template for creating an application with libcosmic's application API.

just run application

calendar

Demonstrates how to use the calendar widget.

just run calendar

config

Demonstrates how to use the configuration system. There is no GUI in this example.

just run config

context-menu

Demonstrates how to use the context menu widget.

just run context-menu

image-button

Demonstrates how to use the image-button widget.

just run image-button

menu

Demonstrates how use the menu widget.

just run menu

multi-window

Demonstrates how to open multiple windows.

just run multi-window

nav-context

Demonstrates how to use the navigation bar widget.

just run nav-context

open-dialog

Demonstrates how to create an open file dialog

just run open-dialog

text-input

Demonstrates how to use the text input widgets.

just run text-input