chore(examples): icon API update
This commit is contained in:
parent
9dbc1be269
commit
0eba498708
5 changed files with 12 additions and 19 deletions
|
|
@ -72,6 +72,7 @@ impl cosmic::Application for App {
|
||||||
/// Message type specific to our [`App`].
|
/// Message type specific to our [`App`].
|
||||||
type Message = Message;
|
type Message = Message;
|
||||||
|
|
||||||
|
/// The unique application ID to supply to the window manager.
|
||||||
const APP_ID: &'static str = "org.cosmic.AppDemo";
|
const APP_ID: &'static str = "org.cosmic.AppDemo";
|
||||||
|
|
||||||
fn core(&self) -> &Core {
|
fn core(&self) -> &Core {
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ impl Window {
|
||||||
self.nav_bar
|
self.nav_bar
|
||||||
.insert()
|
.insert()
|
||||||
.text(page.title())
|
.text(page.title())
|
||||||
.icon(icon::handle::from_name(page.icon_name()).icon())
|
.icon(icon::from_name(page.icon_name()).icon())
|
||||||
.secondary(&mut self.nav_id_to_page, page)
|
.secondary(&mut self.nav_id_to_page, page)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,7 +248,7 @@ impl Window {
|
||||||
) -> Element<Message> {
|
) -> Element<Message> {
|
||||||
let page = sub_page.parent_page();
|
let page = sub_page.parent_page();
|
||||||
column!(
|
column!(
|
||||||
button::icon(icon::handle::from_name("go-previous-symbolic").size(16))
|
button::icon(icon::from_name("go-previous-symbolic").size(16))
|
||||||
.label(page.title())
|
.label(page.title())
|
||||||
.padding(0)
|
.padding(0)
|
||||||
.on_press(Message::from(page)),
|
.on_press(Message::from(page)),
|
||||||
|
|
@ -273,10 +273,7 @@ impl Window {
|
||||||
iced::widget::Button::new(
|
iced::widget::Button::new(
|
||||||
container(
|
container(
|
||||||
settings::item_row(vec![
|
settings::item_row(vec![
|
||||||
icon::handle::from_name(sub_page.icon_name())
|
icon::from_name(sub_page.icon_name()).size(20).icon().into(),
|
||||||
.size(20)
|
|
||||||
.icon()
|
|
||||||
.into(),
|
|
||||||
column!(
|
column!(
|
||||||
text(sub_page.title()).size(14),
|
text(sub_page.title()).size(14),
|
||||||
text(sub_page.description()).size(10),
|
text(sub_page.description()).size(10),
|
||||||
|
|
@ -284,10 +281,7 @@ impl Window {
|
||||||
.spacing(2)
|
.spacing(2)
|
||||||
.into(),
|
.into(),
|
||||||
horizontal_space(iced::Length::Fill).into(),
|
horizontal_space(iced::Length::Fill).into(),
|
||||||
icon::handle::from_name("go-next-symbolic")
|
icon::from_name("go-next-symbolic").size(20).icon().into(),
|
||||||
.size(20)
|
|
||||||
.icon()
|
|
||||||
.into(),
|
|
||||||
])
|
])
|
||||||
.spacing(16),
|
.spacing(16),
|
||||||
)
|
)
|
||||||
|
|
@ -295,7 +289,7 @@ impl Window {
|
||||||
.style(theme::Container::custom(list::column::style)),
|
.style(theme::Container::custom(list::column::style)),
|
||||||
)
|
)
|
||||||
.padding(0)
|
.padding(0)
|
||||||
.style(theme::IcedButton::Transparent)
|
.style(theme::iced::Button::Transparent)
|
||||||
.on_press(Message::from(sub_page.into_page()))
|
.on_press(Message::from(sub_page.into_page()))
|
||||||
// .id(BTN.clone())
|
// .id(BTN.clone())
|
||||||
.into()
|
.into()
|
||||||
|
|
@ -427,7 +421,7 @@ impl Application for Window {
|
||||||
.destructive(Rgb::new(0.890, 0.145, 0.420))
|
.destructive(Rgb::new(0.890, 0.145, 0.420))
|
||||||
.build(),
|
.build(),
|
||||||
)),
|
)),
|
||||||
demo::ThemeVariant::System => cosmic::theme::theme(),
|
demo::ThemeVariant::System => cosmic::theme::system_preference(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Some(demo::Output::ToggleWarning) => self.toggle_warning(),
|
Some(demo::Output::ToggleWarning) => self.toggle_warning(),
|
||||||
|
|
|
||||||
|
|
@ -257,9 +257,7 @@ impl State {
|
||||||
))
|
))
|
||||||
.add(settings::item_row(vec![
|
.add(settings::item_row(vec![
|
||||||
cosmic::widget::button::destructive("Do not Touch")
|
cosmic::widget::button::destructive("Do not Touch")
|
||||||
.trailing_icon(
|
.trailing_icon(icon::from_name("dialog-warning-symbolic").size(16))
|
||||||
icon::handle::from_name("dialog-warning-symbolic").size(16),
|
|
||||||
)
|
|
||||||
.on_press(Message::ToggleWarning)
|
.on_press(Message::ToggleWarning)
|
||||||
.into(),
|
.into(),
|
||||||
]))
|
]))
|
||||||
|
|
@ -422,10 +420,10 @@ impl State {
|
||||||
"Primary container with some text and a couple icons testing default fallbacks"
|
"Primary container with some text and a couple icons testing default fallbacks"
|
||||||
)
|
)
|
||||||
.size(24),
|
.size(24),
|
||||||
icon::handle::from_name("microphone-sensitivity-high-symbolic-test")
|
icon::from_name("microphone-sensitivity-high-symbolic-test")
|
||||||
.size(24)
|
.size(24)
|
||||||
.icon(),
|
.icon(),
|
||||||
icon::handle::from_name("microphone-sensitivity-high-symbolic-test")
|
icon::from_name("microphone-sensitivity-high-symbolic-test")
|
||||||
.size(24)
|
.size(24)
|
||||||
.fallback(false)
|
.fallback(false)
|
||||||
.icon(),
|
.icon(),
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ impl State {
|
||||||
.on_close(Message::Close)
|
.on_close(Message::Close)
|
||||||
.width(Length::Shrink);
|
.width(Length::Shrink);
|
||||||
|
|
||||||
let new_tab_button = icon::handle::from_name("tab-new-symbolic")
|
let new_tab_button = icon::from_name("tab-new-symbolic")
|
||||||
.size(20)
|
.size(20)
|
||||||
.apply(button::icon)
|
.apply(button::icon)
|
||||||
.on_press(Message::AddNew);
|
.on_press(Message::AddNew);
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ impl State {
|
||||||
window.parent_page_button(SystemAndAccountsPage::About),
|
window.parent_page_button(SystemAndAccountsPage::About),
|
||||||
row!(
|
row!(
|
||||||
horizontal_space(Length::Fill),
|
horizontal_space(Length::Fill),
|
||||||
icon::handle::from_name("distributor-logo").size(78).icon(),
|
icon::from_name("distributor-logo").size(78).icon(),
|
||||||
horizontal_space(Length::Fill),
|
horizontal_space(Length::Fill),
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue