Skip to content

Commit 0cbd879

Browse files
committed
Restore original tablet platform UI
1 parent 5f40d2b commit 0cbd879

File tree

8 files changed

+112
-82
lines changed

8 files changed

+112
-82
lines changed

package-lock.json

Lines changed: 79 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"homepage": "https://github.com/MercuryWorkshop/AnuraOS#readme",
1616
"dependencies": {
1717
"@mercuryworkshop/bare-mux": "^1.1.4",
18+
"@mercuryworkshop/wisp-js": "^0.4.0",
1819
"@titaniumnetwork-dev/ultraviolet": "3.1.5",
1920
"autoprefixer": "^10.4.21",
2021
"comlink": "^4.4.2",
@@ -30,16 +31,16 @@
3031
"typescript": "^5.9.2"
3132
},
3233
"devDependencies": {
33-
"eslint": "^9.35.0",
34-
"eslint-plugin-html": "^8.1.3",
35-
"eslint-plugin-jsdoc": "^60.5.0",
36-
"@typescript-eslint/eslint-plugin": "^8.43.0",
37-
"@typescript-eslint/parser": "^8.43.0",
3834
"@eslint/eslintrc": "^3.3.1",
3935
"@eslint/js": "^9.35.0",
4036
"@types/node": "^22.13.4",
4137
"@types/wicg-file-system-access": "^2023.10.6",
38+
"@typescript-eslint/eslint-plugin": "^8.43.0",
39+
"@typescript-eslint/parser": "^8.43.0",
4240
"dreamland": "^0.0.25",
41+
"eslint": "^9.35.0",
42+
"eslint-plugin-html": "^8.1.3",
43+
"eslint-plugin-jsdoc": "^60.5.0",
4344
"globals": "^16.3.0",
4445
"prettier": "^3.6.2",
4546
"rollup": "^4.50.1",

src/AliceWM.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
height: 12px;
2929
}
3030

31+
body.platform-tablet .aliceWMwin svg {
32+
height: 12px;
33+
}
34+
3135
.scaletransition {
3236
transition:
3337
visibility 0s,
@@ -119,7 +123,7 @@ body.platform-mobile .aliceWMwin .title {
119123
height: 21px; /* just big enough to hide behind taskbar */
120124
}
121125
body.platform-tablet .aliceWMwin .title {
122-
height: 21px; /* just big enough to hide behind taskbar */
126+
height: 40px;
123127
}
124128

125129
.aliceWMwin .titleContent {
@@ -157,6 +161,14 @@ body.platform-tablet .aliceWMwin .title {
157161
flex-shrink: 0;
158162
transition: background-color 0.2s ease-in-out;
159163
z-index: 2;
164+
165+
display: flex;
166+
align-items: center;
167+
justify-content: center;
168+
}
169+
170+
body.platform-tablet .aliceWMwin .windowButton {
171+
margin: 4px;
160172
}
161173

162174
body.platform-mobile .aliceWMwin .windowButton.maximize {

src/AliceWM.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class WMWindow extends EventTarget implements Process {
146146
style={`
147147
width: ${wininfo.width};
148148
height: ${wininfo.height};
149-
${anura.platform.type === "mobile" || anura.platform.type === "tablet" ? "top: 5px!important; left: 5px!important;" : ""}
149+
${anura.platform.type === "mobile" ? "top: 5px!important; left: 5px!important;" : ""}
150150
`}
151151
on:pointerover={() => {
152152
this.mouseover = true;
@@ -175,10 +175,7 @@ class WMWindow extends EventTarget implements Process {
175175
on:pointerdown={(evt: PointerEvent) => {
176176
deactivateFrames();
177177

178-
if (
179-
anura.platform.type !== "mobile" &&
180-
anura.platform.type !== "tablet"
181-
) {
178+
if (anura.platform.type !== "mobile") {
182179
this.dragging = true;
183180
this.originalLeft = this.element.offsetLeft;
184181
this.originalTop = this.element.offsetTop;
@@ -345,11 +342,7 @@ class WMWindow extends EventTarget implements Process {
345342
const currentResizer = resizers[i];
346343
currentResizer.addEventListener("pointerdown", (e: PointerEvent) => {
347344
e.preventDefault();
348-
if (
349-
anura.platform.type === "mobile" ||
350-
anura.platform.type === "tablet"
351-
)
352-
return;
345+
if (anura.platform.type === "mobile") return;
353346
original_width = parseFloat(
354347
getComputedStyle(this.element, null)
355348
.getPropertyValue("width")
@@ -502,7 +495,7 @@ class WMWindow extends EventTarget implements Process {
502495
if (!anura.settings.get("disable-animation"))
503496
this.element.classList.add("scaletransition");
504497

505-
if (anura.platform.type === "mobile" || anura.platform.type === "tablet") {
498+
if (anura.platform.type === "mobile") {
506499
this.maximize();
507500
}
508501

@@ -1222,7 +1215,7 @@ let AliceWM = {
12221215
const win = new WMWindow(wininfo, app);
12231216
document.body.appendChild(win.element);
12241217
win.focus();
1225-
if (anura.platform.type !== "mobile" && anura.platform.type !== "tablet") {
1218+
if (anura.platform.type !== "mobile") {
12261219
center(win.element);
12271220
}
12281221
return win;

src/Boot.tsx

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ window.addEventListener("load", async () => {
131131
LocalFS.newOPFS("/opfs"); // mount opfs on boot
132132
}
133133

134-
if (anura.platform.type === "mobile" || anura.platform.type === "tablet") {
134+
if (anura.platform.type !== "desktop") {
135135
splashToRemove = bootsplashMobile;
136136
document.body.appendChild(bootsplashMobile);
137137
} else {
@@ -573,41 +573,6 @@ document.addEventListener("anura-login-completed", async () => {
573573
launcher.state.active = true;
574574
}
575575

576-
if (anura.platform.type === "tablet") {
577-
// Adjust styles for Taskbar right
578-
const tright: HTMLDivElement =
579-
taskbar.element.querySelector("#taskbar-right")!;
580-
tright.style.backgroundColor = "black";
581-
tright.style.top = "0";
582-
tright.style.right = "0";
583-
tright.style.height = "25px";
584-
tright.style.transform = "translateY(0%)";
585-
tright.style.width = "100%";
586-
tright.style.zIndex = "1000000";
587-
588-
// Adjust styles taskinfo-container (has date and battery)
589-
const tinfocont: HTMLDivElement = tright.querySelector(
590-
"#taskinfo-container",
591-
)!;
592-
tinfocont.style.background = "black";
593-
tinfocont.style.right = "0";
594-
tinfocont.style.position = "absolute";
595-
596-
// Adjust styles for date container
597-
const tdatecon: HTMLDivElement = tright.querySelector("#date-container")!;
598-
tdatecon.style.background = "black";
599-
600-
document.body.appendChild(tright);
601-
602-
// Adjust launcher CSS
603-
launcher.element.style.left = "0";
604-
launcher.element.style.top = "25px";
605-
launcher.element.style.borderRadius = "0";
606-
const aview: HTMLDivElement = launcher.element.querySelector(".appsView")!;
607-
aview.style.gridTemplateColumns = "1fr 1fr 1fr 1fr 1fr 1fr";
608-
launcher.state.active = true;
609-
}
610-
611576
document.body.appendChild(launcher.element);
612577
document.body.appendChild(launcher.clickoffChecker);
613578
document.body.appendChild(quickSettings.quickSettingsElement);

0 commit comments

Comments
 (0)