-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adjustable grid density and icon size (#2331)
- Cherry-pick of feat: IrisGridTheme iconSize (#2123) - Cherry-pick of feat: Adjustable grid density (#2151) - Cherry-pick of fix: Proxy model not setting defined values in parent class (#2187) - Needed for Grizzly support of `ui.table` density that's in deephaven.ui v0.23.1 --------- Co-authored-by: Matthew Runyon <matthewrunyon@deephaven.io>
- Loading branch information
1 parent
86439b3
commit d8d04fc
Showing
80 changed files
with
509 additions
and
178 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { useCallback } from 'react'; | ||
import { | ||
Item, | ||
ItemKey, | ||
Picker, | ||
ThemePicker, | ||
useTheme, | ||
} from '@deephaven/components'; | ||
import { assertNotNull } from '@deephaven/utils'; | ||
import { useDispatch } from 'react-redux'; | ||
import { getSettings, updateSettings } from '@deephaven/redux'; | ||
import { useAppSelector } from '@deephaven/dashboard'; | ||
|
||
export function ThemeSectionContent(): JSX.Element { | ||
const theme = useTheme(); | ||
const settings = useAppSelector(getSettings); | ||
const dispatch = useDispatch(); | ||
|
||
const updateDensity = useCallback( | ||
(density: ItemKey | null) => { | ||
if ( | ||
density !== 'regular' && | ||
density !== 'compact' && | ||
density !== 'spacious' | ||
) { | ||
throw new Error(`Invalid grid density value: ${density}`); | ||
} | ||
dispatch(updateSettings({ gridDensity: density })); | ||
}, | ||
[dispatch] | ||
); | ||
|
||
const density = settings.gridDensity; | ||
|
||
assertNotNull(theme, 'ThemeContext value is null'); | ||
|
||
return ( | ||
<> | ||
<ThemePicker /> | ||
<Picker | ||
label="Default table density" | ||
selectedKey={density} | ||
onChange={updateDensity} | ||
> | ||
<Item key="regular">Regular</Item> | ||
<Item key="compact">Compact</Item> | ||
<Item key="spacious">Spacious</Item> | ||
</Picker> | ||
</> | ||
); | ||
} | ||
|
||
export default ThemeSectionContent; |
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.