feat!(widget): rewrite button & icon widget APIs

This commit is contained in:
Michael Aaron Murphy 2023-09-01 07:29:19 +02:00 committed by Michael Murphy
parent 18debe546d
commit 4e4eeaac12
60 changed files with 2191 additions and 1113 deletions

View file

@ -7,6 +7,7 @@ use apply::Apply;
use cosmic::app::{Command, Core, Settings};
use cosmic::dialog::file_chooser::{self, FileFilter};
use cosmic::iced_core::Length;
use cosmic::widget::button;
use cosmic::{executor, iced, ApplicationExt, Element};
use tokio::io::AsyncReadExt;
use url::Url;
@ -82,10 +83,7 @@ impl cosmic::Application for App {
fn header_end(&self) -> Vec<Element<Self::Message>> {
// Places a button the header to create open dialogs.
vec![cosmic::widget::button(cosmic::theme::Button::Primary)
.text("Open")
.on_press(Message::OpenFile)
.into()]
vec![button::suggested("Open").on_press(Message::OpenFile).into()]
}
fn subscription(&self) -> cosmic::iced_futures::Subscription<Self::Message> {