Răsfoiți Sursa

wallet: fix 2 small chatview bugs, first is a typo from last commit, second is actually check is_select_mode when its modified after long hold

darkfi 1 an în urmă
părinte
comite
0ada742edb
2 a modificat fișierele cu 10 adăugiri și 2 ștergeri
  1. 6 0
      bin/darkwallet/src/main.rs
  2. 4 2
      bin/darkwallet/src/ui/chatview/mod.rs

+ 6 - 0
bin/darkwallet/src/main.rs

@@ -16,10 +16,16 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+// channel wait until deadline
 #![feature(deadline_api)]
+// Adds remainder() fn for String::split() result
 #![feature(str_split_whitespace_remainder)]
+// instant.elapsed().as_millis_f32()
 #![feature(duration_millis_float)]
+// Allow attributes on statements and code blocks
 #![feature(stmt_expr_attributes)]
+// if let Some(is_foo) = is_foo && is_foo { ... }
+#![feature(let_chains)]
 
 // Use these to incrementally fix warnings with cargo fix
 //#![allow(warnings, unused)]

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

@@ -646,7 +646,9 @@ impl ChatView {
                 }
 
                 // We are in selection mode so don't scroll the screen until touch phase ends.
-                if let Some(is_select_mode) = is_select_mode {
+                if let Some(is_select_mode) = is_select_mode &&
+                    is_select_mode
+                {
                     self.select_line(touch_y).await;
                     return
                 }
@@ -936,7 +938,7 @@ impl ChatView {
         // 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.y + rect.h;
+        let start_pos = rect.h;
 
         let mut instrs = vec![];
         //let mut old_drawmesh = vec![];