Commit graph

18 commits

Author SHA1 Message Date
Stephan Buys
7f321cb0a3 segmented button: support tab drag + drop 2025-11-20 22:33:13 +01:00
Cheong Lau
bc744bd4e3
fix(segmented_button): use less restrictive FnOnce for builder method over Fn 2025-11-11 17:18:38 +01:00
Cheong Lau
a27bb5e05d chore: apply clippy suggestions 2025-10-05 04:40:51 +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
0b7e23444a
feat(segmented_button): add len method 2025-02-13 16:22:42 +01:00
Tony4dev
d536341234
fix(segmented_button): model index out of bounds when setting position 2024-12-03 05:14:33 +01:00
Jeremy Soller
2faaeddb05
feat(segmented_button): Support adding divider above items in vertical segmented button 2024-09-11 12:51:19 -06:00
Michael Aaron Murphy
16c1265535
improv(segmented-button): set icons with impl Into<Icon> 2024-05-20 00:59:40 +02:00
danieleades
8e99406a8b
chore: fixing linter warnings 2023-11-28 20:02:08 +01:00
Jeremy Soller
2df8cb8862 Allow segmented buttons to be indented 2023-11-16 08:06:07 -07:00
Michael Aaron Murphy
4e4eeaac12 feat!(widget): rewrite button & icon widget APIs 2023-09-14 01:38:56 +02:00
Ashley Wulber
6457481ae5 fix: text input layout & cargo fmt 2023-08-24 15:44:29 -04: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
e9766389c4
fix(segmented-button): hover style not being applied 2023-01-19 22:32:58 +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