libcosmic/cosmic/widget/segmented_button/trait.SegmentedVariant.html

34 lines
13 KiB
HTML
Raw Normal View History

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Isolates variant-specific behaviors from `SegmentedButton`."><title>SegmentedVariant in cosmic::widget::segmented_button - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Segmented<wbr>Variant</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.VERTICAL" title="VERTICAL">VERTICAL</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.variant_appearance" title="variant_appearance">variant_appearance</a></li><li><a href="#tymethod.variant_bounds" title="variant_bounds">variant_bounds</a></li><li><a href="#tymethod.variant_layout" title="variant_layout">variant_layout</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>widget::<wbr>segmented_<wbr>button</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">cosmic</a>::<wbr><a href="../index.html">widget</a>::<wbr><a href="index.html">segmented_button</a></div><h1>Trait <span class="trait">SegmentedVariant</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/cosmic/widget/segmented_button/widget.rs.html#80-103">Source</a> </span></div><pre class="rust item-decl"><code>pub trait SegmentedVariant {
const <a href="#associatedconstant.VERTICAL" class="constant">VERTICAL</a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
// Required methods
fn <a href="#tymethod.variant_appearance" class="fn">variant_appearance</a>(theme: &amp;<a class="struct" href="../../struct.Theme.html" title="struct cosmic::Theme">Theme</a>, style: &amp;<a class="enum" href="../../style/enum.SegmentedButton.html" title="enum cosmic::style::SegmentedButton">SegmentedButton</a>) -&gt; <a class="struct" href="struct.Appearance.html" title="struct cosmic::widget::segmented_button::Appearance">Appearance</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.variant_bounds" class="fn">variant_bounds</a>&lt;'b&gt;(
&amp;'b self,
state: &amp;'b LocalState,
bounds: <a class="struct" href="../../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
) -&gt; <a class="struct" href="../../cctk/sctk/reexports/client/backend/smallvec/alloc/boxed/struct.Box.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = ItemBounds&gt; + 'b&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.variant_layout" class="fn">variant_layout</a>(
&amp;self,
state: &amp;mut LocalState,
renderer: &amp;<a class="type" href="../../type.Renderer.html" title="type cosmic::Renderer">Renderer</a>,
limits: &amp;<a class="struct" href="../../iced/struct.Limits.html" title="struct cosmic::iced::Limits">Limits</a>,
) -&gt; <a class="struct" href="../../iced/struct.Size.html" title="struct cosmic::iced::Size">Size</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Isolates variant-specific behaviors from <a href="struct.SegmentedButton.html" title="struct cosmic::widget::segmented_button::SegmentedButton"><code>SegmentedButton</code></a>.</p>
</div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><section id="associatedconstant.VERTICAL" class="method"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/widget.rs.html#81">Source</a><h4 class="code-header">const <a href="#associatedconstant.VERTICAL" class="constant">VERTICAL</a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.variant_appearance" class="method"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/widget.rs.html#84-87">Source</a><h4 class="code-header">fn <a href="#tymethod.variant_appearance" class="fn">variant_appearance</a>(theme: &amp;<a class="struct" href="../../struct.Theme.html" title="struct cosmic::Theme">Theme</a>, style: &amp;<a class="enum" href="../../style/enum.SegmentedButton.html" title="enum cosmic::style::SegmentedButton">SegmentedButton</a>) -&gt; <a class="struct" href="struct.Appearance.html" title="struct cosmic::widget::segmented_button::Appearance">Appearance</a></h4></section></summary><div class="docblock"><p>Get the appearance for this variant of the widget.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.variant_bounds" class="method"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/widget.rs.html#90-94">Source</a><h4 class="code-header">fn <a href="#tymethod.variant_bounds" class="fn">variant_bounds</a>&lt;'b&gt;(
&amp;'b self,
state: &amp;'b LocalState,
bounds: <a class="struct" href="../../iced/struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
) -&gt; <a class="struct" href="../../cctk/sctk/reexports/client/backend/smallvec/alloc/boxed/struct.Box.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = ItemBounds&gt; + 'b&gt;</h4></section></summary><div class="docblock"><p>Calculates the bounds for visible buttons.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.variant_layout" class="method"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/widget.rs.html#97-102">Source</a><h4 class="code-header">fn <a href="#tymethod.variant_layout" class="fn">variant_layout</a>(
&amp;self,
state: &amp;mut LocalState,
renderer: &amp;<a class="type" href="../../type.Renderer.html" title="type cosmic::Renderer">Renderer</a>,
limits: &amp;<a class="struct" href="../../iced/struct.Limits.html" title="struct cosmic::iced::Limits">Limits</a>,
) -&gt; <a class="struct" href="../../iced/struct.Size.html" title="struct cosmic::iced::Size">Size</a></h4></section></summary><div class="docblock"><p>Calculates the layout of this variant.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-SegmentedVariant-for-SegmentedButton%3C'_,+Horizontal,+SelectionMode,+Message%3E" class="impl"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/horizontal.rs.html#33-230">Source</a><a href="#impl-SegmentedVariant-for-SegmentedButton%3C'_,+Horizontal,+SelectionMode,+Message%3E" class="anchor">§</a><h3 class="code-header">impl&lt;SelectionMode, Message&gt; <a class="trait" href="trait.SegmentedVariant.html" title="trait cosmic::widget::segmented_button::SegmentedVariant">SegmentedVariant</a> for <a class="struct" href="struct.SegmentedButton.html" title="struct cosmic::widget::segmented_button::SegmentedButton">SegmentedButton</a>&lt;'_, Horizontal, SelectionMode, Message&gt;<div class="where">where
<a class="struct" href="struct.Model.html" title="struct cosmic::widget::segmented_button::Model">Model</a>&lt;SelectionMode&gt;: <a class="trait" href="trait.Selectable.html" title="trait cosmic::widget::segmented_button::Selectable">Selectable</a>,
SelectionMode: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedconstant.VERTICAL-1" class="associatedconstant trait-impl"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/horizontal.rs.html#39">Source</a><a href="#associatedconstant.VERTICAL-1" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.VERTICAL" class="constant">VERTICAL</a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> = false</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-SegmentedVariant-for-SegmentedButton%3C'_,+Vertical,+SelectionMode,+Message%3E" class="impl"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/vertical.rs.html#33-131">Source</a><a href="#impl-SegmentedVariant-for-SegmentedButton%3C'_,+Vertical,+SelectionMode,+Message%3E" class="anchor">§</a><h3 class="code-header">impl&lt;SelectionMode, Message&gt; <a class="trait" href="trait.SegmentedVariant.html" title="trait cosmic::widget::segmented_button::SegmentedVariant">SegmentedVariant</a> for <a class="struct" href="struct.SegmentedButton.html" title="struct cosmic::widget::segmented_button::SegmentedButton">SegmentedButton</a>&lt;'_, Vertical, SelectionMode, Message&gt;<div class="where">where
<a class="struct" href="struct.Model.html" title="struct cosmic::widget::segmented_button::Model">Model</a>&lt;SelectionMode&gt;: <a class="trait" href="trait.Selectable.html" title="trait cosmic::widget::segmented_button::Selectable">Selectable</a>,
SelectionMode: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedconstant.VERTICAL-2" class="associatedconstant trait-impl"><a class="src rightside" href="../../../src/cosmic/widget/segmented_button/vertical.rs.html#39">Source</a><a href="#associatedconstant.VERTICAL-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.VERTICAL" class="constant">VERTICAL</a>: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> = true</h4></section></div></details></div><script src="../../../trait.impl/cosmic/widget/segmented_button/widget/trait.SegmentedVariant.js" async></script></section></div></main></body></html>