diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2026-03-27 11:08:29 +0100 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2026-03-27 11:08:29 +0100 |
| commit | 6935709c150bf166e25ef24ee570b4a8a5b6e1b5 (patch) | |
| tree | 490d99640582853bcef68065cfe87fc32ec1b9db /src/main.rs | |
| parent | ci: update zig and cargo-zigbuild versions (diff) | |
| download | iced-builder-6935709c150bf166e25ef24ee570b4a8a5b6e1b5.tar.gz | |
chore: necessary updates for iced-rs/iced@6690731
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/src/main.rs b/src/main.rs index 427104a..9e2e72b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,15 +25,14 @@ use iced::system::theme_changes; use iced::theme::{self, Base}; use iced::time::Duration; use iced::widget::{ - checkbox, column, container, pane_grid, pick_list, row, text, text_editor, + checkbox, column, container, pane_grid, pick_list, row, text_editor, }; use iced::{ - Alignment, Length, Subscription, Task, border, clipboard, keyboard, window, + Alignment, Length, Subscription, Task, clipboard, keyboard, window, }; use iced_anim::transition::Easing; use iced_anim::{Animated, Animation}; use iced_material::Theme; -use iced_material::utils::{disabled_container, disabled_text}; use panes::{code_view, designer_view, element_list}; use types::{ Action, ConfigChangeType, DesignerPane, Element, Message, Panes, Project, @@ -244,7 +243,7 @@ impl IcedBuilder { }); } Message::CopyCode => { - return clipboard::write(self.editor_content.text()); + return clipboard::write(self.editor_content.text()).discard(); } Message::SwitchPane(pane) => self.designer_page = pane, Message::EditorAction(action) => { @@ -546,31 +545,20 @@ impl IcedBuilder { fn view(&self) -> Element<'_, Message> { let header = row![ if self.use_system_theme { - Element::from( - container(text(self.config.selected_theme().to_string())) - .padding([5, 10]) - .width(Length::Fill) - .style(|theme: &Theme| { - let color = theme.colors().surface.text; - container::Style { - background: Some( - disabled_container(color).into(), - ), - text_color: Some(disabled_text(color)), - border: border::rounded(4), - ..Default::default() - } - }), + pick_list( + Some(self.theme.target()), + self.config.themes(), + Theme::to_string, ) + .width(Length::Fill) } else { - Element::from( - pick_list( - self.config.themes(), - Some(self.theme.target()), - |theme| Message::SwitchTheme(theme.into()), - ) - .width(Length::Fill), + pick_list( + Some(self.theme.target()), + self.config.themes(), + Theme::to_string, ) + .on_select(|theme| Message::SwitchTheme(theme.into())) + .width(Length::Fill) }, checkbox(self.use_system_theme) .label("Use system theme") |
