diff --git a/services/gam/src/status.rs b/services/gam/src/status.rs index 0a3a50d5d..6ad8ff169 100644 --- a/services/gam/src/status.rs +++ b/services/gam/src/status.rs @@ -25,7 +25,7 @@ pub fn status_thread(canvas_gid: [u32; 4]) { if debug1{info!("GAM|status: building textview objects");} // build uptime text view: left half of status bar - let mut uptime_tv = TextView::new(status_gid, 0, + let mut uptime_tv = TextView::new(status_gid, TextBounds::BoundingBox(Rectangle::new(Point::new(0,0), Point::new(screensize.x / 2, screensize.y - 1)))); uptime_tv.untrusted = false; @@ -37,7 +37,7 @@ pub fn status_thread(canvas_gid: [u32; 4]) { if debug1{info!("GAM|status: uptime initialized to '{:?}'", uptime_tv);} // build battstats text view: right half of status bar - let mut battstats_tv = TextView::new(status_gid, 0, + let mut battstats_tv = TextView::new(status_gid, TextBounds::BoundingBox(Rectangle::new(Point::new(screensize.x / 2, 0), Point::new(screensize.x, screensize.y - 1)))); battstats_tv.style = blitstr::GlyphStyle::Small; diff --git a/services/graphics-server/src/api/text.rs b/services/graphics-server/src/api/text.rs index 3002e606f..6f77e2697 100644 --- a/services/graphics-server/src/api/text.rs +++ b/services/graphics-server/src/api/text.rs @@ -54,9 +54,6 @@ pub struct TextView { pub token: Option<[u32; 4]>, // optional 128-bit token which is presented to prove a field's trustability pub invert: bool, // only trusted, token-validated TextViews will have the invert bit respected - // lower numbers are drawn last - pub draw_order: u32, - // offsets for text drawing -- exactly one of the following options should be specified // note that the TextBounds coordinate system is local to the canvas, not the screen pub bounds_hint: TextBounds, @@ -83,13 +80,12 @@ pub struct TextView { pub clip_rect: Option, // this is set by the GAM to the canvas' clip_rect; needed by gfx for drawing. Note this is in screen coordinates. } impl TextView { - pub fn new(canvas: Gid, draw_order: u32, bounds_hint: TextBounds) -> Self { + pub fn new(canvas: Gid, bounds_hint: TextBounds) -> Self { TextView { operation: TextOp::Nop, untrusted: true, token: None, invert: false, - draw_order, clip_rect: None, bounds_hint, bounds_computed: None, @@ -124,7 +120,6 @@ impl TextView { self.untrusted = t.untrusted; self.token = t.token; self.invert = t.invert; - self.draw_order = t.draw_order; self.bounds_hint = t.bounds_hint; self.bounds_computed = t.bounds_computed; self.style = t.style; diff --git a/services/ime-frontend/src/main.rs b/services/ime-frontend/src/main.rs index 259730e77..4fa00804e 100644 --- a/services/ime-frontend/src/main.rs +++ b/services/ime-frontend/src/main.rs @@ -219,7 +219,7 @@ impl InputTracker { if let Some(ic) = self.input_canvas { if debug1{info!("IMEF: updating input area");} let ic_bounds: Point = gam::get_canvas_bounds(self.gam_conn, ic).expect("IMEF: Couldn't get input canvas bounds"); - let mut input_tv = TextView::new(ic, 255, + let mut input_tv = TextView::new(ic, TextBounds::BoundingBox(Rectangle::new(Point::new(0,1), ic_bounds))); input_tv.draw_border = false; input_tv.border_width = 1; @@ -524,7 +524,7 @@ impl InputTracker { } if valid_predictions == 0 { - let mut empty_tv = TextView::new(pc, 255, + let mut empty_tv = TextView::new(pc, TextBounds::BoundingBox(Rectangle::new(Point::new(0, 1), pc_bounds))); empty_tv.draw_border = false; empty_tv.border_width = 1; @@ -554,7 +554,7 @@ impl InputTracker { DrawStyle { fill_color: None, stroke_color: Some(PixelColor::Dark), stroke_width: 1 } )).expect("IMEF: couldn't draw dividing lines in prediction area"); } - let mut p_tv = TextView::new(pc, 255, + let mut p_tv = TextView::new(pc, TextBounds::BoundingBox(p_clip)); p_tv.draw_border = false; p_tv.border_width = 1; diff --git a/services/shellchat/src/main.rs b/services/shellchat/src/main.rs index 88c96f57d..d49315962 100644 --- a/services/shellchat/src/main.rs +++ b/services/shellchat/src/main.rs @@ -153,12 +153,12 @@ impl Repl{ for h in self.history.iter().rev() { let mut bubble_tv = if h.is_input { - TextView::new(self.content, 255, + TextView::new(self.content, TextBounds::GrowableFromBr( Point::new(self.screensize.x - self.margin.x, bubble_baseline), self.bubble_width)) } else { - TextView::new(self.content, 255, + TextView::new(self.content, TextBounds::GrowableFromBl( Point::new(self.margin.x, bubble_baseline), self.bubble_width))