Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c69619c
Make platform-specific menus more portable
raphlinus Oct 21, 2020
40604ae
[linux] Textbox should select all text when tabbed to
cmyr Oct 26, 2020
9e5f19a
Reduce flashing on window creation (#1272)
rhzk Oct 28, 2020
140ca91
Try reverting usvg.
jneem Oct 29, 2020
e585488
Merge pull request #1356 from jneem/harfbuzz2
justinmoon Oct 29, 2020
bc96077
The gallery example now requires a new feature. (#1358)
richard-uk1 Oct 29, 2020
6a4062d
Merge pull request #1339 from linebender/menu_work4
raphlinus Oct 29, 2020
ff099e9
Fixed broken doc links due to typo in container.rs (#1357)
xkns Oct 29, 2020
28e5e06
Add WidgetPod::with_event_context for Crochet.
luleyleo Oct 28, 2020
aac8103
Fix LabelText::Static resolve method.
luleyleo Oct 28, 2020
fa86fdf
Add `should_propagate_to_hidden` methods to `Event` and `LifeCycle`
andrewhickman Oct 27, 2020
1b086f4
Add `Either::current_widget` to clean up code slightly
andrewhickman Oct 27, 2020
e46578a
Propagate events to hidden widgets in `Either`
andrewhickman Oct 27, 2020
5a127c3
Make dialogs on windows non-sychronous. (#1328)
jneem Oct 29, 2020
6407860
Make `missed call to set_layout_rect` warning conditional on `should_…
andrewhickman Oct 29, 2020
bca89c7
Update changelog
andrewhickman Oct 30, 2020
9acc014
Merge branch 'master' into master
andrewhickman Oct 30, 2020
a30b1ef
Merge pull request #1351 from andrewhickman/master
luleyleo Oct 31, 2020
7a8464f
Slightly optimize implementation of EditableText for Arc<String>
andrewhickman Oct 29, 2020
0b6aacb
Compare string equality instead of Data::same in Editor::data_is_stale
andrewhickman Oct 30, 2020
9cb4029
Update README.md
richard-uk1 Nov 3, 2020
9f1c9af
Update README.md
richard-uk1 Nov 3, 2020
64374c5
Merge pull request #1366 from linebender/derekdreery-patch-1
richard-uk1 Nov 3, 2020
b9c4304
Rework custom widget (#1363)
JAicewizard Nov 3, 2020
729754c
Allow setting the cursor in the update method. (#1361)
jneem Nov 3, 2020
f7b3904
Ensure that WindowHandle and IdleHandle have the right Send/Sync mark…
jneem Nov 3, 2020
c6aa274
[mac] Fix typo preventing select-all on tab focus
cmyr Nov 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add WidgetPod::with_event_context for Crochet.
  • Loading branch information
luleyleo committed Oct 29, 2020
commit 28e5e0682c97b0d88371d49f2431cfb13b71e244
1 change: 1 addition & 0 deletions druid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gtk = ["druid-shell/gtk"]
image = ["druid-shell/image"]
svg = ["usvg", "harfbuzz-sys"]
x11 = ["druid-shell/x11"]
crochet = []

# passing on all the image features. AVIF is not supported because it does not
# support decoding, and that's all we use `Image` for.
Expand Down
17 changes: 17 additions & 0 deletions druid/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,23 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
size
}

/// Execute the closure with this widgets `EventCtx`.
#[cfg(feature = "crochet")]
pub fn with_event_context<F>(&mut self, parent_ctx: &mut EventCtx, mut fun: F)
where
F: FnMut(&mut W, &mut EventCtx),
{
let mut ctx = EventCtx {
state: parent_ctx.state,
widget_state: &mut self.state,
cursor: parent_ctx.cursor,
is_handled: false,
is_root: false,
};
fun(&mut self.inner, &mut ctx);
parent_ctx.widget_state.merge_up(&mut self.state);
}

/// Propagate an event.
///
/// Generally the [`event`] method of a container widget will call this
Expand Down