diff --git a/src/components/menus/dashboard/shortcuts/buttons/RecordingButton.tsx b/src/components/menus/dashboard/shortcuts/buttons/RecordingButton.tsx index 5682d57bc..5b085e7f3 100644 --- a/src/components/menus/dashboard/shortcuts/buttons/RecordingButton.tsx +++ b/src/components/menus/dashboard/shortcuts/buttons/RecordingButton.tsx @@ -2,12 +2,12 @@ import { bind, Variable } from 'astal'; import { App, Gdk, Gtk } from 'astal/gtk3'; import Menu from 'src/components/shared/Menu'; import MenuItem from 'src/components/shared/MenuItem'; -import { isRecording, getRecordingPath, executeCommand } from '../helpers'; +import { getRecordingPath, executeCommand } from '../helpers'; import AstalHyprland from 'gi://AstalHyprland?version=0.1'; const hyprlandService = AstalHyprland.get_default(); -const MonitorListDropdown = (): JSX.Element => { +export const MonitorListDropdown = (): JSX.Element => { const monitorList: Variable = Variable([]); const monitorBinding = Variable.derive([bind(hyprlandService, 'monitors')], () => { @@ -55,33 +55,3 @@ const MonitorListDropdown = (): JSX.Element => { ); }; - -export const RecordingButton = (): JSX.Element => { - return ( - - ); -}; diff --git a/src/components/menus/dashboard/shortcuts/buttons/SettingsButton.tsx b/src/components/menus/dashboard/shortcuts/buttons/SettingsButton.tsx deleted file mode 100644 index c74d4e12f..000000000 --- a/src/components/menus/dashboard/shortcuts/buttons/SettingsButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { App, Gdk } from 'astal/gtk3'; -import { SettingsDialogLoader } from 'src/components/settings/lazyLoader'; - -export const SettingsButton = (): JSX.Element => { - return ( - - ); -}; diff --git a/src/components/menus/dashboard/shortcuts/buttons/ShortcutButtons.tsx b/src/components/menus/dashboard/shortcuts/buttons/ShortcutButtons.tsx index 36f32c739..41a301b55 100644 --- a/src/components/menus/dashboard/shortcuts/buttons/ShortcutButtons.tsx +++ b/src/components/menus/dashboard/shortcuts/buttons/ShortcutButtons.tsx @@ -1,22 +1,47 @@ -import { Widget } from 'astal/gtk3'; +import { Widget, Gtk } from 'astal/gtk3'; import { handleClick, hasCommand } from '../helpers'; import options from 'src/configuration'; -import { isPrimaryClick } from 'src/lib/events/mouse'; import { ShortcutVariable } from '../types'; +import { MonitorListDropdown } from './RecordingButton'; const { left, right } = options.menus.dashboard.shortcuts; const ShortcutButton = ({ shortcut, ...props }: ShortcutButtonProps): JSX.Element => { + const isRecordingButton = shortcut.command.get() === 'hyprpanel_record'; + return ( @@ -73,6 +98,14 @@ export const RightShortcut1 = (): JSX.Element => { return ; }; +export const RightShortcut2 = (): JSX.Element => { + if (!hasCommand(right.shortcut2)) { + return ; + } + + return ; +}; + export const RightShortcut3 = (): JSX.Element => { if (!hasCommand(right.shortcut3)) { return ; @@ -81,6 +114,14 @@ export const RightShortcut3 = (): JSX.Element => { return ; }; +export const RightShortcut4 = (): JSX.Element => { + if (!hasCommand(right.shortcut4)) { + return ; + } + + return ; +}; + interface ShortcutButtonProps extends Widget.ButtonProps { shortcut: ShortcutVariable; } diff --git a/src/components/menus/dashboard/shortcuts/sections/Section.tsx b/src/components/menus/dashboard/shortcuts/sections/Section.tsx index 10eb30ad6..4d7ecbcba 100644 --- a/src/components/menus/dashboard/shortcuts/sections/Section.tsx +++ b/src/components/menus/dashboard/shortcuts/sections/Section.tsx @@ -6,11 +6,11 @@ import { LeftShortcut3, LeftShortcut4, RightShortcut1, + RightShortcut2, RightShortcut3, + RightShortcut4, } from '../buttons/ShortcutButtons'; import { LeftColumn, RightColumn } from './Column'; -import { SettingsButton } from '../buttons/SettingsButton'; -import { RecordingButton } from '../buttons/RecordingButton'; import options from 'src/configuration'; const { left, right } = options.menus.dashboard.shortcuts; @@ -34,9 +34,15 @@ const rightBindings = [ bind(right.shortcut1.command), bind(right.shortcut1.tooltip), bind(right.shortcut1.icon), + bind(right.shortcut2.command), + bind(right.shortcut2.tooltip), + bind(right.shortcut2.icon), bind(right.shortcut3.command), bind(right.shortcut3.tooltip), bind(right.shortcut3.icon), + bind(right.shortcut4.command), + bind(right.shortcut4.tooltip), + bind(right.shortcut4.icon), bind(leftCardHidden), bind(isRecording), ]; @@ -82,11 +88,11 @@ export const RightShortcuts = (): JSX.Element => { > - + - + ); diff --git a/src/components/settings/pages/config/menus/dashboard.tsx b/src/components/settings/pages/config/menus/dashboard.tsx index a459f7ce2..ca8de79c8 100644 --- a/src/components/settings/pages/config/menus/dashboard.tsx +++ b/src/components/settings/pages/config/menus/dashboard.tsx @@ -159,6 +159,22 @@ export const DashboardMenuSettings = (): JSX.Element => { type="string" /> +