diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2022-08-17 06:34:10 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2022-08-17 06:34:10 +0200 |
commit | ee73fda85b7b329fce19c23a5eab4a00bad1e560 (patch) | |
tree | 668dff49bb885c9f570fc4c7884f0519a5ddf407 | |
parent | a005c4047b96298700fb68412e9ab512f7ef6034 (diff) | |
download | vtcol-ee73fda85b7b329fce19c23a5eab4a00bad1e560.tar.gz |
edit: scale color box width to window size
-rw-r--r-- | src/edit.rs | 16 |
1 files 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 <color> 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 <color> current-color : col; property <int> 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 { |