Skip to content

Commit 1a6a240

Browse files
committed
Deploying to gh-pages from @ vizia/vizia@5813d60 🚀
1 parent 2c8fcd6 commit 1a6a240

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+219
-168
lines changed

search-index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

search.desc/vizia/vizia-desc-0-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

search.desc/vizia/vizia-desc-1-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

search.desc/vizia_core/vizia_core-desc-0-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vizia_core/context/mod.rs.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,11 @@
11551155
<a href="#1154" id="1154">1154</a>
11561156
<a href="#1155" id="1155">1155</a>
11571157
<a href="#1156" id="1156">1156</a>
1158-
<a href="#1157" id="1157">1157</a></pre></div><pre class="rust"><code><span class="doccomment">//! Context types for retained state, used during view building, event handling, and drawing.
1158+
<a href="#1157" id="1157">1157</a>
1159+
<a href="#1158" id="1158">1158</a>
1160+
<a href="#1159" id="1159">1159</a>
1161+
<a href="#1160" id="1160">1160</a>
1162+
<a href="#1161" id="1161">1161</a></pre></div><pre class="rust"><code><span class="doccomment">//! Context types for retained state, used during view building, event handling, and drawing.
11591163

11601164
</span><span class="kw">mod </span>access;
11611165
<span class="attr">#[doc(hidden)]
@@ -1171,11 +1175,14 @@
11711175
textlayout::{FontCollection, TypefaceFontProvider},
11721176
FontMgr,
11731177
};
1174-
<span class="kw">use </span>std::any::{Any, TypeId};
11751178
<span class="kw">use </span>std::cell::RefCell;
11761179
<span class="kw">use </span>std::collections::{BinaryHeap, VecDeque};
11771180
<span class="kw">use </span>std::rc::Rc;
11781181
<span class="kw">use </span>std::sync::Mutex;
1182+
<span class="kw">use </span>std::{
1183+
any::{Any, TypeId},
1184+
sync::Arc,
1185+
};
11791186
<span class="kw">use </span>vizia_id::IdManager;
11801187
<span class="kw">use </span>vizia_window::{WindowDescription, WindowPosition};
11811188

@@ -1223,7 +1230,7 @@
12231230
</span><span class="kw">pub static </span>CURRENT: RefCell&lt;Entity&gt; = RefCell::new(Entity::root());
12241231
}
12251232

1226-
<span class="attr">#[derive(Default, Clone, Debug)]
1233+
<span class="attr">#[derive(Default, Clone)]
12271234
</span><span class="kw">pub struct </span>WindowState {
12281235
<span class="kw">pub </span>window_description: WindowDescription,
12291236
<span class="kw">pub </span>scale_factor: f32,
@@ -1235,6 +1242,7 @@
12351242
<span class="kw">pub </span>is_modal: bool,
12361243
<span class="kw">pub </span>should_close: bool,
12371244
<span class="kw">pub </span>position: WindowPosition,
1245+
<span class="kw">pub </span>content: <span class="prelude-ty">Option</span>&lt;Arc&lt;<span class="kw">dyn </span>Fn(<span class="kw-2">&amp;mut </span>Context)&gt;&gt;,
12381246
}
12391247

12401248
<span class="doccomment">/// The main storage and control object for a Vizia application.

src/vizia_winit/application.rs.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,18 @@
888888
<a href="#887" id="887">887</a>
889889
<a href="#888" id="888">888</a>
890890
<a href="#889" id="889">889</a>
891-
<a href="#890" id="890">890</a></pre></div><pre class="rust"><code><span class="attr">#[cfg(target_os = <span class="string">"windows"</span>)]
891+
<a href="#890" id="890">890</a>
892+
<a href="#891" id="891">891</a>
893+
<a href="#892" id="892">892</a>
894+
<a href="#893" id="893">893</a>
895+
<a href="#894" id="894">894</a>
896+
<a href="#895" id="895">895</a>
897+
<a href="#896" id="896">896</a>
898+
<a href="#897" id="897">897</a>
899+
<a href="#898" id="898">898</a>
900+
<a href="#899" id="899">899</a>
901+
<a href="#900" id="900">900</a>
902+
<a href="#901" id="901">901</a></pre></div><pre class="rust"><code><span class="attr">#[cfg(target_os = <span class="string">"windows"</span>)]
892903
</span><span class="kw">use </span><span class="kw">crate</span>::window::set_cloak;
893904
<span class="kw">use crate</span>::{
894905
convert::{winit_key_code_to_code, winit_key_to_key},
@@ -1190,6 +1201,11 @@
11901201
)
11911202
.expect(<span class="string">"Failed to create window"</span>);
11921203
<span class="self">self</span>.cx.add_main_window(window_entity, <span class="kw-2">&amp;</span>window_state.window_description, <span class="number">1.0</span>);
1204+
<span class="self">self</span>.cx.<span class="number">0</span>.with_current(window_entity, |cx| {
1205+
<span class="kw">if let </span><span class="prelude-val">Some</span>(content) = <span class="kw-2">&amp;</span>window_state.content {
1206+
(content)(cx)
1207+
}
1208+
});
11931209
<span class="self">self</span>.cx.mutate_window(window_entity, |cx, win: <span class="kw-2">&amp;mut </span>Window| {
11941210
win.window = <span class="prelude-val">Some</span>(window.clone());
11951211
win.custom_cursors = custom_cursors.clone();
@@ -1488,6 +1504,12 @@
14881504
)
14891505
.expect(<span class="string">"Failed to create window"</span>);
14901506

1507+
<span class="self">self</span>.cx.<span class="number">0</span>.with_current(<span class="kw-2">*</span>window_entity, |cx| {
1508+
<span class="kw">if let </span><span class="prelude-val">Some</span>(content) = <span class="kw-2">&amp;</span>window_state.content {
1509+
(content)(cx)
1510+
}
1511+
});
1512+
14911513
<span class="self">self</span>.cx.mutate_window(<span class="kw-2">*</span>window_entity, |cx, win: <span class="kw-2">&amp;mut </span>Window| {
14921514
win.window = <span class="prelude-val">Some</span>(window.clone());
14931515
<span class="kw">if let </span><span class="prelude-val">Some</span>(callback) = <span class="kw-2">&amp;</span>win.on_create {

src/vizia_winit/window.rs.html

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,17 @@
711711
<a href="#710" id="710">710</a>
712712
<a href="#711" id="711">711</a>
713713
<a href="#712" id="712">712</a>
714-
<a href="#713" id="713">713</a></pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::window_modifiers::WindowModifiers;
714+
<a href="#713" id="713">713</a>
715+
<a href="#714" id="714">714</a>
716+
<a href="#715" id="715">715</a>
717+
<a href="#716" id="716">716</a>
718+
<a href="#717" id="717">717</a>
719+
<a href="#718" id="718">718</a>
720+
<a href="#719" id="719">719</a>
721+
<a href="#720" id="720">720</a>
722+
<a href="#721" id="721">721</a>
723+
<a href="#722" id="722">722</a>
724+
<a href="#723" id="723">723</a></pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::window_modifiers::WindowModifiers;
715725
<span class="kw">use </span>glutin::context::GlProfile;
716726
<span class="kw">use </span>vizia_core::context::TreeProps;
717727
<span class="attr">#[cfg(target_os = <span class="string">"windows"</span>)]
@@ -1079,7 +1089,7 @@
10791089
<span class="self">self</span>.window.as_ref().unwrap()
10801090
}
10811091

1082-
<span class="kw">pub fn </span>new(cx: <span class="kw-2">&amp;mut </span>Context, content: <span class="kw">impl </span>Fn(<span class="kw-2">&amp;mut </span>Context)) -&gt; Handle&lt;<span class="self">Self</span>&gt; {
1092+
<span class="kw">pub fn </span>new(cx: <span class="kw-2">&amp;mut </span>Context, content: <span class="kw">impl </span><span class="lifetime">'static </span>+ Fn(<span class="kw-2">&amp;mut </span>Context)) -&gt; Handle&lt;<span class="self">Self</span>&gt; {
10831093
<span class="self">Self </span>{
10841094
window: <span class="prelude-val">None</span>,
10851095
on_close: <span class="prelude-val">None</span>,
@@ -1088,13 +1098,19 @@
10881098
custom_cursors: Default::default(),
10891099
}
10901100
.build(cx, |cx| {
1091-
cx.windows.insert(cx.current(), WindowState::default());
1101+
cx.windows.insert(
1102+
cx.current(),
1103+
WindowState { content: <span class="prelude-val">Some</span>(Arc::new(content)), ..Default::default() },
1104+
);
10921105
cx.tree.set_window(cx.current(), <span class="bool-val">true</span>);
1093-
(content)(cx);
10941106
})
10951107
}
10961108

1097-
<span class="kw">pub fn </span>popup(cx: <span class="kw-2">&amp;mut </span>Context, is_modal: bool, content: <span class="kw">impl </span>Fn(<span class="kw-2">&amp;mut </span>Context)) -&gt; Handle&lt;<span class="self">Self</span>&gt; {
1109+
<span class="kw">pub fn </span>popup(
1110+
cx: <span class="kw-2">&amp;mut </span>Context,
1111+
is_modal: bool,
1112+
content: <span class="kw">impl </span><span class="lifetime">'static </span>+ Fn(<span class="kw-2">&amp;mut </span>Context),
1113+
) -&gt; Handle&lt;<span class="self">Self</span>&gt; {
10981114
<span class="self">Self </span>{
10991115
window: <span class="prelude-val">None</span>,
11001116
on_close: <span class="prelude-val">None</span>,
@@ -1110,10 +1126,14 @@
11101126

11111127
cx.windows.insert(
11121128
cx.current(),
1113-
WindowState { owner: <span class="prelude-val">Some</span>(parent_window), is_modal: <span class="bool-val">true</span>, ..Default::default() },
1129+
WindowState {
1130+
owner: <span class="prelude-val">Some</span>(parent_window),
1131+
is_modal: <span class="bool-val">true</span>,
1132+
content: <span class="prelude-val">Some</span>(Arc::new(content)),
1133+
..Default::default()
1134+
},
11141135
);
11151136
cx.tree.set_window(cx.current(), <span class="bool-val">true</span>);
1116-
(content)(cx);
11171137
})
11181138
.lock_focus_to_within()
11191139
}

trait.impl/core/fmt/trait.Debug.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trait.impl/core/marker/trait.Send.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trait.impl/core/marker/trait.Sync.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)