Commit graph

115 commits

Author SHA1 Message Date
Michael Aaron Murphy
31f7e97d5b fix: incorrect font weights, sizes, line heights 2023-05-31 00:08:56 +02:00
Ashley Wulber
e056e8c830
Cosmic advanced text (#103)
* wip: update to use cosmic-advanced-text

* use cosmic-advanced-text branch of iced

* fix: line height and spacing for segmented button and update to get svg fix

* fix: spin button styling & spacing

* update iced to fix segmented button border radius

* feat: example improvements

* feat: helper for loading fonts

* feat: add focus style to button

* fix: slider height and iced fixed

* feat: hash icon width and height

* cleanup

* update ci

* refactor: always use lazy feature of iced

* update iced

* update iced

* cleanup & update iced

* update iced: new slider & tiny-skia quad updates

* update iced: fixes for tiny-skia quad rendering with edge case border radius

* re-export iced_runtime & iced_widget

* merge master

* udpate iced

* update iced

* update iced

* update iced

* fix: make rectangle_tracker subscription only return update if there is some

* feat: derive macro for loading a cosmic-config

* feat (cosmic-config): iced subscription

* fix (example): update to rectangle tracker subscription

* fix (cosmic-config)

* refactor(cosmic-config-derive): add support for types with generic parameters

* fix (cosmic-config): feature gate updates for subscription helpers

* feat: support for custom & system themes + move cosmic-theme to libcosmic

* feat: sorta hacky way of creating header bars for libcosmic + update iced to get support for resizable windows in iced-sctk

* update iced

* update and reexport sctk

* fix: applet border radius

* feat (cosmic-theme): add id and name methods

* fix(cosmic-theme): reexport palette from cosmic-theme

* fix(cosmic-config-derive): allow use with reexported cosmic-config

* feat: update iced with fix and refactor applet env vars

* update iced
2023-05-30 12:03:15 -04:00
Ian Douglas Scott
98ec1bbd48
Add a Popover widget, that shows a widget in an overlay (#100)
This serves a similar purpose to `GtkPopover`. It takes two widgets, one
to show normally and one to show in an overlay.

This should basically work, though more options could be added here.
2023-05-11 13:29:05 -07:00
Ian Douglas Scott
b85c504d72
theme: Use boxed functions instead fn pointers (#99)
This is more general, and necessary if the custom theming is dynamically
generated.

Iced's builtin theme also uses `Box`ed `Fn`, or `Rc` where clone is
required, so this seems reasonable.

Only `Text` is left using `fn`, since it needs to be `Copy`. Hopefully
that can be changed in Iced at some point.

`::custom` methods are added to make these variants a little more
convenient to construct. This replaces a couple `From` implementations,
which are potentially problematic with a generic.
2023-04-28 16:04:57 -07:00
Ian Douglas Scott
c878e24465 Fix build on Windows/non-Unix
We'll need libcosmic to work on Windows and macOS if we want to use it
in the Keyboard Configurator.

`freedesktop-icons` doesn't seem to build on Windows, so only use it
on Unix systems. It does seem to build on macOS, so leave it as a
dependency there. A good solution for icon bundling on macOS/Windows will
need to be figured out at some point.
2023-04-25 06:20:20 -06:00
Ashley Wulber
b35af255b4 refactor(container): make layer optional and export as container 2023-02-28 12:26:38 -07:00
Ashley Wulber
844aeba379 refactor(theme): make Theme Copy 2023-02-28 12:26:38 -07:00
Ashley Wulber
cbb21932d8 feat(theme): use cosmic-theme 2023-02-28 12:26:38 -07:00
Ashley Wulber
becdbb6eb3 wip: use CosmicContainer 2023-02-28 12:26:38 -07:00
Ashley Wulber
b0d6c29ab1 cleanup 2023-02-28 12:26:38 -07:00
Ashley Wulber
ccca0e5193 fix(applet): appearance 2023-02-28 12:26:38 -07:00
Ashley Wulber
a449a52dee wip(theme): use transparent overlays for component colors where possible 2023-02-28 12:26:38 -07:00
Michael Aaron Murphy
8232e1d249
fix(settings): wrong title text size for control 2023-02-16 06:22:30 +01:00
Michael Aaron Murphy
eb519782ac improv(segmented-button): extra padding for close icon 2023-02-14 14:56:29 -07:00
Michael Aaron Murphy
75e80857e2 feat(segmented-button): manually-definable icon colors 2023-02-14 14:56:29 -07:00
Michael Aaron Murphy
4fa61eeafd feat(segmented-button): configurable close icons 2023-02-14 14:56:29 -07:00
Michael Aaron Murphy
843919e44f feat(segmented-button): configurable font size 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
b79fa9d2a9 fix(settings): set proper font sizes 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
bfc71514a8 fix(widget/icon): default content_fit to fill 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
a1b3d6ec38 feat(widget): add COSMIC search widget 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
ace16b3bc0 fix(headerbar): handle empty title string 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
332f10add7 improv(headerbar): pack with 8 spacing 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
8fc3d4f0c1 improv(icon): default to ContentFit::ScaleDown 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
18a21937b4 feat(settings): settings item builder API 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
9a095e4d94 feat(divider): add functions for divider style variants of a Rule 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
b3a3c9c29a feat(widget): add text function with Cow<str> input 2023-01-30 21:57:24 +01:00
Michael Aaron Murphy
e9766389c4
fix(segmented-button): hover style not being applied 2023-01-19 22:32:58 +01:00
Michael Aaron Murphy
046dd49438 feat(spin-button): support fraction::Decimal as model input 2023-01-19 19:58:31 +01:00
Michael Aaron Murphy
ccc9b60955 feat!(spin-button): pass label rather than model to widget 2023-01-19 19:58:31 +01:00
Michael Aaron Murphy
2b0227d34f feat(iconsource): additional helper methods for creating handles 2023-01-19 19:58:31 +01:00
Michael Aaron Murphy
b3d550cc5e feat!(segmented-button): improved interfaces and documentation
BREAKING CHANGE: Various type and function names have changed to reflect
themselves better in documentation. Code has been reorganized into
separate modules with a better placement in libcosmic. Most of the
functions, types, and modules now have documentation and examples.

These changes no longer require the `Model` type to define the
data/component type that it stores. The component functionality is now
optional, and it's also possible to associate many components to an item
with one component per type. This has had a side effect of simplifying a
lot of the type signatures in the implementation.

Before, to insert an item into the model, you had to define a
`SegmentedItem` and a `Component` on insert, and get back an ID for that
item. Which makes it difficult to define an item that contains only an
icon or has no components. And requires an extra insert function to
activate the item on insert.

Now, there is a flexible builder-style API for configuring
newly-inserted items in the model. So the complexity for inserting and
retrieving values from the model has decreased significantly
2023-01-19 19:58:31 +01:00
Eduardo Flores
abf8fc96c2 feat(widget): add warning widget 2023-01-17 16:49:52 +01:00
Victoria Brekenfeld
b6c09aaa85
improv(widget/headerbar): Allow owned string (#73) 2023-01-17 13:47:44 +01:00
Michael Aaron Murphy
352bf8e401 improv: use current design for nav bar toggle button 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
c4bd0fa3d8 feat: Re-orderable positioning of items in segmented button
Calling `model.swap_position(key1, key2)` will swap the positions of
these two items in the model.
2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
e598d2bea3 fix: Prevent focus of disabled items in segmented button 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
29c7444a30 feat: focusable segmented items in segmented button 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
8988b25b6a feat: MultiSelect support for segmented buttons 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
b1cbcfaf5b refactor: Replace nav bar macros with nav bar widget 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
dd29f958af feat: add nav_bar widget based on vertical view switcher 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
dd3ff2e622 feat(segmented-button): icon support with state ergonomics 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
197d5a1c14 feat: Add IconSource::load method to get icon handles 2023-01-10 20:49:49 +01:00
Michael Aaron Murphy
7d018a2139 feat(settings): global setting for icon theme 2023-01-05 16:57:02 +01:00
Michael Aaron Murphy
043485c68d improv(icon): icon theme set to None by default 2023-01-05 16:57:02 +01:00
Michael Aaron Murphy
38f9de4405 improv(icon): IconSource paths now stored as Cow<Path> 2023-01-05 16:57:02 +01:00
Michael Aaron Murphy
357de5e9be
improv(segmented-button): Express vertical/horizontal variants as a state machine
It's difficult to make iterative developments when there's two
nearly-identical types that need to be kept synchronized to any change.
Rust gives us traits so we should use them instead of duplicating code.

This made it easier to make styling and layout improvements to both
instances of the segmented button.
2023-01-04 05:55:27 +01:00
Michael Aaron Murphy
176c30901a chore: ignore doc tests for segmented button examples 2023-01-04 05:46:24 +01:00
Victoria Brekenfeld
75687acf2f chore: apply cargo fmt 2023-01-04 05:46:24 +01:00
Michael Aaron Murphy
444e389496 refactor!: separate horizontal and vertical segmented button widgets
- Removes the orientation enum in favor of two separate widgets
- Implements the spacing attribute for both widgets
- Demo is updated to display spaced variants of the widgets
2023-01-03 20:29:50 +01:00
Michael Aaron Murphy
ad0443af3f feat(segmented-button): Vertical orientation functionality 2023-01-03 00:12:28 -05:00