Explorar o código

app: adjust font size

darkfi hai 1 ano
pai
achega
8e840ef89d
Modificáronse 3 ficheiros con 3 adicións e 44 borrados
  1. 2 2
      bin/app/src/app/schema/chat.rs
  2. 1 1
      bin/app/src/text2/render.rs
  3. 0 41
      bin/app/src/ui/chatedit.rs

+ 2 - 2
bin/app/src/app/schema/chat.rs

@@ -137,7 +137,7 @@ mod ui_consts {
     pub const CHATEDIT_HANDLE_DESCENT: f32 = 35.;
     pub const CHATEDIT_NEG_W: f32 = 190.;
     pub const CHATEDIT_LHS_PAD: f32 = 100.;
-    pub const TEXTBAR_BASELINE: f32 = 34.;
+    pub const TEXTBAR_BASELINE: f32 = 25.;
     pub const EMOJI_BTN_X: f32 = 38.;
     pub const EMOJI_BG_W: f32 = 80.;
     pub const EMOJI_SCALE: f32 = 20.;
@@ -715,7 +715,7 @@ pub async fn make(
     prop.clone().set_f32(atom, Role::App, 1, TEXTBAR_BASELINE / 2.).unwrap();
 
     node.set_property_f32(atom, Role::App, "baseline", TEXTBAR_BASELINE).unwrap();
-    node.set_property_f32(atom, Role::App, "font_size", FONTSIZE).unwrap();
+    node.set_property_f32(atom, Role::App, "font_size", FONTSIZE * 1.2).unwrap();
     //node.set_property_str(atom, Role::App, "text", "hello king!😁🍆jelly 🍆1234").unwrap();
     let prop = node.get_property("text_color").unwrap();
     if COLOR_SCHEME == ColorScheme::PaperLight {

+ 1 - 1
bin/app/src/text2/render.rs

@@ -91,7 +91,7 @@ fn render_glyph_run(
     let run_y = glyph_run.baseline();
     let style = glyph_run.style();
     let color = style.brush;
-    //trace!(target: "text::render", "render_glyph_run run_idx={run_idx}");
+    //trace!(target: "text::render", "render_glyph_run run_idx={run_idx} baseline={run_y}");
 
     let atlas = create_atlas(scale_ctx, glyph_run, render_api);
 

+ 0 - 41
bin/app/src/ui/chatedit.rs

@@ -400,16 +400,6 @@ impl ChatEdit {
             ),
         });
 
-        //self_
-        //    .text_wrap
-        //    .lock()
-        //    .editable
-        //    .set_text("".to_string(), "king!😁🍆jelly 🍆1234".to_string());
-        //self_.text_wrap.lock().editable.set_text(
-        //    "".to_string(),
-        //    "A berry is a small, pulpy, and often edible fruit. Typically, berries are juicy, rounded, brightly colored, sweet, sour or tart, and do not have a stone or pit, although many pips or seeds may be present. Common examples of berries in the culinary sense are strawberries, raspberries, blueberries, blackberries, white currants, blackcurrants, and redcurrants. In Britain, soft fruit is a horticultural term for such fruits. The common usage of the term berry is different from the scientific or botanical definition of a berry, which refers to a fruit produced from the ovary of a single flower where the outer layer of the ovary wall develops into an edible fleshy portion (pericarp). The botanical definition includes many fruits that are not commonly known or referred to as berries, such as grapes, tomatoes, cucumbers, eggplants, bananas, and chili peppers.".to_string()
-        //);
-
         Pimpl::ChatEdit(self_)
     }
 
@@ -981,37 +971,6 @@ impl ChatEdit {
         */
     }
 
-    /*
-    fn max_scroll(&self, text_wrap: &mut TextWrap) -> f32 {
-        let width = self.wrap_width();
-        let mut inner_height = text_wrap.wrap(width).height();
-        // Top padding
-        inner_height += self.padding.get_f32(0).unwrap();
-        // Bottom padding
-        inner_height += self.padding.get_f32(1).unwrap();
-
-        let max_height = self.max_height.get();
-        if inner_height < max_height {
-            return 0.
-        }
-
-        let max_scroll = inner_height - max_height;
-        max_scroll.clamp(0., f32::MAX)
-    }
-    */
-
-    /// When we resize the screen, the rect changes so we may need to alter the scroll.
-    /// Or if we delete text.
-    /*
-    fn clamp_scroll(&self, text_wrap: &mut TextWrap, atom: &mut PropertyAtomicGuard) {
-        let max_scroll = self.max_scroll(text_wrap);
-        let mut scroll = self.scroll.get();
-        if scroll > max_scroll {
-            self.scroll.set(atom, max_scroll);
-        }
-    }
-    */
-
     fn pause_blinking(&self) {
         self.blink_is_paused.store(true, Ordering::Relaxed);
         self.cursor_is_visible.store(true, Ordering::Relaxed);