Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ You can find its changes [documented below](#083---2023-02-28).

### Added

- Type name is now included in panic error messages in `WidgetPod`. ([#2380] by [@matthewgapp])

### Changed

### Deprecated
Expand Down Expand Up @@ -787,6 +789,7 @@ Last release without a changelog :(
[@newcomb-luke]: https://github.com/newcomb-luke
[@AtomicGamer9523]: https://github.com/AtomicGamer9523
[@Insprill]: https://github.com/Insprill
[@matthewgapp]: https://github.com/matthewgapp

[#599]: https://github.com/linebender/druid/pull/599
[#611]: https://github.com/linebender/druid/pull/611
Expand Down Expand Up @@ -1233,6 +1236,7 @@ Last release without a changelog :(
[#2356]: https://github.com/linebender/druid/pull/2356
[#2375]: https://github.com/linebender/druid/pull/2375
[#2378]: https://github.com/linebender/druid/pull/2378
[#2380]: https://github.com/linebender/druid/pull/2380

[Unreleased]: https://github.com/linebender/druid/compare/v0.8.3...master
[0.8.3]: https://github.com/linebender/druid/compare/v0.8.2...v0.8.3
Expand Down
18 changes: 12 additions & 6 deletions druid/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {

if !self.is_initialized() {
debug_panic!(
"{:?}: paint method called before receiving WidgetAdded.",
"{:?} with widget id {:?}: paint method called before receiving WidgetAdded.",
self.inner.type_name(),
ctx.widget_id()
);
return;
Expand Down Expand Up @@ -549,7 +550,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
) -> Size {
if !self.is_initialized() {
debug_panic!(
"{:?}: layout method called before receiving WidgetAdded.",
"{:?} with widget id {:?}: layout method called before receiving WidgetAdded.",
self.inner.type_name(),
ctx.widget_id()
);
return Size::ZERO;
Expand Down Expand Up @@ -608,7 +610,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
pub fn event(&mut self, ctx: &mut EventCtx, event: &Event, data: &mut T, env: &Env) {
if !self.is_initialized() {
debug_panic!(
"{:?}: event method called before receiving WidgetAdded.",
"{:?} with widget id {:?}: event method called before receiving WidgetAdded.",
self.inner.type_name(),
ctx.widget_id()
);
return;
Expand All @@ -617,8 +620,9 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
// log if we seem not to be laid out when we should be
if self.state.is_expecting_set_origin_call && !event.should_propagate_to_hidden() {
warn!(
"{:?} received an event ({:?}) without having been laid out. \
"{:?} with widget id {:?} received an event ({:?}) without having been laid out. \
This likely indicates a missed call to set_origin.",
self.inner.type_name(),
ctx.widget_id(),
event,
);
Expand Down Expand Up @@ -1015,7 +1019,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
}
_ if !self.is_initialized() => {
debug_panic!(
"{:?}: received LifeCycle::{:?} before WidgetAdded.",
"{:?} with widget id {:?}: received LifeCycle::{:?} before WidgetAdded.",
self.inner.type_name(),
self.id(),
event
);
Expand Down Expand Up @@ -1149,7 +1154,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
(Some(_), None) => self.env = Some(env.clone()),
(None, _) => {
debug_panic!(
"{:?} is receiving an update without having first received WidgetAdded.",
"{:?} with widget id {:?} is receiving an update without having first received WidgetAdded.",
self.inner.type_name(),
self.id()
);
return;
Expand Down