mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Rename Rectangle.color to Rectangle.background
Add support for built-in property aliases and rename `color` to `background` - in preparation for it also changing to type brush. Right now the alias is silent, a deprecation and overall change will come in a subsequent change.
This commit is contained in:
parent
c479fd132d
commit
1f091cb1c0
16 changed files with 250 additions and 131 deletions
|
@ -226,7 +226,7 @@ struct QtItemRenderer<'a> {
|
|||
impl ItemRenderer for QtItemRenderer<'_> {
|
||||
fn draw_rectangle(&mut self, pos: Point, rect: Pin<&items::Rectangle>) {
|
||||
let pos = qttypes::QPoint { x: pos.x as _, y: pos.y as _ };
|
||||
let color: u32 = rect.color().as_argb_encoded();
|
||||
let color: u32 = rect.background().as_argb_encoded();
|
||||
let rect: qttypes::QRectF = get_geometry!(pos, items::Rectangle, rect);
|
||||
let painter: &mut QPainter = &mut *self.painter;
|
||||
cpp! { unsafe [painter as "QPainter*", color as "QRgb", rect as "QRectF"] {
|
||||
|
@ -237,7 +237,7 @@ impl ItemRenderer for QtItemRenderer<'_> {
|
|||
fn draw_border_rectangle(&mut self, pos: Point, rect: std::pin::Pin<&items::BorderRectangle>) {
|
||||
self.draw_rectangle_impl(
|
||||
get_geometry!(pos, items::BorderRectangle, rect),
|
||||
rect.color(),
|
||||
rect.background(),
|
||||
rect.border_color(),
|
||||
rect.border_width(),
|
||||
rect.border_radius(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue