81 lines
1.9 KiB
Plaintext
81 lines
1.9 KiB
Plaintext
import { Switch, CheckBox, ScrollView, SpinBox } from "std-widgets.slint";
|
|
export component MainWindow inherits Window {
|
|
width: 400px;
|
|
height: 200px;
|
|
title: @tr("Mouse Jiggler");
|
|
icon: @image-url("jiggler.jpeg");
|
|
callback startjiggle;
|
|
callback stopjiggle;
|
|
callback secondcounter(string);
|
|
Switch {
|
|
width: 148px;
|
|
height: 48px;
|
|
text: "Toggle Jiggle";
|
|
checked: false;
|
|
toggled => {
|
|
if (self.checked) {
|
|
startjiggle();
|
|
picture.source = @image-url("dancing.jpeg");
|
|
} else {
|
|
stopjiggle();
|
|
picture.source = @image-url("jiggler.jpeg");
|
|
}
|
|
}
|
|
x: 20px;
|
|
y: 15px;
|
|
}
|
|
|
|
CheckBox {
|
|
text: "Zen Mode";
|
|
x: 20px;
|
|
y: 55px;
|
|
checked: true;
|
|
toggled => {
|
|
if (self.checked) {
|
|
spinbox.visible = false;
|
|
seconds.visible = false;
|
|
} else {
|
|
spinbox.visible = true;
|
|
seconds.visible = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
spinbox := SpinBox {
|
|
width: 93px;
|
|
height: 30px;
|
|
minimum: 5;
|
|
value: 5;
|
|
|
|
maximum: 10;
|
|
x: 23px;
|
|
y: 90px;
|
|
visible: false;
|
|
}
|
|
|
|
seconds := Text {
|
|
text: "Seconds between moves";
|
|
x: 125px;
|
|
y: 95px;
|
|
visible: false;
|
|
wrap: word-wrap;
|
|
}
|
|
|
|
picture := Image {
|
|
width: 85px;
|
|
height: 118px;
|
|
source: @image-url("jiggler.jpeg");
|
|
x: 300px;
|
|
y: 8px;
|
|
}
|
|
|
|
Text {
|
|
height: 50px;
|
|
width: 350px;
|
|
text: "Disabling Zen Mode will cause the actual cursor to move. This might make it difficult to stop the jiggler. So disabling Zen Mode will allow you to control the time between moves.";
|
|
x: 10px;
|
|
y: 130px;
|
|
wrap: word-wrap;
|
|
}
|
|
}
|