Hey, I am new to iced.rs, and I was working the example code in the repo. When I run this code, the left padding disappears. If I remove the top padding, the left padding comes back. Is it possible to give both left and top padding in iced.rs?
use iced::widget::{button, column, text, Column, container, row};
use iced::Padding;
use iced::padding::{top, right, left, bottom};
#[derive(Debug, Clone, Copy)]
pub enum Message {
Increment,
Decrement,
}
#[derive(Default)]
struct App {
value: i32,
items: Vec<String>,
}
impl App {
pub fn view(&self) -> Column<Message> {
// We use a column: a simple vertical layout
let mut col = column!(
// The increment button. We tell it to produce an
// `Increment` message when pressed
button("+").on_press(Message::Increment),
// We show the value of the counter here
text(self.value).size(50),
// The decrement button. We tell it to produce a
// `Decrement` message when pressed
button("-").on_press(Message::Decrement),
);
for item in &self.items {
let row = row![
text(item),
]
.padding(left(20))
.padding(right(10));
col = col.push(row);
}
col
}
pub fn update(&mut self, message: Message) {
match message {
Message::Increment => {
self.value += 1;
}
Message::Decrement => {
self.value -= 1;
}
}
self.items.push(self.value.to_string());
}
}
fn main() -> iced::Result {
iced::run("A cool counter", App::update, App::view)
}