Add basic methods into NavigatedPage
This commit is contained in:
+19
-18
@@ -49,23 +49,7 @@ impl NavigatedPage<SyncMessage> for SyncState {
|
||||
}
|
||||
|
||||
fn navigated(&mut self) {}
|
||||
}
|
||||
|
||||
impl SyncState {
|
||||
pub fn new(state: Arc<Mutex<AppState>>) -> SyncState {
|
||||
let auto_fetch;
|
||||
{
|
||||
auto_fetch = state.lock().unwrap().sync_data.auto_web_fetch;
|
||||
}
|
||||
Self {
|
||||
auto_fetch,
|
||||
state,
|
||||
frozen: false,
|
||||
progress: 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(&mut self, message: SyncMessage) -> Task<RootMessage> {
|
||||
fn update(&mut self, message: SyncMessage) -> Task<RootMessage> {
|
||||
match message {
|
||||
Back => {}
|
||||
CopyKey => {
|
||||
@@ -158,7 +142,7 @@ impl SyncState {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, SyncMessage> {
|
||||
fn view(&self) -> Element<'_, SyncMessage> {
|
||||
back_overlay(
|
||||
row![space().width(Fill), self.sync_column(), space().width(Fill)]
|
||||
.spacing(DEFAULT_SPACING)
|
||||
@@ -167,6 +151,23 @@ impl SyncState {
|
||||
Back,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl SyncState {
|
||||
pub fn new(state: Arc<Mutex<AppState>>) -> SyncState {
|
||||
let auto_fetch;
|
||||
{
|
||||
auto_fetch = state.lock().unwrap().sync_data.auto_web_fetch;
|
||||
}
|
||||
Self {
|
||||
auto_fetch,
|
||||
state,
|
||||
frozen: false,
|
||||
progress: 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn sync_column(&self) -> Element<'_, SyncMessage> {
|
||||
let network_view: Element<'_, SyncMessage> = if self.frozen {
|
||||
|
||||
Reference in New Issue
Block a user