Migrate away from Rectangle::from_loc_and_size
Deprecated in `smithay` by https://github.com/Smithay/smithay/pull/1621.
This commit is contained in:
parent
9074447c4f
commit
b685512127
26 changed files with 184 additions and 201 deletions
|
|
@ -226,12 +226,12 @@ impl CosmicMapped {
|
|||
let win = stack.active();
|
||||
let location = stack.offset();
|
||||
let size = win.geometry().size;
|
||||
Rectangle::from_loc_and_size(location, size)
|
||||
Rectangle::new(location, size)
|
||||
}
|
||||
CosmicMappedInternal::Window(win) => {
|
||||
let location = win.offset();
|
||||
let size = win.geometry().size;
|
||||
Rectangle::from_loc_and_size(location, size)
|
||||
Rectangle::new(location, size)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
|
@ -601,9 +601,9 @@ impl CosmicMapped {
|
|||
pub fn set_debug(&self, flag: bool) {
|
||||
let mut debug = self.debug.lock().unwrap();
|
||||
if flag {
|
||||
*debug = Some(smithay_egui::EguiState::new(Rectangle::from_loc_and_size(
|
||||
(10, 10),
|
||||
(100, 100),
|
||||
*debug = Some(smithay_egui::EguiState::new(Rectangle::new(
|
||||
(10, 10).into(),
|
||||
(100, 100).into(),
|
||||
)));
|
||||
} else {
|
||||
debug.take();
|
||||
|
|
@ -662,7 +662,7 @@ impl CosmicMapped {
|
|||
window.geometry().size,
|
||||
);
|
||||
|
||||
let area = Rectangle::<i32, Logical>::from_loc_and_size(
|
||||
let area = Rectangle::<i32, Logical>::new(
|
||||
location.to_f64().to_logical(scale).to_i32_round(),
|
||||
self.bbox().size,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ impl CosmicStack {
|
|||
let loc = (geo.loc.x, geo.loc.y + TAB_HEIGHT);
|
||||
let size = (geo.size.w, geo.size.h - TAB_HEIGHT);
|
||||
|
||||
let win_geo = Rectangle::from_loc_and_size(loc, size);
|
||||
let win_geo = Rectangle::new(loc.into(), size.into());
|
||||
for window in p.windows.lock().unwrap().iter() {
|
||||
window.set_geometry(win_geo, TAB_HEIGHT as u32);
|
||||
}
|
||||
|
|
@ -1045,9 +1045,9 @@ impl Program for CosmicStackInternal {
|
|||
theme: &Theme,
|
||||
) {
|
||||
if self.group_focused.load(Ordering::SeqCst) {
|
||||
let border = Rectangle::from_loc_and_size(
|
||||
(0, ((TAB_HEIGHT as f32 * scale) - scale).floor() as i32),
|
||||
(pixels.width() as i32, scale.ceil() as i32),
|
||||
let border = Rectangle::new(
|
||||
(0, ((TAB_HEIGHT as f32 * scale) - scale).floor() as i32).into(),
|
||||
(pixels.width() as i32, scale.ceil() as i32).into(),
|
||||
);
|
||||
|
||||
let mut paint = tiny_skia::Paint::default();
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ impl CosmicWindow {
|
|||
let loc = (geo.loc.x, geo.loc.y + ssd_height);
|
||||
let size = (geo.size.w, std::cmp::max(geo.size.h - ssd_height, 0));
|
||||
p.window
|
||||
.set_geometry(Rectangle::from_loc_and_size(loc, size), ssd_height as u32);
|
||||
.set_geometry(Rectangle::new(loc.into(), size.into()), ssd_height as u32);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue