feat(ags osk): move exclusive toggle to thingy

This commit is contained in:
matt1432 2023-11-28 16:29:17 -05:00
parent a82c8617c1
commit 4a892528ff
2 changed files with 34 additions and 36 deletions

View file

@ -23,9 +23,34 @@ export default (window) => Box({
background-color: ${COLOR}; background-color: ${COLOR};
`), `),
center_widget: Box({ center_widget: CenterBox({
class_name: 'thingy', class_name: 'thingy',
css: `background: ${COLOR};`, css: `background: ${COLOR};`,
center_widget: Box({
hpack: 'center',
class_name: 'settings',
children: [
ToggleButton({
cursor: 'pointer',
class_name: 'button',
active: true,
vpack: 'center',
connections: [['toggled', (self) => {
self.toggleClassName(
'toggled',
self.get_active(),
);
window.exclusivity = self.get_active() ?
'exclusive' :
'normal';
}]],
child: Label('Exclusive'),
}),
],
}),
}), }),
end_widget: RoundedCorner('bottomleft', ` end_widget: RoundedCorner('bottomleft', `
@ -70,30 +95,6 @@ export default (window) => Box({
vpack: 'center', vpack: 'center',
children: [ children: [
Box({
class_name: 'settings',
children: [
ToggleButton({
cursor: 'pointer',
class_name: 'button',
active: true,
vpack: 'center',
connections: [['toggled', (self) => {
self.toggleClassName(
'toggled',
self.get_active(),
);
window.exclusivity = self.get_active() ?
'exclusive' :
'normal';
}]],
child: Label('Exclusive'),
}),
],
}),
], ],
}), }),

View file

@ -2,29 +2,26 @@
border-radius: 2rem 2rem 0 0; border-radius: 2rem 2rem 0 0;
min-height: 2.7rem; min-height: 2.7rem;
min-width: 20rem; min-width: 20rem;
}
.osk {
padding-top: 4px;
border-radius: 10px 10px 0;
.settings { .settings {
background-color: $bg; padding: 0.5rem;
border: 0.08rem solid $darkbg;
border-radius: 0.7rem;
padding: 0.6rem;
.button { .button {
background-color: $bgfull; background-color: $bgfull;
border: 0.08rem solid $darkbg; border: 0.1rem solid $darkbg;
border-radius: 0.7rem; border-radius: 0.7rem;
padding: 0.5rem; padding: 0.3rem;
&.toggled { &.toggled {
background-color: $contrast-bg; background-color: $contrast-bg;
} }
} }
} }
}
.osk {
padding-top: 4px;
border-radius: 10px 10px 0;
.side { .side {
.key { .key {