-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: renamed snapshots to tab groups
- Loading branch information
1 parent
957e804
commit 813bd56
Showing
16 changed files
with
180 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Menu, MenuGroup, MenuItem, showModal } from 'decky-frontend-lib'; | ||
import { VFC, Fragment } from 'react'; | ||
import { TabMasterManager } from '../../state/TabMasterManager'; | ||
import { CreateTabGroupModal, OverwriteTabGroupModal } from '../modals/TabGroupModals'; | ||
|
||
interface TabsGroupMenuProps { | ||
tabMasterManager: TabMasterManager, | ||
} | ||
|
||
/** | ||
* Context menu for managing Tab Groups. | ||
*/ | ||
export const TabGroupsMenu: VFC<TabsGroupMenuProps> = ({ tabMasterManager }) => { | ||
return <Menu label='Manage Tab Groups'> | ||
<TabGroupMenuItems tabMasterManager={tabMasterManager} /> | ||
</Menu>; | ||
}; | ||
|
||
/** | ||
* Context menu sub-menu for managing Tab Groups. | ||
*/ | ||
export const TabGroupsSubMenu: VFC<TabsGroupMenuProps> = ({ tabMasterManager }) => { | ||
return <MenuGroup label='Manage Tab Groups'> | ||
<TabGroupMenuItems tabMasterManager={tabMasterManager} /> | ||
</MenuGroup>; | ||
}; | ||
|
||
/** | ||
* Menu items for the Tab Group context menu. | ||
*/ | ||
const TabGroupMenuItems: VFC<TabsGroupMenuProps> = ({ tabMasterManager }) => { | ||
return ( | ||
<> | ||
<MenuItem onClick={() => showModal(<CreateTabGroupModal tabMasterManager={tabMasterManager} />)}> | ||
Create Group | ||
</MenuItem> | ||
<OverwriteTabGroupMenu tabMasterManager={tabMasterManager} /> | ||
{/* <div className={gamepadContextMenuClasses.ContextMenuSeparator} /> */} | ||
<ApplyTabGroupMenu tabMasterManager={tabMasterManager} /> | ||
</> | ||
); | ||
}; | ||
|
||
/** | ||
* The overwrite menu for Tab Groups. | ||
*/ | ||
const OverwriteTabGroupMenu: VFC<TabsGroupMenuProps> = ({ tabMasterManager }) => { | ||
return ( | ||
<MenuGroup label='Overwrite Tab Group' disabled={Object.keys(tabMasterManager.tabGroupManager?.snapshots ?? {}).length === 0}> | ||
{Object.keys(tabMasterManager.tabGroupManager?.snapshots ?? {}).map(snapshotName => { | ||
return ( | ||
<MenuItem onClick={() => showModal(<OverwriteTabGroupModal groupName={snapshotName} tabMasterManager={tabMasterManager} />)}> | ||
{snapshotName} | ||
</MenuItem> | ||
); | ||
})} | ||
</MenuGroup> | ||
); | ||
}; | ||
|
||
/** | ||
* The apply menu for Tab Groups. | ||
*/ | ||
const ApplyTabGroupMenu: VFC<TabsGroupMenuProps> = ({ tabMasterManager }) => { | ||
return ( | ||
<MenuGroup label='Apply Tab Group' disabled={Object.keys(tabMasterManager.tabGroupManager?.snapshots ?? {}).length === 0}> | ||
{Object.keys(tabMasterManager.tabGroupManager?.snapshots ?? {}).map(snapshotName => { | ||
return ( | ||
<MenuItem onClick={() => tabMasterManager.tabGroupManager?.apply(snapshotName, tabMasterManager)}> | ||
{snapshotName} | ||
</MenuItem> | ||
); | ||
})} | ||
</MenuGroup> | ||
); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.