refactor: move fixed_window to ui
This is a ui module Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -10,7 +10,6 @@ mod app_style;
|
|||||||
mod colors;
|
mod colors;
|
||||||
mod draft;
|
mod draft;
|
||||||
mod filter;
|
mod filter;
|
||||||
mod fixed_window;
|
|
||||||
mod fonts;
|
mod fonts;
|
||||||
mod frame_history;
|
mod frame_history;
|
||||||
mod images;
|
mod images;
|
||||||
|
|||||||
@@ -3,11 +3,7 @@ use std::{cell::RefCell, rc::Rc};
|
|||||||
use egui::Sense;
|
use egui::Sense;
|
||||||
use egui_nav::{Nav, NavAction};
|
use egui_nav::{Nav, NavAction};
|
||||||
|
|
||||||
use crate::{
|
use crate::{route::Route, ui, Damus};
|
||||||
fixed_window::{FixedWindow, FixedWindowResponse},
|
|
||||||
route::Route,
|
|
||||||
Damus,
|
|
||||||
};
|
|
||||||
|
|
||||||
static MARGIN: f32 = 200.0;
|
static MARGIN: f32 = 200.0;
|
||||||
|
|
||||||
@@ -25,7 +21,7 @@ impl DesktopGlobalPopup {
|
|||||||
|
|
||||||
let app_ctx = Rc::new(RefCell::new(app));
|
let app_ctx = Rc::new(RefCell::new(app));
|
||||||
|
|
||||||
let resp = FixedWindow::maybe_with_title(title).show(ui, rect, |ui| {
|
let resp = ui::FixedWindow::maybe_with_title(title).show(ui, rect, |ui| {
|
||||||
let nav_response =
|
let nav_response =
|
||||||
Nav::new(routes)
|
Nav::new(routes)
|
||||||
.title(false)
|
.title(false)
|
||||||
@@ -49,7 +45,7 @@ impl DesktopGlobalPopup {
|
|||||||
|
|
||||||
let mut app = app_ctx.borrow_mut();
|
let mut app = app_ctx.borrow_mut();
|
||||||
|
|
||||||
if resp == FixedWindowResponse::Closed {
|
if resp == ui::FixedWindowResponse::Closed {
|
||||||
app.global_nav.pop();
|
app.global_nav.pop();
|
||||||
app.show_global_popup = false;
|
app.show_global_popup = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ pub mod account_login_view;
|
|||||||
pub mod account_management;
|
pub mod account_management;
|
||||||
pub mod account_switcher;
|
pub mod account_switcher;
|
||||||
pub mod anim;
|
pub mod anim;
|
||||||
|
pub mod fixed_window;
|
||||||
pub mod global_popup;
|
pub mod global_popup;
|
||||||
pub mod mention;
|
pub mod mention;
|
||||||
pub mod note;
|
pub mod note;
|
||||||
@@ -13,6 +14,7 @@ pub mod username;
|
|||||||
|
|
||||||
pub use account_management::AccountManagementView;
|
pub use account_management::AccountManagementView;
|
||||||
pub use account_switcher::AccountSelectionWidget;
|
pub use account_switcher::AccountSelectionWidget;
|
||||||
|
pub use fixed_window::{FixedWindow, FixedWindowResponse};
|
||||||
pub use global_popup::DesktopGlobalPopup;
|
pub use global_popup::DesktopGlobalPopup;
|
||||||
pub use mention::Mention;
|
pub use mention::Mention;
|
||||||
pub use note::{BarAction, Note, NoteResponse, PostView};
|
pub use note::{BarAction, Note, NoteResponse, PostView};
|
||||||
|
|||||||
Reference in New Issue
Block a user