Files
custum-hyprpanel/widget/settings/pages/config/index.ts
Rubin Bhandari 0bdaf461f6 feat: show battery on bluetooth device list (#352)
* feat: show battery on bluetooth device list

* feat: show battery on bluetooth device list

* fix: handle case when battery is not defined

* fix: handle case when battery is not defined

* feat: add bluetooth menu

* feat: add bluetooth menu

* fix: separate icon and percentage

* fix: group battery stuffs

* Update options.ts

* Update modules/menus/bluetooth/devices/devicelist.ts

* Update modules/menus/bluetooth/devices/devicelist.ts

* Update modules/menus/bluetooth/devices/devicelist.ts

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
2024-10-29 20:59:45 -07:00

79 lines
2.6 KiB
TypeScript

import { BarGeneral } from './general/index';
import { BarSettings } from './bar/index';
import { ClockMenuSettings } from './menus/clock';
import { DashboardMenuSettings } from './menus/dashboard';
import { NotificationSettings } from './notifications/index';
import { OSDSettings } from './osd/index';
import { CustomModuleSettings } from 'customModules/config';
import { PowerMenuSettings } from './menus/power';
import { GBox } from 'lib/types/widget';
import { BluetoothMenuSettings } from './menus/bluetooth';
import { VolumeMenuSettings } from './menus/volume';
type Page =
| 'General'
| 'Bar'
| 'Clock Menu'
| 'Dashboard Menu'
| 'Power Menu'
| 'Bluetooth Menu'
| 'Volume'
| 'Notifications'
| 'OSD'
| 'Custom Modules';
const CurrentPage = Variable<Page>('General');
const pagerMap: Page[] = [
'General',
'Bar',
'Notifications',
'OSD',
'Power Menu',
'Bluetooth Menu',
'Volume',
'Clock Menu',
'Dashboard Menu',
'Custom Modules',
];
export const SettingsMenu = (): GBox => {
return Widget.Box({
vertical: true,
children: CurrentPage.bind('value').as((v) => {
return [
Widget.Box({
class_name: 'option-pages-container',
hpack: 'center',
hexpand: true,
children: pagerMap.map((page) => {
return Widget.Button({
hpack: 'center',
class_name: `pager-button ${v === page ? 'active' : ''}`,
label: page,
on_primary_click: () => (CurrentPage.value = page),
});
}),
}),
Widget.Stack({
vexpand: true,
class_name: 'themes-menu-stack',
children: {
General: BarGeneral(),
Bar: BarSettings(),
Notifications: NotificationSettings(),
OSD: OSDSettings(),
Volume: VolumeMenuSettings(),
'Clock Menu': ClockMenuSettings(),
'Dashboard Menu': DashboardMenuSettings(),
'Custom Modules': CustomModuleSettings(),
'Bluetooth Menu': BluetoothMenuSettings(),
'Power Menu': PowerMenuSettings(),
},
shown: CurrentPage.bind('value'),
}),
];
}),
});
};