Przeglądaj źródła

wallet: small tweaks:

* add missing setup command for android builds to README
* tweak cursor idle time
* remove condvar is_started var from App itself.
darkfi 1 rok temu
rodzic
commit
44c2ec28ba

+ 3 - 0
bin/darkwallet/README.md

@@ -9,6 +9,9 @@ make
 Make sure you have podman installed. Then run:
 
 ```
+# You only need to build the container once
+podman build -t apk .
+
 make android
 ```
 

+ 1 - 4
bin/darkwallet/src/app/mod.rs

@@ -79,7 +79,7 @@ impl AsyncRuntime {
                 .run();
         });
         *self.exec_threadpool.lock().unwrap() = Some(exec_threadpool);
-        debug!(target: "async_runtime", "Started runtime");
+        info!(target: "async_runtime", "Started runtime [{n_threads} threads]");
     }
 
     pub fn push_task(&self, task: Task<()>) {
@@ -118,7 +118,6 @@ pub type AppPtr = Arc<App>;
 
 pub struct App {
     pub sg_root: SceneNodePtr,
-    pub is_started: Arc<CondVar>,
     pub render_api: RenderApiPtr,
     pub event_pub: GraphicsEventPublisherPtr,
     pub text_shaper: TextShaperPtr,
@@ -137,7 +136,6 @@ impl App {
     ) -> Arc<Self> {
         Arc::new(Self {
             sg_root,
-            is_started: Arc::new(CondVar::new()),
             ex,
             render_api,
             event_pub,
@@ -177,7 +175,6 @@ impl App {
         self.trigger_draw().await;
 
         debug!(target: "app", "App started");
-        self.is_started.notify();
     }
 
     pub fn stop(&self) {

+ 1 - 1
bin/darkwallet/src/app/node.rs

@@ -210,7 +210,7 @@ pub fn create_editbox(name: &str) -> SceneNode {
     node.add_property(prop).unwrap();
 
     let mut prop = Property::new("cursor_idle_time", PropertyType::Uint32, PropertySubType::Null);
-    prop.set_defaults_u32(vec![1000]).unwrap();
+    prop.set_defaults_u32(vec![150]).unwrap();
     prop.set_range_u32(0, u32::MAX);
     node.add_property(prop).unwrap();
 

+ 8 - 2
bin/darkwallet/src/main.rs

@@ -38,6 +38,7 @@
 //#![deny(unused_imports)]
 
 use async_lock::{Mutex as AsyncMutex, RwLock as AsyncRwLock};
+use darkfi::system::CondVar;
 use file_rotate::{compression::Compression, suffix::AppendCount, ContentLimit, FileRotate};
 use std::sync::{mpsc, Arc};
 
@@ -126,12 +127,17 @@ fn main() {
 
     let text_shaper = TextShaper::new();
 
+    let cv_started = Arc::new(CondVar::new());
+    let cv_started2 = cv_started.clone();
     let app = app::App::new(sg_root, render_api, event_pub.clone(), text_shaper, ex.clone());
-    let app_task = ex.spawn(app.clone().start());
+    let app2 = app.clone();
+    let app_task = ex.spawn(async move {
+        app2.start().await;
+        cv_started2.notify();
+    });
     async_runtime.push_task(app_task);
 
     let app2 = app.clone();
-    let cv_started = app.is_started.clone();
     let sg_root = app.sg_root.clone();
     let ex2 = ex.clone();
     let darkirc_task = ex.spawn(async move {