mirror of
https://github.com/project-gauntlet/gauntlet.git
synced 2025-12-23 10:35:53 +00:00
Hide action panel and settings download info popups when clicking on backdrop
This commit is contained in:
parent
fc476dfe50
commit
74922b01ca
2 changed files with 18 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ use anyhow::anyhow;
|
|||
use iced::{Alignment, Font, Length};
|
||||
use iced::alignment::Horizontal;
|
||||
use iced::font::Weight;
|
||||
use iced::widget::{button, checkbox, column, container, horizontal_rule, horizontal_space, image, pick_list, row, scrollable, Space, text, text_input, tooltip, vertical_rule};
|
||||
use iced::widget::{button, checkbox, column, container, horizontal_rule, horizontal_space, image, pick_list, row, scrollable, Space, text, text_input, tooltip, vertical_rule, mouse_area};
|
||||
use iced::widget::image::Handle;
|
||||
use iced::widget::tooltip::Position;
|
||||
use iced_aw::{floating_element, GridRow};
|
||||
|
|
@ -1333,6 +1333,14 @@ fn render_root<'a>(
|
|||
let content: Element<_> = column(vec![top_panel, top_separator, content, bottom_panel])
|
||||
.into();
|
||||
|
||||
let content = if hide_action_panel {
|
||||
content
|
||||
} else {
|
||||
mouse_area(content)
|
||||
.on_press(ComponentWidgetEvent::ToggleActionPanel { widget_id })
|
||||
.into()
|
||||
};
|
||||
|
||||
floating_element(content, action_panel_element)
|
||||
.offset(Offset::from([8.0, 40.0])) // TODO calculate based on theme
|
||||
.hide(hide_action_panel)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::time::Duration;
|
|||
|
||||
use iced::{Alignment, alignment, Application, color, Command, executor, font, futures, Length, Padding, Settings, Size, Subscription, time, window};
|
||||
use iced::advanced::Widget;
|
||||
use iced::widget::{button, column, container, horizontal_rule, horizontal_space, row, scrollable, text};
|
||||
use iced::widget::{button, column, container, horizontal_rule, horizontal_space, mouse_area, row, scrollable, text};
|
||||
use iced_aw::{floating_element, Spinner};
|
||||
use iced_aw::core::icons;
|
||||
use iced_aw::floating_element::{Anchor, Offset};
|
||||
|
|
@ -736,6 +736,14 @@ impl Application for ManagementAppModel {
|
|||
.into()
|
||||
};
|
||||
|
||||
let content = if !self.download_info_shown {
|
||||
content
|
||||
} else {
|
||||
mouse_area(content)
|
||||
.on_press(ManagementAppMsg::ToggleDownloadInfo)
|
||||
.into()
|
||||
};
|
||||
|
||||
floating_element(content, download_info_panel)
|
||||
.offset(Offset::from([8.0, 60.0]))
|
||||
.anchor(Anchor::NorthEast)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue