Merge branch 'retrozinndev:ryo' into ryo
This commit is contained in:
@@ -45,8 +45,14 @@ export function PopupWindow(props: PopupWindowProps): Widget.Window {
|
||||
css: props.cssBackgroundWindow,
|
||||
}) : undefined;
|
||||
|
||||
const winProps: Widget.WindowProps = {};
|
||||
for(const key of Object.keys(props).filter(k => k !== "onClickedOutside")) {
|
||||
// @ts-ignore ignore the `onClickedOutside()` method because astal thinks it's a signal
|
||||
winProps[key as keyof typeof winProps] = props[key as keyof typeof props];
|
||||
}
|
||||
|
||||
return new Widget.Window({
|
||||
...props,
|
||||
...winProps,
|
||||
namespace: props?.namespace ?? "popup-window",
|
||||
className: `popup-window ${(props.namespace instanceof Binding ?
|
||||
props.namespace.get() : props.namespace) || ""}`,
|
||||
|
||||
@@ -80,12 +80,12 @@ export const BluetoothPage: (() => Page) = () => new Page({
|
||||
visible: bind(AstalBluetooth.get_default(), "devices").as((devs) =>
|
||||
devs.filter(dev => dev.paired || dev.connected).length > 0),
|
||||
children: bind(AstalBluetooth.get_default(), "devices").as((devs) => {
|
||||
const connectedDevices = devs.filter((dev) => dev.connected || dev.paired)
|
||||
const connectedDevices = devs.filter((dev) => (dev.connected || dev.paired) && dev.trusted)
|
||||
|
||||
return [
|
||||
new Widget.Label({
|
||||
className: "sub-header",
|
||||
label: tr("control_center.pages.bluetooth.paired_devices"),
|
||||
label: tr("devices"),
|
||||
xalign: 0,
|
||||
} as Widget.LabelProps),
|
||||
...connectedDevices.map((dev) => DeviceWidget(dev))
|
||||
@@ -99,7 +99,7 @@ export const BluetoothPage: (() => Page) = () => new Page({
|
||||
visible: bind(AstalBluetooth.get_default(), "devices").as((devs) =>
|
||||
devs.filter((dev) => !dev.connected && !dev.paired).length > 0),
|
||||
children: bind(AstalBluetooth.get_default(), "devices").as((devices) => {
|
||||
const discoveredDevices = devices.filter((dev) => !dev.connected && !dev.paired);
|
||||
const discoveredDevices = devices.filter((dev) => !dev.connected && !dev.paired && !dev.trusted);
|
||||
|
||||
return [
|
||||
new Widget.Label({
|
||||
@@ -172,7 +172,7 @@ function DeviceWidget(dev: AstalBluetooth.Device): Gtk.Widget {
|
||||
body: `Couldn't connect to ${dev.alias ?? dev.name}, an error occurred: ${err.message || err.stack}`,
|
||||
urgency: AstalNotifd.Urgency.NORMAL
|
||||
})
|
||||
});
|
||||
}).then(() => dev.set_trusted(true));
|
||||
|
||||
if(!skipConnection)
|
||||
(async () => dev.connect_device(null))().catch((err: Gio.IOErrorEnum) =>
|
||||
|
||||
Reference in New Issue
Block a user