update: iced 0.10.0
This commit is contained in:
parent
78c1facd5b
commit
18b9be0baa
3 changed files with 40 additions and 3 deletions
|
|
@ -124,3 +124,5 @@ exclude = [
|
||||||
|
|
||||||
[patch."https://github.com/pop-os/libcosmic"]
|
[patch."https://github.com/pop-os/libcosmic"]
|
||||||
libcosmic = { path = "./", features = ["wayland", "tokio", "a11y"]}
|
libcosmic = { path = "./", features = ["wayland", "tokio", "a11y"]}
|
||||||
|
[patch."https://github.com/pop-os/cosmic-time"]
|
||||||
|
cosmic-time = { path = "../cosmic-time"}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use cosmic::{
|
||||||
widget::{
|
widget::{
|
||||||
button, cosmic_container, header_bar, nav_bar, nav_bar_toggle,
|
button, cosmic_container, header_bar, nav_bar, nav_bar_toggle,
|
||||||
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate},
|
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate},
|
||||||
scrollable, segmented_button, segmented_selection, settings, IconSource,
|
scrollable, segmented_button, segmented_selection, settings, text_input, IconSource,
|
||||||
},
|
},
|
||||||
Element, ElementExt,
|
Element, ElementExt,
|
||||||
};
|
};
|
||||||
|
|
@ -127,6 +127,7 @@ pub struct Window {
|
||||||
rectangle_tracker: Option<RectangleTracker<u32>>,
|
rectangle_tracker: Option<RectangleTracker<u32>>,
|
||||||
pub selection: segmented_button::SingleSelectModel,
|
pub selection: segmented_button::SingleSelectModel,
|
||||||
timeline: Timeline,
|
timeline: Timeline,
|
||||||
|
input_value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
|
|
@ -183,12 +184,12 @@ pub enum Message {
|
||||||
Drag,
|
Drag,
|
||||||
Minimize,
|
Minimize,
|
||||||
Maximize,
|
Maximize,
|
||||||
InputChanged,
|
|
||||||
Rectangle(RectangleUpdate<u32>),
|
Rectangle(RectangleUpdate<u32>),
|
||||||
NavBar(segmented_button::Entity),
|
NavBar(segmented_button::Entity),
|
||||||
Ignore,
|
Ignore,
|
||||||
Selection(segmented_button::Entity),
|
Selection(segmented_button::Entity),
|
||||||
Tick(Instant),
|
Tick(Instant),
|
||||||
|
InputChanged(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
|
|
@ -305,7 +306,6 @@ impl Application for Window {
|
||||||
Message::Minimize => return set_mode_window(window::Id(0), window::Mode::Hidden),
|
Message::Minimize => return set_mode_window(window::Id(0), window::Mode::Hidden),
|
||||||
Message::Maximize => return toggle_maximize(window::Id(0)),
|
Message::Maximize => return toggle_maximize(window::Id(0)),
|
||||||
Message::RowSelected(row) => println!("Selected row {row}"),
|
Message::RowSelected(row) => println!("Selected row {row}"),
|
||||||
Message::InputChanged => {}
|
|
||||||
Message::Rectangle(r) => match r {
|
Message::Rectangle(r) => match r {
|
||||||
RectangleUpdate::Rectangle(_) => {}
|
RectangleUpdate::Rectangle(_) => {}
|
||||||
RectangleUpdate::Init(t) => {
|
RectangleUpdate::Init(t) => {
|
||||||
|
|
@ -315,6 +315,9 @@ impl Application for Window {
|
||||||
Message::Ignore => {}
|
Message::Ignore => {}
|
||||||
Message::Selection(key) => self.selection.activate(key),
|
Message::Selection(key) => self.selection.activate(key),
|
||||||
Message::Tick(now) => self.timeline.now(now),
|
Message::Tick(now) => self.timeline.now(now),
|
||||||
|
Message::InputChanged(v) => {
|
||||||
|
self.input_value = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Command::none()
|
Command::none()
|
||||||
|
|
@ -476,6 +479,34 @@ impl Application for Window {
|
||||||
.padding(16)
|
.padding(16)
|
||||||
.style(cosmic::theme::Container::Secondary),
|
.style(cosmic::theme::Container::Secondary),
|
||||||
))
|
))
|
||||||
|
.add(settings::item(
|
||||||
|
"Text Input",
|
||||||
|
text_input("test", &self.input_value)
|
||||||
|
.width(Length::Fill)
|
||||||
|
.on_input(Message::InputChanged),
|
||||||
|
))
|
||||||
|
.add(settings::item(
|
||||||
|
"Text Input",
|
||||||
|
text_input("test", &self.input_value)
|
||||||
|
.label("Test Label")
|
||||||
|
.helper_text("helper_text")
|
||||||
|
.width(Length::Fill)
|
||||||
|
.on_input(Message::InputChanged),
|
||||||
|
))
|
||||||
|
// .add(settings::item(
|
||||||
|
// "Text Input",
|
||||||
|
// text_input("test", &self.input_value)
|
||||||
|
// .helper_text("helper_text")
|
||||||
|
// .width(Length::Fill)
|
||||||
|
// .on_input(Message::InputChanged),
|
||||||
|
// ))
|
||||||
|
// .add(settings::item(
|
||||||
|
// "Text Input",
|
||||||
|
// text_input("test", &self.input_value)
|
||||||
|
// .helper_text("helper_text")
|
||||||
|
// .width(Length::Fill)
|
||||||
|
// .on_input(Message::InputChanged),
|
||||||
|
// ))
|
||||||
.into(),
|
.into(),
|
||||||
])
|
])
|
||||||
.into();
|
.into();
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ pub use warning::*;
|
||||||
|
|
||||||
pub mod cosmic_container;
|
pub mod cosmic_container;
|
||||||
pub use cosmic_container::*;
|
pub use cosmic_container::*;
|
||||||
|
#[cfg(feature = "wayland")]
|
||||||
|
pub mod text_input;
|
||||||
|
#[cfg(feature = "wayland")]
|
||||||
|
pub use text_input::*;
|
||||||
|
|
||||||
/// An element to distinguish a boundary between two elements.
|
/// An element to distinguish a boundary between two elements.
|
||||||
pub mod divider {
|
pub mod divider {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue