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"]
|
||||
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::{
|
||||
button, cosmic_container, header_bar, nav_bar, nav_bar_toggle,
|
||||
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,
|
||||
};
|
||||
|
|
@ -127,6 +127,7 @@ pub struct Window {
|
|||
rectangle_tracker: Option<RectangleTracker<u32>>,
|
||||
pub selection: segmented_button::SingleSelectModel,
|
||||
timeline: Timeline,
|
||||
input_value: String,
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
@ -183,12 +184,12 @@ pub enum Message {
|
|||
Drag,
|
||||
Minimize,
|
||||
Maximize,
|
||||
InputChanged,
|
||||
Rectangle(RectangleUpdate<u32>),
|
||||
NavBar(segmented_button::Entity),
|
||||
Ignore,
|
||||
Selection(segmented_button::Entity),
|
||||
Tick(Instant),
|
||||
InputChanged(String),
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
@ -305,7 +306,6 @@ impl Application for Window {
|
|||
Message::Minimize => return set_mode_window(window::Id(0), window::Mode::Hidden),
|
||||
Message::Maximize => return toggle_maximize(window::Id(0)),
|
||||
Message::RowSelected(row) => println!("Selected row {row}"),
|
||||
Message::InputChanged => {}
|
||||
Message::Rectangle(r) => match r {
|
||||
RectangleUpdate::Rectangle(_) => {}
|
||||
RectangleUpdate::Init(t) => {
|
||||
|
|
@ -315,6 +315,9 @@ impl Application for Window {
|
|||
Message::Ignore => {}
|
||||
Message::Selection(key) => self.selection.activate(key),
|
||||
Message::Tick(now) => self.timeline.now(now),
|
||||
Message::InputChanged(v) => {
|
||||
self.input_value = v;
|
||||
}
|
||||
}
|
||||
|
||||
Command::none()
|
||||
|
|
@ -476,6 +479,34 @@ impl Application for Window {
|
|||
.padding(16)
|
||||
.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();
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ pub use warning::*;
|
|||
|
||||
pub mod 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.
|
||||
pub mod divider {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue