mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-16 05:26:20 +00:00
feat: update system
This commit is contained in:
@@ -10,56 +10,39 @@ export const OnScreenIndicator = ({ height = 300, width = 48 } = {}) =>
|
||||
css: "padding: 1px;",
|
||||
child: Widget.Revealer({
|
||||
transition: "slide_left",
|
||||
connections: [
|
||||
[
|
||||
Indicator,
|
||||
(revealer, value) => {
|
||||
revealer.reveal_child = value > -1;
|
||||
},
|
||||
],
|
||||
],
|
||||
setup: (self) =>
|
||||
self.hook(Indicator, (_, value) => {
|
||||
self.reveal_child = value > -1;
|
||||
}),
|
||||
child: Progress({
|
||||
width,
|
||||
height,
|
||||
vertical: true,
|
||||
connections: [
|
||||
[Indicator, (progress, value) => progress.setValue(value)],
|
||||
],
|
||||
setup: (self) =>
|
||||
self.hook(Indicator, (_, value) => self.attribute(value)),
|
||||
child: Widget.Stack({
|
||||
vpack: "start",
|
||||
hpack: "center",
|
||||
hexpand: false,
|
||||
items: [
|
||||
[
|
||||
"true",
|
||||
Widget.Icon({
|
||||
hpack: "center",
|
||||
size: width,
|
||||
connections: [
|
||||
[Indicator, (icon, _v, name) => (icon.icon = name || "")],
|
||||
],
|
||||
}),
|
||||
],
|
||||
[
|
||||
"false",
|
||||
FontIcon({
|
||||
hpack: "center",
|
||||
hexpand: true,
|
||||
css: `font-size: ${width}px;`,
|
||||
connections: [
|
||||
[Indicator, (icon, _v, name) => (icon.icon = name || "")],
|
||||
],
|
||||
}),
|
||||
],
|
||||
],
|
||||
connections: [
|
||||
[
|
||||
Indicator,
|
||||
(stack, _v, name) => {
|
||||
stack.shown = `${!!Utils.lookUpIcon(name)}`;
|
||||
},
|
||||
],
|
||||
],
|
||||
children: {
|
||||
true: Widget.Icon({
|
||||
hpack: "center",
|
||||
size: width,
|
||||
setup: (w) =>
|
||||
w.hook(Indicator, (_, _v, name) => (w.icon = name || "")),
|
||||
}),
|
||||
false: FontIcon({
|
||||
hpack: "center",
|
||||
hexpand: true,
|
||||
css: `font-size: ${width}px;`,
|
||||
setup: (w) =>
|
||||
w.hook(Indicator, (_, _v, name) => (w.label = name || "")),
|
||||
}),
|
||||
},
|
||||
setup: (self) =>
|
||||
self.hook(Indicator, (_, _v, name) => {
|
||||
self.shown = `${!!Utils.lookUpIcon(name)}`;
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user