Improve default padding of Button widget
This commit is contained in:
parent
00e7035622
commit
1b96868e48
1 changed files with 9 additions and 1 deletions
|
|
@ -63,6 +63,14 @@ impl<'a, Message, Theme, Renderer> Button<'a, Message, Theme, Renderer>
|
|||
where
|
||||
Renderer: crate::core::Renderer,
|
||||
{
|
||||
/// The default [`Padding`] of a [`Button`].
|
||||
pub const DEFAULT_PADDING: Padding = Padding {
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
right: 10.0,
|
||||
left: 10.0,
|
||||
};
|
||||
|
||||
/// Creates a new [`Button`] with the given content.
|
||||
pub fn new(
|
||||
content: impl Into<Element<'a, Message, Theme, Renderer>>,
|
||||
|
|
@ -78,7 +86,7 @@ where
|
|||
on_press: None,
|
||||
width: size.width.fluid(),
|
||||
height: size.height.fluid(),
|
||||
padding: Padding::new(5.0),
|
||||
padding: Self::DEFAULT_PADDING,
|
||||
clip: false,
|
||||
style: Theme::default_style(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue