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>
This commit is contained in:
@@ -7,6 +7,7 @@ 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 =
|
||||
@@ -15,6 +16,7 @@ type Page =
|
||||
| 'Clock Menu'
|
||||
| 'Dashboard Menu'
|
||||
| 'Power Menu'
|
||||
| 'Bluetooth Menu'
|
||||
| 'Volume'
|
||||
| 'Notifications'
|
||||
| 'OSD'
|
||||
@@ -28,6 +30,7 @@ const pagerMap: Page[] = [
|
||||
'Notifications',
|
||||
'OSD',
|
||||
'Power Menu',
|
||||
'Bluetooth Menu',
|
||||
'Volume',
|
||||
'Clock Menu',
|
||||
'Dashboard Menu',
|
||||
@@ -64,6 +67,7 @@ export const SettingsMenu = (): GBox => {
|
||||
'Clock Menu': ClockMenuSettings(),
|
||||
'Dashboard Menu': DashboardMenuSettings(),
|
||||
'Custom Modules': CustomModuleSettings(),
|
||||
'Bluetooth Menu': BluetoothMenuSettings(),
|
||||
'Power Menu': PowerMenuSettings(),
|
||||
},
|
||||
shown: CurrentPage.bind('value'),
|
||||
|
||||
29
widget/settings/pages/config/menus/bluetooth.ts
Normal file
29
widget/settings/pages/config/menus/bluetooth.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Option } from 'widget/settings/shared/Option';
|
||||
import { Header } from 'widget/settings/shared/Header';
|
||||
|
||||
import options from 'options';
|
||||
import Scrollable from 'types/widgets/scrollable';
|
||||
import { Attribute, Child } from 'lib/types/widget';
|
||||
|
||||
export const BluetoothMenuSettings = (): Scrollable<Child, Attribute> => {
|
||||
return Widget.Scrollable({
|
||||
vscroll: 'automatic',
|
||||
child: Widget.Box({
|
||||
class_name: 'bar-theme-page paged-container',
|
||||
vertical: true,
|
||||
children: [
|
||||
Header('Bluetooth'),
|
||||
Option({
|
||||
opt: options.menus.bluetooth.showBattery,
|
||||
title: 'Show Battery Percentage for Connected Devices (If Supported)',
|
||||
type: 'boolean',
|
||||
}),
|
||||
Option({
|
||||
opt: options.menus.bluetooth.batteryIcon,
|
||||
title: 'Battery Icon',
|
||||
type: 'string',
|
||||
}),
|
||||
],
|
||||
}),
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user