* Use `tracing::error!` in places where `eprintln!` was used
* Loop over errors and print seperately
* Print errors with `Display` rather than `Debug`
* Don't print errors that should be ignored
- Matches https://github.com/pop-os/libcosmic/pull/949, for same
reasons.
With this, and the previous change, cosmic-panel no longer spams a bunch
of config errors from different applets on start.
When a transaction gets committed, the files gets written to a file in
the .atomicwrite[0-9a-Z] folder and then gets moved to their final
location. The watcher will emit two events:
- Modify(Name(To))
- Modify(Name(Both)
The last one will include both the source and the destination and is
essentially a duplicate of the first event. By discarding this event,
behavior seems to be the same, and all consumers of those events get
only notified once instead of twice when a configuration changes.
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.
This commit changes the hardcoded /usr/share paths in cosmic-config to
become performed via XDG lookups using the `xdg` crate.
This allows the installed files to be discovered on non-FHS Linux, e.g.
NixOS.
Hardcoded /var/lib/ is removed entirely because
1. nothing installs to it yet (only user of new_state is cosmic_bg
currently and it does not install to /var/lib)
2. it's intended for system states, not template for user state.
3. it's not part of XDG spec.
On Windows the known folder crate is used.
Signed-off-by: Gary Guo <gary@garyguo.net>
* feat: add support for dark / light mode switching and simultaneouscustom light / dark mode themes
* refactor(color-picker): optional initial color and fallback color
* refactor: used FixedPortion for layout of the settings item
This makes sure that the control always has at least the specified portion of the available space
* refactor: make all members of the ThemeBuilder public
* refactor: add and update palette colors
* fix(theme): typo and derive PartialEq for ThemeBuilder
* fix: update color picker usage
* feat: add more variables to the theme
* fix: radius on headerbar
* fix: Theme CosmicConfigEntry impl
* chore: specify rev of taffy
* fix: theme CosmicConfigEntry missing variables
* fix: apply theme type when theme mode changes
* wip: add plus icon to empty color picker button
* chore: fix rev and imports
* refactor(color-picker): allow custom size for the icon
* refactor(color_picker): make color_button public
* update iced
APIs like inotify can provide notification for some events that don't
change the contents of a file. It makes sense to ignore those here, even
if the expected way to write is through the config API.
This reduces the number of events on the directory received by a single
`:w` in vim from 12 to 8. And reduces a `touch` from 2 events to 1.
Atomic writes through the config API only result in 1 event per-setting,
before and after this change.