Skip to content

Commit

Permalink
Deploying to gh-pages from @ vizia/vizia@466e1c8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
geom3trik committed Jan 15, 2024
1 parent ecabbe2 commit 528ac17
Show file tree
Hide file tree
Showing 32 changed files with 105 additions and 87 deletions.
26 changes: 22 additions & 4 deletions src/vizia_core/views/menu.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@
<a href="#352" id="352">352</a>
<a href="#353" id="353">353</a>
<a href="#354" id="354">354</a>
<a href="#355" id="355">355</a>
<a href="#356" id="356">356</a>
<a href="#357" id="357">357</a>
<a href="#358" id="358">358</a>
<a href="#359" id="359">359</a>
<a href="#360" id="360">360</a>
<a href="#361" id="361">361</a>
<a href="#362" id="362">362</a>
<a href="#363" id="363">363</a>
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::{icons::ICON_CHEVRON_RIGHT, prelude::<span class="kw-2">*</span>};

<span class="attr">#[derive(Lens)]
Expand Down Expand Up @@ -383,8 +392,7 @@
);
});

<span class="comment">// MenuController { open_menu: None }.build(cx);
</span>(content)(cx);
(content)(cx);
})
.layout_type(LayoutType::Row)
}
Expand Down Expand Up @@ -494,13 +502,15 @@
// cx.focus();
// }
</span><span class="kw">if </span><span class="self">self</span>.open_on_hover {
<span class="kw">let </span>parent = cx.tree.get_parent(cx.current).unwrap();
<span class="comment">// Close any open submenus of the parent
</span><span class="kw">let </span>parent = cx.tree.get_parent(cx.current).unwrap();
cx.emit_custom(
Event::new(MenuEvent::Close)
.target(parent)
.propagate(Propagation::Subtree),
);
cx.emit(MenuEvent::Open);
<span class="comment">// Open this submenu
</span>cx.emit(MenuEvent::Open);
}
}
}
Expand Down Expand Up @@ -543,6 +553,14 @@
<span class="self">self</span>.is_open ^= <span class="bool-val">true</span>;
<span class="kw">if </span><span class="self">self</span>.is_open {
cx.emit(MenuEvent::MenuIsOpen);
} <span class="kw">else </span>{
<span class="comment">// If the parent is a MenuBar then this will reset the is_open state
</span><span class="kw">let </span>parent = cx.tree.get_parent(cx.current).unwrap();
cx.emit_custom(
Event::new(MenuEvent::CloseAll)
.target(parent)
.propagate(Propagation::Direct),
);
}
meta.consume();
}
Expand Down
2 changes: 1 addition & 1 deletion vizia/binding/trait.Lens.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vizia/view/struct.Handle.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ <h5 id="examples-1"><a href="#examples-1">Examples</a></h5>
T: <a class="trait" href="../binding/trait.Data.html" title="trait vizia::binding::Data">Data</a>,</span></h3></section></summary><div class="impl-items"><section id="method.on_increment" class="method"><a class="src rightside" href="../../src/vizia_core/views/list.rs.html#97-99">source</a><h4 class="code-header">pub fn <a href="#method.on_increment" class="fn">on_increment</a>&lt;F&gt;(self, callback: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'_, <a class="struct" href="../views/struct.List.html" title="struct vizia::views::List">List</a>&lt;L, T&gt;&gt;<span class="where fmt-newline">where
F: 'static + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../context/struct.EventContext.html" title="struct vizia::context::EventContext">EventContext</a>&lt;'_&gt;),</span></h4></section><section id="method.on_decrement" class="method"><a class="src rightside" href="../../src/vizia_core/views/list.rs.html#110-112">source</a><h4 class="code-header">pub fn <a href="#method.on_decrement" class="fn">on_decrement</a>&lt;F&gt;(self, callback: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'_, <a class="struct" href="../views/struct.List.html" title="struct vizia::views::List">List</a>&lt;L, T&gt;&gt;<span class="where fmt-newline">where
F: 'static + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../context/struct.EventContext.html" title="struct vizia::context::EventContext">EventContext</a>&lt;'_&gt;),</span></h4></section><section id="method.on_clear" class="method"><a class="src rightside" href="../../src/vizia_core/views/list.rs.html#123-125">source</a><h4 class="code-header">pub fn <a href="#method.on_clear" class="fn">on_clear</a>&lt;F&gt;(self, callback: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'_, <a class="struct" href="../views/struct.List.html" title="struct vizia::views::List">List</a>&lt;L, T&gt;&gt;<span class="where fmt-newline">where
F: 'static + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../context/struct.EventContext.html" title="struct vizia::context::EventContext">EventContext</a>&lt;'_&gt;),</span></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Handle%3C'a,+MenuPopup%3CL%3E%3E" class="impl"><a class="src rightside" href="../../src/vizia_core/views/menu.rs.html#274-277">source</a><a href="#impl-Handle%3C'a,+MenuPopup%3CL%3E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, L&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'a, <a class="struct" href="../views/struct.MenuPopup.html" title="struct vizia::views::MenuPopup">MenuPopup</a>&lt;L&gt;&gt;<span class="where fmt-newline">where
F: 'static + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../context/struct.EventContext.html" title="struct vizia::context::EventContext">EventContext</a>&lt;'_&gt;),</span></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Handle%3C'a,+MenuPopup%3CL%3E%3E" class="impl"><a class="src rightside" href="../../src/vizia_core/views/menu.rs.html#283-286">source</a><a href="#impl-Handle%3C'a,+MenuPopup%3CL%3E%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, L&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'a, <a class="struct" href="../views/struct.MenuPopup.html" title="struct vizia::views::MenuPopup">MenuPopup</a>&lt;L&gt;&gt;<span class="where fmt-newline">where
L: <a class="trait" href="../binding/trait.Lens.html" title="trait vizia::binding::Lens">Lens</a>,
&lt;L as <a class="trait" href="../binding/trait.Lens.html" title="trait vizia::binding::Lens">Lens</a>&gt;::<a class="associatedtype" href="../binding/trait.Lens.html#associatedtype.Target" title="type vizia::binding::Lens::Target">Target</a>: <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.75.0/std/primitive.bool.html">bool</a>&gt;,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.on_blur" class="method"><a class="src rightside" href="../../src/vizia_core/views/menu.rs.html#281-283">source</a><h4 class="code-header">pub fn <a href="#method.on_blur" class="fn">on_blur</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'a, <a class="struct" href="../views/struct.MenuPopup.html" title="struct vizia::views::MenuPopup">MenuPopup</a>&lt;L&gt;&gt;<span class="where fmt-newline">where
&lt;L as <a class="trait" href="../binding/trait.Lens.html" title="trait vizia::binding::Lens">Lens</a>&gt;::<a class="associatedtype" href="../binding/trait.Lens.html#associatedtype.Target" title="type vizia::binding::Lens::Target">Target</a>: <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.75.0/std/primitive.bool.html">bool</a>&gt;,</span></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.on_blur" class="method"><a class="src rightside" href="../../src/vizia_core/views/menu.rs.html#290-292">source</a><h4 class="code-header">pub fn <a href="#method.on_blur" class="fn">on_blur</a>&lt;F&gt;(self, f: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'a, <a class="struct" href="../views/struct.MenuPopup.html" title="struct vizia::views::MenuPopup">MenuPopup</a>&lt;L&gt;&gt;<span class="where fmt-newline">where
F: 'static + <a class="trait" href="https://doc.rust-lang.org/1.75.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&amp;mut <a class="struct" href="../context/struct.EventContext.html" title="struct vizia::context::EventContext">EventContext</a>&lt;'_&gt;),</span></h4></section></summary><div class="docblock"><p>Registers a callback for when the user clicks off of the popup, usually with the intent of
closing it.</p>
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Handle%3C'v,+PickList%3E" class="impl"><a class="src rightside" href="../../src/vizia_core/views/picklist.rs.html#86">source</a><a href="#impl-Handle%3C'v,+PickList%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'v&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'v, <a class="struct" href="../views/struct.PickList.html" title="struct vizia::views::PickList">PickList</a>&gt;</h3></section></summary><div class="impl-items"><section id="method.on_select-2" class="method"><a class="src rightside" href="../../src/vizia_core/views/picklist.rs.html#87-89">source</a><h4 class="code-header">pub fn <a href="#method.on_select-2" class="fn">on_select</a>&lt;F&gt;(self, callback: F) -&gt; <a class="struct" href="struct.Handle.html" title="struct vizia::view::Handle">Handle</a>&lt;'v, <a class="struct" href="../views/struct.PickList.html" title="struct vizia::views::PickList">PickList</a>&gt;<span class="where fmt-newline">where
Expand Down
Loading

0 comments on commit 528ac17

Please sign in to comment.