Ver código fonte

wallet: small changes:

- remove debug code in editbox which shows the keyboard
- start chat lines from the bottom, not the top
darkfi 1 ano atrás
pai
commit
abf78bea1f

+ 2 - 0
bin/darkwallet/src/app/mod.rs

@@ -203,6 +203,8 @@ impl App {
         //if let Err(err) = self.darkirc_backend.start(self.sg.clone(), self.ex.clone()).await {
         //    error!(target: "app", "backend error: {err}");
         //}
+
+        debug!(target: "app", "App started");
     }
 
     pub fn stop(&self) {

+ 5 - 2
bin/darkwallet/src/ui/chatview/mod.rs

@@ -785,8 +785,11 @@ impl ChatView {
         let scroll = self.scroll.get();
 
         let total_height = msgbuf.calc_total_height().await;
-        // If lines aren't enough to fill the available buffer then start from the top
-        let start_pos = if total_height < rect.h { total_height } else { rect.h };
+
+        // Use this to start from the top
+        //let start_pos = if total_height < rect.h { total_height } else { rect.h };
+        // We start from the bottom though
+        let start_pos = rect.h;
 
         let mut instrs = vec![];
         //let mut old_drawmesh = vec![];

+ 0 - 3
bin/darkwallet/src/ui/editbox.rs

@@ -195,9 +195,6 @@ impl EditBox {
 
         drop(scene_graph);
 
-        // testing
-        window::show_keyboard(true);
-
         // Must do this whenever the text changes
         let glyphs = text_shaper.shape(text.get(), font_size.get()).await;
 

+ 5 - 5
bin/darkwallet/src/ui/win.rs

@@ -106,12 +106,12 @@ impl Window {
     }
 
     pub async fn draw(&self, sg: &SceneGraph) {
-        debug!(target: "ui::win", "Window::draw()");
-        // SceneGraph should remain locked for the entire draw
-        let self_node = sg.get_node(self.node_id).unwrap();
-
         let screen_width = self.screen_size_prop.get_f32(0).unwrap();
         let screen_height = self.screen_size_prop.get_f32(1).unwrap();
+        debug!(target: "ui::win", "Window::draw({screen_width}, {screen_height})");
+
+        // SceneGraph should remain locked for the entire draw
+        let self_node = sg.get_node(self.node_id).unwrap();
 
         let parent_rect = Rectangle::from_array([0., 0., screen_width, screen_height]);
 
@@ -122,7 +122,7 @@ impl Window {
 
         for child_inf in self_node.get_children2() {
             let node = sg.get_node(child_inf.id).unwrap();
-            debug!(target: "ui::win", "Window::draw() calling draw() for node '{}':{}", node.name, node.id);
+            //debug!(target: "ui::win", "Window::draw() calling draw() for node '{}':{}", node.name, node.id);
 
             let dcs = match &node.pimpl {
                 Pimpl::RenderLayer(layer) => layer.draw(sg, &parent_rect).await,