Skip to content

Commit 6c4ee6d

Browse files
authored
Merge pull request #1255 from squidowl/iced-update
Iced Update
2 parents 32a19ed + 981a338 commit 6c4ee6d

18 files changed

Lines changed: 129 additions & 139 deletions

Cargo.lock

Lines changed: 23 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ embed-resource = "3.0.2"
104104
windows_exe_info = "0.4"
105105

106106
[patch.crates-io]
107-
iced = { git = "https://github.com/squidowl/iced", rev = "489f3aeac407c1a69a67274a9b8daae6e5fb4a13" }
108-
iced_core = { git = "https://github.com/squidowl/iced", rev = "489f3aeac407c1a69a67274a9b8daae6e5fb4a13" }
109-
iced_wgpu = { git = "https://github.com/squidowl/iced", rev = "489f3aeac407c1a69a67274a9b8daae6e5fb4a13" }
107+
iced = { git = "https://github.com/squidowl/iced", rev = "ef5e3c9855d7e4768281423f0f845c57064710d8" }
108+
iced_core = { git = "https://github.com/squidowl/iced", rev = "ef5e3c9855d7e4768281423f0f845c57064710d8" }
109+
iced_wgpu = { git = "https://github.com/squidowl/iced", rev = "ef5e3c9855d7e4768281423f0f845c57064710d8" }
110110

111111
[profile.ci]
112112
inherits = "dev"

src/buffer/channel/topic.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use chrono::{DateTime, Local, Utc};
22
use data::user::{ChannelUsers, NickRef};
33
use data::{Config, Server, User, isupport, message, target};
4-
use iced::widget::{
5-
Scrollable, column, container, horizontal_rule, row, scrollable,
6-
};
7-
use iced::{padding, Color, Length};
4+
use iced::widget::{Scrollable, column, container, row, rule, scrollable};
5+
use iced::{Color, Length, padding};
86

97
use super::context_menu;
108
use crate::widget::{Element, double_pass, message_content, selectable_text};
@@ -140,7 +138,7 @@ pub fn view<'a>(
140138
.padding(padding()),
141139
column![container(scrollable)].width(Length::Fill),
142140
),
143-
container(horizontal_rule(1))
141+
container(rule::horizontal(1))
144142
.width(Length::Fill)
145143
.padding([0, 11])
146144
]

src/buffer/context_menu.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ use chrono::{DateTime, Local, Utc};
22
use data::dashboard::BufferAction;
33
use data::user::Nick;
44
use data::{Config, Server, User, config, ctcp, isupport, target};
5-
use iced::widget::{
6-
Space, button, column, container, horizontal_rule, row, text,
7-
};
5+
use iced::widget::{Space, button, column, container, row, rule, text};
86
use iced::{Length, Padding, padding};
97

108
use crate::widget::{Element, context_menu, double_pass};
@@ -213,9 +211,9 @@ impl Entry {
213211
),
214212
(Entry::HorizontalRule, _) => match length {
215213
Length::Fill => {
216-
container(horizontal_rule(1)).padding([0, 6]).into()
214+
container(rule::horizontal(1)).padding([0, 6]).into()
217215
}
218-
_ => Space::new(length, 1).into(),
216+
_ => Space::new().width(length).height(1).into(),
219217
},
220218
(Entry::CtcpRequestTime, Context::User { server, user, .. }) => {
221219
let message = Message::CtcpRequest(

src/buffer/input_view.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ use data::rate_limit::TokenPriority;
99
use data::target::Target;
1010
use data::user::Nick;
1111
use data::{Config, User, client, command};
12-
use iced::widget::{column, container, row, text, text_input, vertical_rule};
12+
use iced::widget::{
13+
self, column, container, operation, row, rule, text, text_input,
14+
};
1315
use iced::{Alignment, Task, padding};
1416
use tokio::time;
1517

@@ -125,7 +127,7 @@ pub fn view<'a>(
125127
});
126128

127129
let maybe_vertical_rule =
128-
maybe_our_user.is_some().then(move || vertical_rule(1.0));
130+
maybe_our_user.is_some().then(move || rule::vertical(1.0));
129131

130132
let mut content = column![
131133
container(
@@ -190,7 +192,7 @@ fn error<'a, 'b, Message: 'a>(
190192

191193
#[derive(Debug, Clone)]
192194
pub struct State {
193-
input_id: text_input::Id,
195+
input_id: widget::Id,
194196
error: Option<String>,
195197
completion: Completion,
196198
selected_history: Option<usize>,
@@ -205,7 +207,7 @@ impl Default for State {
205207
impl State {
206208
pub fn new() -> Self {
207209
Self {
208-
input_id: text_input::Id::unique(),
210+
input_id: widget::Id::unique(),
209211
error: None,
210212
completion: Completion::default(),
211213
selected_history: None,
@@ -851,17 +853,17 @@ impl State {
851853
});
852854
}
853855

854-
(text_input::move_cursor_to_end(self.input_id.clone()), None)
856+
(operation::move_cursor_to_end(self.input_id.clone()), None)
855857
}
856858

857859
pub fn focus(&self) -> Task<Message> {
858860
let input_id = self.input_id.clone();
859861

860-
text_input::is_focused(input_id.clone()).then(move |is_focused| {
862+
operation::is_focused(input_id.clone()).then(move |is_focused| {
861863
if is_focused {
862864
Task::none()
863865
} else {
864-
text_input::focus(input_id.clone())
866+
operation::focus(input_id.clone())
865867
}
866868
})
867869
}
@@ -903,7 +905,7 @@ impl State {
903905

904906
history.record_draft(RawInput { buffer, text });
905907

906-
text_input::move_cursor_to_end(self.input_id.clone())
908+
operation::move_cursor_to_end(self.input_id.clone())
907909
}
908910

909911
pub fn close_picker(&mut self) -> bool {

src/buffer/query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use data::preview::{self, Previews};
55
use data::target::{self, Target};
66
use data::user::Nick;
77
use data::{Config, Server, User, buffer, history, message};
8-
use iced::widget::{column, container, vertical_space};
8+
use iced::widget::{column, container, space};
99
use iced::{Length, Size, Task};
1010

1111
use super::message_view::{ChannelQueryLayout, TargetInfo};
@@ -94,7 +94,7 @@ pub fn view<'a>(
9494

9595
let text_input = show_text_input.then(|| {
9696
column![
97-
vertical_space().height(4),
97+
space::vertical().height(4),
9898
input_view::view(
9999
&state.input_view,
100100
input,

0 commit comments

Comments
 (0)