refactor(ags): separate tablet toggle from bar.js

This commit is contained in:
matt1432 2023-09-04 22:34:33 -04:00
parent ac869537e7
commit a47507b171
2 changed files with 21 additions and 17 deletions

View file

@ -1,10 +1,11 @@
const { Window, CenterBox, Box } = ags.Widget;
import { Separator, EventBox } from '../common.js';
import { CurrentWindow } from './current-window.js';
import { Workspaces } from './workspaces.js';
import { OskToggle } from './osk-toggle.js'
import { Heart } from './heart.js'
import { Separator } from '../common.js';
import { CurrentWindow } from './current-window.js';
import { Workspaces } from './workspaces.js';
import { OskToggle } from './osk-toggle.js';
import { Heart } from './heart.js';
import { TabletToggle } from './tablet-toggle.js';
export const Bar = Window({
name: 'left-bar',
@ -29,18 +30,7 @@ export const Bar = Window({
Separator(12),
EventBox({
className: 'toggle-off',
onPrimaryClickRelease: '',
child: ags.Widget.Box({
className: 'tablet-toggle',
vertical: false,
child: ags.Widget.Label({
label: " 󰦧 ",
}),
}),
}),
TabletToggle,
Separator(12),
@ -59,6 +49,7 @@ export const Bar = Window({
// Right
Box({
halign: 'end',
children: [],
}),
],
}),

View file

@ -0,0 +1,13 @@
import { EventBox } from '../common.js';
export const TabletToggle = EventBox({
className: 'toggle-off',
onPrimaryClickRelease: '',
child: ags.Widget.Box({
className: 'tablet-toggle',
vertical: false,
child: ags.Widget.Label({
label: " 󰦧 ",
}),
}),
});