Skip to content
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions druid/src/widget/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ impl<T: Data> Container<T> {
self.background = Some(brush.into());
}

/// Removes background.
pub fn remove_background(&mut self) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm used to the 'set/clear' and 'add/remove' verbs used in pairs. This would be set/remove, so would the right verb rather be 'clear_background'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Made the change.

self.background = None;
}

/// Builder-style method for painting a border around the widget with a color and width.
///
/// Arguments can be either concrete values, or a [`Key`] of the respective
Expand Down Expand Up @@ -106,6 +111,11 @@ impl<T: Data> Container<T> {
});
}

/// Removes border.
pub fn remove_border(&mut self) {
self.border = None;
}

/// Builder style method for rounding off corners of this container by setting a corner radius
pub fn rounded(mut self, radius: impl Into<KeyOrValue<f64>>) -> Self {
self.set_rounded(radius);
Expand Down