From ee73fda85b7b329fce19c23a5eab4a00bad1e560 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 17 Aug 2022 06:34:10 +0200 Subject: edit: scale color box width to window size --- src/edit.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/edit.rs b/src/edit.rs index a166ce4..0e89097 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -48,8 +48,8 @@ slint::slint! { for col[i] in primary : psquare := Rectangle { property current-color : col; - width : 86px; - height : 86px; + width : (squares-primary.width / 8) - 12px; + height : (squares-primary.width / 8) - 12px; border-color : ptouch.has-hover ? #eeeeee : #333333; border-width : 3px; @@ -59,8 +59,8 @@ slint::slint! { prect := Rectangle { y : 3px; x : 3px; - width : 80px; - height : 80px; + width : psquare.width - 6px; + height : psquare.height - 6px; background : current-color; VerticalBox { @@ -93,8 +93,8 @@ slint::slint! { for col[i] in secondary : ssquare := Rectangle { property current-color : col; property i2 : i + 8; - width : 86px; - height : 86px; + width : (squares-secondary.width / 8) - 12px; + height : (squares-secondary.width / 8) - 12px; border-color : stouch.has-hover ? #eeeeee : #333333; border-width : 3px; @@ -104,8 +104,8 @@ slint::slint! { srect := Rectangle { y : 3px; x : 3px; - width : 80px; - height : 80px; + width : ssquare.width - 6px; + height : ssquare.height - 6px; background : current-color; VerticalBox { -- cgit v1.2.3