summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2022-08-17 06:34:10 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2022-08-17 06:34:10 +0200
commitee73fda85b7b329fce19c23a5eab4a00bad1e560 (patch)
tree668dff49bb885c9f570fc4c7884f0519a5ddf407
parenta005c4047b96298700fb68412e9ab512f7ef6034 (diff)
downloadvtcol-ee73fda85b7b329fce19c23a5eab4a00bad1e560.tar.gz
edit: scale color box width to window size
-rw-r--r--src/edit.rs16
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 {