diff options
| author | 2023-07-12 12:23:18 -0700 | |
|---|---|---|
| committer | 2023-07-12 12:23:18 -0700 | |
| commit | 633f405f3f78bc7f82d2b2061491b0e011137451 (patch) | |
| tree | 5ebfc1f45d216a5c14a90492563599e6969eab4d /examples/pane_grid/src | |
| parent | 41836dd80d0534608e7aedfbf2319c540a23de1a (diff) | |
| parent | 21bd51426d900e271206f314e0c915dd41065521 (diff) | |
| download | iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.gz iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.bz2 iced-633f405f3f78bc7f82d2b2061491b0e011137451.zip  | |
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts:
#	Cargo.toml
#	core/src/window/icon.rs
#	core/src/window/id.rs
#	core/src/window/position.rs
#	core/src/window/settings.rs
#	examples/integration/src/main.rs
#	examples/integration_opengl/src/main.rs
#	glutin/src/application.rs
#	native/src/subscription.rs
#	native/src/window.rs
#	runtime/src/window/action.rs
#	src/lib.rs
#	src/window.rs
#	winit/Cargo.toml
#	winit/src/application.rs
#	winit/src/icon.rs
#	winit/src/settings.rs
#	winit/src/window.rs
Diffstat (limited to '')
| -rw-r--r-- | examples/pane_grid/src/main.rs | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index c9f1376c..04896e20 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -1,14 +1,16 @@  use iced::alignment::{self, Alignment}; +use iced::event::{self, Event};  use iced::executor;  use iced::keyboard; +use iced::subscription;  use iced::theme::{self, Theme};  use iced::widget::pane_grid::{self, PaneGrid}; -use iced::widget::{button, column, container, row, scrollable, text}; +use iced::widget::{ +    button, column, container, responsive, row, scrollable, text, +};  use iced::{      Application, Color, Command, Element, Length, Settings, Size, Subscription,  }; -use iced_lazy::responsive; -use iced_native::{event, subscription, Event};  pub fn main() -> iced::Result {      Example::run(Settings::default()) @@ -107,7 +109,7 @@ impl Application for Example {                  pane,                  target,              }) => { -                self.panes.swap(&pane, &target); +                self.panes.drop(&pane, target);              }              Message::Dragged(_) => {}              Message::TogglePin(pane) => { @@ -253,6 +255,7 @@ fn handle_hotkey(key_code: keyboard::KeyCode) -> Option<Message> {      }  } +#[derive(Clone, Copy)]  struct Pane {      id: usize,      pub is_pinned: bool, @@ -296,7 +299,7 @@ fn view_content<'a>(          )      ]      .spacing(5) -    .max_width(150); +    .max_width(160);      if total_panes > 1 && !is_pinned {          controls = controls.push(  | 
