sidebar: notifpane -> alerts
This commit is contained in:
parent
10290bc427
commit
f178c361b3
5 changed files with 7 additions and 7 deletions
|
|
@ -502,7 +502,7 @@ const PkgUpdates = ({ monitor, ...props }: ModuleProps) => (
|
||||||
|
|
||||||
const NotifCount = ({ monitor, ...props }: ModuleProps) => (
|
const NotifCount = ({ monitor, ...props }: ModuleProps) => (
|
||||||
<button
|
<button
|
||||||
onClick={(_, event) => event.button === Astal.MouseButton.PRIMARY && switchPane(monitor, "notifpane")}
|
onClick={(_, event) => event.button === Astal.MouseButton.PRIMARY && switchPane(monitor, "alerts")}
|
||||||
setup={self =>
|
setup={self =>
|
||||||
setupCustomTooltip(
|
setupCustomTooltip(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const getPaneIcon = (name: PaneName) => {
|
||||||
if (name === "audio") return "tune";
|
if (name === "audio") return "tune";
|
||||||
if (name === "connectivity") return "settings_ethernet";
|
if (name === "connectivity") return "settings_ethernet";
|
||||||
if (name === "packages") return "package_2";
|
if (name === "packages") return "package_2";
|
||||||
if (name === "notifpane") return "notifications";
|
if (name === "alerts") return "notifications";
|
||||||
return "date_range";
|
return "date_range";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export default ({ monitor }: { monitor: Monitor }) => (
|
||||||
if (notification.actions.length === 1)
|
if (notification.actions.length === 1)
|
||||||
notification.invoke(notification.actions[0].id);
|
notification.invoke(notification.actions[0].id);
|
||||||
else {
|
else {
|
||||||
sidebar?.shown.set("notifpane");
|
sidebar?.shown.set("alerts");
|
||||||
sidebar?.show();
|
sidebar?.show();
|
||||||
popup.destroyWithAnims();
|
popup.destroyWithAnims();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Notifications from "./modules/notifications";
|
import Notifications from "./modules/notifications";
|
||||||
|
|
||||||
export default () => (
|
export default () => (
|
||||||
<box vertical className="pane notifpane" name="notifpane">
|
<box vertical className="pane alerts" name="alerts">
|
||||||
<Notifications />
|
<Notifications />
|
||||||
</box>
|
</box>
|
||||||
);
|
);
|
||||||
|
|
@ -2,14 +2,14 @@ import type { Monitor } from "@/services/monitors";
|
||||||
import { bind, idle, register, Variable } from "astal";
|
import { bind, idle, register, Variable } from "astal";
|
||||||
import { App, Astal, Gdk, Gtk, Widget } from "astal/gtk3";
|
import { App, Astal, Gdk, Gtk, Widget } from "astal/gtk3";
|
||||||
import { sidebar as config } from "config";
|
import { sidebar as config } from "config";
|
||||||
|
import Alerts from "./alerts";
|
||||||
import Audio from "./audio";
|
import Audio from "./audio";
|
||||||
import Connectivity from "./connectivity";
|
import Connectivity from "./connectivity";
|
||||||
import Dashboard from "./dashboard";
|
import Dashboard from "./dashboard";
|
||||||
import NotifPane from "./notifpane";
|
|
||||||
import Packages from "./packages";
|
import Packages from "./packages";
|
||||||
import Time from "./time";
|
import Time from "./time";
|
||||||
|
|
||||||
export const paneNames = ["dashboard", "audio", "connectivity", "packages", "notifpane", "time"] as const;
|
export const paneNames = ["dashboard", "audio", "connectivity", "packages", "alerts", "time"] as const;
|
||||||
export type PaneName = (typeof paneNames)[number];
|
export type PaneName = (typeof paneNames)[number];
|
||||||
|
|
||||||
export const switchPane = (monitor: Monitor, name: PaneName) => {
|
export const switchPane = (monitor: Monitor, name: PaneName) => {
|
||||||
|
|
@ -38,7 +38,7 @@ const getPane = (name: PaneName) => {
|
||||||
if (name === "audio") return <Audio />;
|
if (name === "audio") return <Audio />;
|
||||||
if (name === "connectivity") return <Connectivity />;
|
if (name === "connectivity") return <Connectivity />;
|
||||||
if (name === "packages") return <Packages />;
|
if (name === "packages") return <Packages />;
|
||||||
if (name === "notifpane") return <NotifPane />;
|
if (name === "alerts") return <Alerts />;
|
||||||
return <Time />;
|
return <Time />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue