mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
app/contacts: clicking between fields switches focus among editors
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
use darkfi_serial::deserialize;
|
||||
|
||||
use super::{ColorScheme, CHANNELS, COLOR_SCHEME};
|
||||
use super::{edit_switch::edit_switch, ColorScheme, CHANNELS, COLOR_SCHEME};
|
||||
use crate::{
|
||||
app::{
|
||||
node::{
|
||||
@@ -299,7 +299,7 @@ pub async fn make(
|
||||
)
|
||||
})
|
||||
.await;
|
||||
let chatedit_node = node.clone();
|
||||
let nickedit_node = node.clone();
|
||||
layer_node.link(node);
|
||||
|
||||
let node = create_singleline_edit("secret_edit");
|
||||
@@ -395,9 +395,19 @@ pub async fn make(
|
||||
)
|
||||
})
|
||||
.await;
|
||||
let chatedit_node = node.clone();
|
||||
let secedit_node = node.clone();
|
||||
layer_node.link(node);
|
||||
|
||||
{
|
||||
let mut app_tasks = app.tasks.lock().unwrap();
|
||||
edit_switch(
|
||||
&mut app_tasks,
|
||||
&[nickedit_node, secedit_node],
|
||||
app.renderer.clone(),
|
||||
app.ex.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
// Make buttons for cancel and done
|
||||
|
||||
let node = create_layer("editbtn_layer");
|
||||
|
||||
@@ -80,6 +80,7 @@ mod ui_consts {
|
||||
use ui_consts::*;
|
||||
|
||||
mod contact;
|
||||
mod edit_switch;
|
||||
|
||||
pub async fn make(app: &App, content: SceneNodePtr, i18n_fish: &I18nBabelFish) {
|
||||
let window_scale = PropertyFloat32::wrap(
|
||||
|
||||
@@ -1338,6 +1338,9 @@ impl BaseEdit {
|
||||
};
|
||||
|
||||
self_.editor.lock().focus();
|
||||
let atom = &mut self_.renderer.make_guard(gfxtag!("BaseEdit::process_focus_method"));
|
||||
self_.is_focused.set(atom, true);
|
||||
self_.redraw(atom);
|
||||
true
|
||||
}
|
||||
async fn process_unfocus_method(me: &Weak<Self>, sub: &MethodCallSub) -> bool {
|
||||
@@ -1356,6 +1359,9 @@ impl BaseEdit {
|
||||
};
|
||||
|
||||
self_.editor.lock().unfocus();
|
||||
let atom = &mut self_.renderer.make_guard(gfxtag!("BaseEdit::process_unfocus_method"));
|
||||
self_.is_focused.set(atom, false);
|
||||
self_.redraw(atom);
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user