Skip to content

Commit d877aac

Browse files
committed
bump electron version, bunch of new stuff
1 parent fc236d4 commit d877aac

22 files changed

+428
-235
lines changed

app.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"defaultThemePath":"C:\\Users\\bruno\\Documents\\GitHub\\capellix-lcd\\themes\\now_playing\\theme.js","fps":25,"renderAtStartup":false,"startMinimised":false,"startAtLogin":false,"showWarningAlert":true}
1+
{"defaultThemePath":"C:\\Users\\bruno\\Documents\\GitHub\\capellix-lcd\\themes\\notzxt_2\\theme.js","fps":25,"renderAtStartup":false,"startMinimised":false,"startAtLogin":false,"showWarningAlert":true}
Lines changed: 1 addition & 0 deletions
Loading

assets/styles/renderer.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ html {
44
overflow: hidden;
55
}
66

7+
option {
8+
background-color: #080d14;
9+
}
10+
711
.btn {
812
margin: 4px;
913
}

assets/styles/styles.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,33 @@ body {
1818
background-color: #080d1400;
1919
}
2020

21+
:not(input):not(textarea),
22+
:not(input):not(textarea)::after,
23+
:not(input):not(textarea)::before {
24+
-webkit-user-select: none;
25+
user-select: none;
26+
cursor: default;
27+
}
28+
input,
29+
button,
30+
textarea,
31+
:focus {
32+
outline: none;
33+
}
34+
35+
a:not([draggable="true"]),
36+
img:not([draggable="true"]) {
37+
-webkit-user-drag: none;
38+
user-drag: none;
39+
}
40+
a[href^="http://"],
41+
a[href^="https://"],
42+
a[href^="ftp://"]
43+
{
44+
-webkit-user-drag: auto;
45+
user-drag: auto;
46+
}
47+
2148
#topbar {
2249
background-color: #060a0f3f;
2350
backdrop-filter: blur(50px);
@@ -53,6 +80,9 @@ body {
5380
display: flex;
5481
flex-direction: row;
5582
-webkit-app-region: no-drag;
83+
justify-content: center;
84+
justify-items: center;
85+
align-items: center;
5686
}
5787

5888
#minimisewindowimage {
@@ -76,6 +106,21 @@ body {
76106
transition: filter ease-in-out 0.2s;
77107
}
78108

109+
#killAppImage {
110+
width: 2rem;
111+
color: rgb(13, 71, 158);
112+
filter: invert(31%) sepia(98%) saturate(2837%) hue-rotate(207deg)
113+
brightness(99%) contrast(100%);
114+
padding: 0.05rem;
115+
margin-left: 7px;
116+
transition: filter ease-in-out 0.2s;
117+
}
118+
119+
#killAppImage:hover {
120+
filter: invert(57%) sepia(83%) saturate(1878%) hue-rotate(194deg)
121+
brightness(108%) contrast(99%);
122+
}
123+
79124
#closewindowimage:hover {
80125
filter: invert(57%) sepia(83%) saturate(1878%) hue-rotate(194deg)
81126
brightness(108%) contrast(99%);

assets/ui/device.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</a>
2323
<div id="spacerTitle">
2424

25+
</div>
26+
<a id="closeapp" onclick="window.electronAPI.closeApp()">
27+
<img src="../images/arrow-right-from-bracket-solid.svg" id="killAppImage"/>
28+
</a>
29+
<div id="spacerTitle">
30+
2531
</div>
2632
<a id="closewindow" onclick="window.electronAPI.closeWindow()">
2733
<img src="../images/closewindow.svg" id="closewindowimage"/>

assets/ui/renderer.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
</a>
2424
<div id="spacerTitle">
2525

26+
</div>
27+
<a id="closeapp" onclick="window.electronAPI.closeApp()">
28+
<img src="../images/arrow-right-from-bracket-solid.svg" id="killAppImage"/>
29+
</a>
30+
<div id="spacerTitle">
31+
2632
</div>
2733
<a id="closewindow" onclick="window.electronAPI.closeWindow()">
2834
<img src="../images/closewindow.svg" id="closewindowimage"/>

assets/ui/settings.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</a>
2323
<div id="spacerTitle">
2424

25+
</div>
26+
<a id="closeapp" onclick="window.electronAPI.closeApp()">
27+
<img src="../images/arrow-right-from-bracket-solid.svg" id="killAppImage"/>
28+
</a>
29+
<div id="spacerTitle">
30+
2531
</div>
2632
<a id="closewindow" onclick="window.electronAPI.closeWindow()">
2733
<img src="../images/closewindow.svg" id="closewindowimage"/>

assets/ui/themes.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</a>
2323
<div id="spacerTitle">
2424

25+
</div>
26+
<a id="closeapp" onclick="window.electronAPI.closeApp()">
27+
<img src="../images/arrow-right-from-bracket-solid.svg" id="killAppImage"/>
28+
</a>
29+
<div id="spacerTitle">
30+
2531
</div>
2632
<a id="closewindow" onclick="window.electronAPI.closeWindow()">
2733
<img src="../images/closewindow.svg" id="closewindowimage"/>

devices-src/capellix/src/constants.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
pub mod constants {
22
pub const VENDOR_ID: u16 = 0x1b1c;
33
pub const PRODUCT_ID: u16 = 0x0c39;
4-
pub const HID_INTERFACE: u8 = 0x0;
5-
pub const OUT_ENDPOINT: u8 = 0x09;
6-
pub const TIMEOUT: std::time::Duration = std::time::Duration::from_millis(5);
4+
// pub const HID_INTERFACE: u8 = 0x0;
5+
// pub const OUT_ENDPOINT: u8 = 0x09;
6+
// pub const TIMEOUT: std::time::Duration = std::time::Duration::from_millis(5);
77
pub const CONTROL_REQUEST: u8 = 0x03;
88
pub const DEVICE_STAT: u8 = 0x1d;
9-
pub const BEGIN_ACCEPTING: u16 = 0x0001;
9+
// pub const BEGIN_ACCEPTING: u16 = 0x0001;
1010
pub const DEVICE_ALIVE: u8 = 0x19;
1111
pub const SET_INTERFACE: u8 = 0x0b;
12+
pub const IMG_TX: u8 = 0x02;
1213
}

devices-src/capellix/src/lib.rs

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,41 @@ fn main(mut cx: ModuleContext) -> NeonResult<()> {
4040
fn open_device(mut cx: FunctionContext) -> JsResult<JsString> {
4141
let hidt = HID.lock().unwrap();
4242
let hid = hidt.get(0).unwrap();
43-
hid.send_feature_report(&[0x03, 0x1d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00])
44-
.expect("Failed to say hello!");
45-
hid.send_feature_report(&[0x03, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
46-
.expect("Failed to issue request 0x19!");
47-
hid.send_feature_report(&[0x03, 0x20, 0x00, 0x19, 0x79, 0xe7, 0x32, 0x2e])
43+
hid.send_feature_report(&[
44+
CONTROL_REQUEST,
45+
DEVICE_STAT,
46+
0x01,
47+
0x00,
48+
0x00,
49+
0x00,
50+
0x00,
51+
0x00,
52+
])
53+
.expect("Failed to say hello!");
54+
hid.send_feature_report(&[
55+
CONTROL_REQUEST,
56+
DEVICE_ALIVE,
57+
0x00,
58+
0x00,
59+
0x00,
60+
0x00,
61+
0x00,
62+
0x00,
63+
])
64+
.expect("Failed to issue request 0x19!");
65+
hid.send_feature_report(&[CONTROL_REQUEST, 0x20, 0x00, 0x19, 0x79, 0xe7, 0x32, 0x2e])
4866
.expect("Failed to issue request 0x20!");
49-
hid.send_feature_report(&[0x03, 0x0b, 0x40, 0x01, 0x79, 0xe7, 0x32, 0x2e])
50-
.expect("Failed to set interface!");
67+
hid.send_feature_report(&[
68+
CONTROL_REQUEST,
69+
SET_INTERFACE,
70+
0x40,
71+
0x01,
72+
0x79,
73+
0xe7,
74+
0x32,
75+
0x2e,
76+
])
77+
.expect("Failed to set interface!");
5178
std::thread::sleep(std::time::Duration::from_millis(5));
5279
Ok(cx.string("s"))
5380
}
@@ -56,7 +83,7 @@ fn close_device(mut cx: FunctionContext) -> JsResult<JsString> {
5683
std::thread::sleep(std::time::Duration::from_millis(5));
5784
let hidt = HID.lock().unwrap();
5885
let hid = hidt.get(0).unwrap();
59-
hid.send_feature_report(&[0x03, 0x1e, 0x40, 0x01, 0x43, 0x00, 0x69, 0x00])
86+
hid.send_feature_report(&[CONTROL_REQUEST, 0x1e, 0x40, 0x01, 0x43, 0x00, 0x69, 0x00])
6087
.expect("Failed to close LCD!");
6188
Ok(cx.string("s"))
6289
}
@@ -112,7 +139,7 @@ pub fn send_image(
112139
chunktrans = chunklen >> eight & 0xff;
113140
chunkand = chunklen & 0xff;
114141
let imgtemp = [
115-
0x02,
142+
IMG_TX,
116143
0x05,
117144
0x40,
118145
signature,
@@ -143,8 +170,8 @@ pub fn send_image(
143170
let chunktrans_temp = chunklen >> 8 & 0xff;
144171
let chunkand_temp = chunklen & 0xff;
145172
let mut unfuck_packet = [
146-
0x03,
147-
0x19,
173+
CONTROL_REQUEST,
174+
DEVICE_ALIVE,
148175
0x40,
149176
signature,
150177
packets_sent,

0 commit comments

Comments
 (0)