Compare commits

..

No commits in common. "2a64ff2a963915b1ddb28c75e915cf49289b50b6" and "d2059e3d1dc0cfd513295425e19b2d2d18d8e8dd" have entirely different histories.

4 changed files with 18 additions and 60 deletions

View file

@ -54,7 +54,7 @@ export default ({
onClose(child); onClose(child);
} }
}]], }]],
child: child || Box(), child: child,
}), }),
}), }),
}); });
@ -62,8 +62,7 @@ export default ({
// Make getting the original child passed in // Make getting the original child passed in
// this function easier when making more code // this function easier when making more code
// for the widget // for the widget
window.getChild = () => window.child.children[0].child; window.getChild = () => child;
window.setChild = newChild => window.child.children[0].child = newChild;
// This is for my custom pointers.js // This is for my custom pointers.js
window.closeOnUnfocus = closeOnUnfocus; window.closeOnUnfocus = closeOnUnfocus;

View file

@ -1,4 +1,4 @@
import { Box, CenterBox, Label, ToggleButton } from 'resource:///com/github/Aylur/ags/widget.js'; import { Box, CenterBox } from 'resource:///com/github/Aylur/ags/widget.js';
import Separator from '../misc/separator.js'; import Separator from '../misc/separator.js';
import Key from './keys.js'; import Key from './keys.js';
@ -10,7 +10,7 @@ const keyboardJson = oskLayouts[keyboardLayout];
const L_KEY_PER_ROW = [8, 7, 6, 6, 6, 4]; const L_KEY_PER_ROW = [8, 7, 6, 6, 6, 4];
export default window => CenterBox({ export default () => CenterBox({
class_name: 'osk', class_name: 'osk',
hexpand: true, hexpand: true,
start_widget: Box({ start_widget: Box({
@ -33,25 +33,6 @@ export default window => CenterBox({
center_widget: Box({ center_widget: Box({
hpack: 'center', hpack: 'center',
vpack: 'center',
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'),
}),
],
}),
],
}), }),
end_widget: Box({ end_widget: Box({

View file

@ -10,24 +10,20 @@ execAsync('ydotoold').catch(print);
function releaseAllKeys() { function releaseAllKeys() {
const keycodes = Array.from(Array(249).keys()); const keycodes = Array.from(Array(249).keys());
execAsync([ execAsync(['ydotool', 'key', ...keycodes.map(keycode => `${keycode}:0`)])
'ydotool', 'key', .then(console.log('Released all keys'))
...keycodes.map(keycode => `${keycode}:0`), .catch(print);
]).catch(print);
} }
// Window // Window
export default () => { export default () => Gesture(PopupWindow({
const window = PopupWindow({
name: 'osk', name: 'osk',
exclusivity: 'exclusive',
anchor: ['left', 'bottom', 'right'], anchor: ['left', 'bottom', 'right'],
onClose: releaseAllKeys, onClose: releaseAllKeys,
closeOnUnfocus: 'none', closeOnUnfocus: 'none',
connections: [[Tablet, self => { connections: [[Tablet, self => {
self.visible = Tablet.oskState; self.visible = Tablet.oskState;
}, 'osk-toggled']], }, 'osk-toggled']],
}); child: Keyboard(),
window.setChild(Keyboard(window)); }));
return Gesture(window);
};

View file

@ -1,24 +1,6 @@
.osk { .osk {
margin-left: 4px; margin-left: 4px;
.settings {
background-color: $bg;
border: 0.08rem solid $darkbg;
border-radius: 0.7rem;
padding: 0.6rem;
.button {
background-color: $bgfull;
border: 0.08rem solid $darkbg;
border-radius: 0.7rem;
padding: 0.5rem;
&.toggled {
background-color: $contrast-bg;
}
}
}
.side { .side {
.key { .key {
&:active label { &:active label {