mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-23 17:07:12 +03:00
deploy: 79ef9f85da
This commit is contained in:
parent
a216e41081
commit
1ac7d1d96e
@ -4,6 +4,6 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In map_gui::tools::title_screen::built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-163541a4ac2f3b12/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.62.1/std/primitive.str.html">str</a> = r"Thu, 28 Jul 2022 18:33:25 +0000";</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-163541a4ac2f3b12/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.62.1/std/primitive.str.html">str</a> = r"Fri, 29 Jul 2022 11:23:44 +0000";</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.1 (e092d0b6b 2022-07-16)" ></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
@ -179,7 +179,7 @@
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"rustdoc 1.62.1 (e092d0b6b 2022-07-16)"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The build time in RFC2822, UTC."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"Thu, 28 Jul 2022 18:33:25 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"Fri, 29 Jul 2022 11:23:44 +0000"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r"x86_64"</span>;
|
||||
|
@ -1275,7 +1275,7 @@
|
||||
<span class="self">self</span>.<span class="ident">recompute_layout</span>(<span class="ident">ctx</span>, <span class="bool-val">true</span>);
|
||||
<span class="comment">// TODO Since we just moved things around, let all widgets respond to the mouse being</span>
|
||||
<span class="comment">// somewhere? Maybe always do this in recompute_layout?</span>
|
||||
<span class="comment">//ctx.no_op_event(true, |ctx| assert_eq!(self.event(ctx), Outcome::Nothing));</span>
|
||||
<span class="comment">//ctx.no_op_event(true, |ctx| assert!(matches!(self.event(ctx), Outcome::Nothing)));</span>
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Removes a widget from the panel. Does not recalculate layout!</span>
|
||||
|
@ -177,12 +177,6 @@
|
||||
<span id="172">172</span>
|
||||
<span id="173">173</span>
|
||||
<span id="174">174</span>
|
||||
<span id="175">175</span>
|
||||
<span id="176">176</span>
|
||||
<span id="177">177</span>
|
||||
<span id="178">178</span>
|
||||
<span id="179">179</span>
|
||||
<span id="180">180</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Distance</span>, <span class="ident">Polygon</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::{
|
||||
@ -198,7 +192,6 @@
|
||||
<span class="ident">label</span>: <span class="ident">String</span>,
|
||||
<span class="ident">cursor_x</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">has_focus</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">hovering</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">autofocus</span>: <span class="ident">bool</span>,
|
||||
<span class="ident">padding</span>: <span class="ident">EdgeInsets</span>,
|
||||
|
||||
@ -212,6 +205,7 @@
|
||||
<span class="ident">TextBox::widget</span>(<span class="ident">ctx</span>, <span class="ident">label</span>, <span class="ident">prefilled</span>, <span class="bool-val">true</span>, <span class="number">50</span>)
|
||||
}
|
||||
|
||||
<span class="doccomment">/// `autofocus` means the text box always has focus; it'll consume all key events.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">widget</span><span class="op"><</span><span class="ident">I</span>: <span class="ident">Into</span><span class="op"><</span><span class="ident">String</span><span class="op">></span><span class="op">></span>(
|
||||
<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="ident">EventCtx</span>,
|
||||
<span class="ident">label</span>: <span class="ident">I</span>,
|
||||
@ -244,12 +238,11 @@
|
||||
<span class="ident">right</span>: <span class="number">8.0</span>,
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">max_char_width</span> <span class="op">=</span> <span class="number">25.0</span>;
|
||||
<span class="ident">TextBox</span> {
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">label</span>,
|
||||
<span class="ident">cursor_x</span>: <span class="ident">prefilled</span>.<span class="ident">len</span>(),
|
||||
<span class="ident">line</span>: <span class="ident">prefilled</span>,
|
||||
<span class="ident">has_focus</span>: <span class="bool-val">false</span>,
|
||||
<span class="ident">hovering</span>: <span class="bool-val">false</span>,
|
||||
<span class="ident">autofocus</span>,
|
||||
<span class="ident">padding</span>,
|
||||
<span class="ident">top_left</span>: <span class="ident">ScreenPt::new</span>(<span class="number">0.0</span>, <span class="number">0.0</span>),
|
||||
@ -290,24 +283,15 @@
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">event</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&mut</span> <span class="ident">EventCtx</span>, <span class="ident">output</span>: <span class="kw-2">&mut</span> <span class="ident">WidgetOutput</span>) {
|
||||
<span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">redo_mouseover</span>() {
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">autofocus</span> <span class="op">&&</span> <span class="ident">ctx</span>.<span class="ident">redo_mouseover</span>() {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pt</span>) <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">get_cursor_in_screen_space</span>() {
|
||||
<span class="self">self</span>.<span class="ident">hovering</span> <span class="op">=</span> <span class="ident">ScreenRectangle::top_left</span>(<span class="self">self</span>.<span class="ident">top_left</span>, <span class="self">self</span>.<span class="ident">dims</span>).<span class="ident">contains</span>(<span class="ident">pt</span>);
|
||||
<span class="self">self</span>.<span class="ident">has_focus</span> <span class="op">=</span> <span class="ident">ScreenRectangle::top_left</span>(<span class="self">self</span>.<span class="ident">top_left</span>, <span class="self">self</span>.<span class="ident">dims</span>).<span class="ident">contains</span>(<span class="ident">pt</span>);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="self">self</span>.<span class="ident">hovering</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="self">self</span>.<span class="ident">has_focus</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// TODO Revisit this, which was originally written for a panel containing multiple</span>
|
||||
<span class="comment">// textboxes.</span>
|
||||
<span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">normal_left_click</span>() {
|
||||
<span class="comment">// Let all textboxes see this event, so they can deactivate their own focus.</span>
|
||||
<span class="comment">// TODO But if a button is clicked before this textbox, that event isn't seen here...</span>
|
||||
<span class="ident">ctx</span>.<span class="ident">input</span>.<span class="ident">unconsume_event</span>();
|
||||
<span class="self">self</span>.<span class="ident">has_focus</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">hovering</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">has_focus</span> <span class="op">&&</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">autofocus</span> {
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">autofocus</span> <span class="op">&&</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">has_focus</span> {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">key</span>) <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">input</span>.<span class="ident">any_pressed</span>() {
|
||||
@ -343,7 +327,11 @@
|
||||
<span class="kw">fn</span> <span class="ident">draw</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">g</span>: <span class="kw-2">&mut</span> <span class="ident">GfxCtx</span>) {
|
||||
<span class="comment">// TODO Cache</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">GeomBatch::from</span>(<span class="macro">vec!</span>[(
|
||||
<span class="ident">g</span>.<span class="ident">style</span>().<span class="ident">field_bg</span>,
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">autofocus</span> <span class="op">|</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">has_focus</span> {
|
||||
<span class="ident">g</span>.<span class="ident">style</span>().<span class="ident">field_bg</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">g</span>.<span class="ident">style</span>().<span class="ident">field_bg</span>.<span class="ident">dull</span>(<span class="number">0.5</span>)
|
||||
},
|
||||
<span class="ident">Polygon::rounded_rectangle</span>(<span class="self">self</span>.<span class="ident">dims</span>.<span class="ident">width</span>, <span class="self">self</span>.<span class="ident">dims</span>.<span class="ident">height</span>, <span class="number">2.0</span>),
|
||||
)]);
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,6 +4,6 @@
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../widgetry/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module text_box</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section><div id="sidebar-vars" data-name="text_box" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../widgetry/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">widgets</a>::<wbr><a class="mod" href="#">text_box</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/widgetry/widgets/text_box.rs.html#1-180">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">widgets</a>::<wbr><a class="mod" href="#">text_box</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/widgetry/widgets/text_box.rs.html#1-174">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TextBox.html" title="widgetry::widgets::text_box::TextBox struct">TextBox</a></div><div class="item-right docblock-short"></div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="widgetry" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.1 (e092d0b6b 2022-07-16)" ></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user