From a47507b1712c19981ddba19b723534b46b488d14 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Sep 2023 22:34:33 -0400 Subject: [PATCH] refactor(ags): separate tablet toggle from bar.js --- config/ags/js/bar/bar.js | 25 ++++++++----------------- config/ags/js/bar/tablet-toggle.js | 13 +++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 config/ags/js/bar/tablet-toggle.js diff --git a/config/ags/js/bar/bar.js b/config/ags/js/bar/bar.js index 04491b98..3971b5f0 100644 --- a/config/ags/js/bar/bar.js +++ b/config/ags/js/bar/bar.js @@ -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: [], }), ], }), diff --git a/config/ags/js/bar/tablet-toggle.js b/config/ags/js/bar/tablet-toggle.js new file mode 100644 index 00000000..65463253 --- /dev/null +++ b/config/ags/js/bar/tablet-toggle.js @@ -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: " 󰦧 ", + }), + }), +});