mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
chore(react/collections): add spacer for calendar touch bar
This commit is contained in:
@@ -27,6 +27,10 @@ interface ButtonProps {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
interface SpacerProps {
|
||||
size: "flexible" | "large" | "small";
|
||||
}
|
||||
|
||||
interface SegmentedControlProps {
|
||||
mode: "single" | "buttons";
|
||||
segments: {
|
||||
@@ -169,6 +173,19 @@ export function TouchBarSegmentedControl({ mode, segments, selectedIndex, onChan
|
||||
return <></>;
|
||||
}
|
||||
|
||||
export function TouchBarSpacer({ size }: SpacerProps) {
|
||||
const api = useContext(TouchBarContext);
|
||||
|
||||
if (api) {
|
||||
const item = new api.TouchBar.TouchBarSpacer({
|
||||
size
|
||||
});
|
||||
api.addItem(item);
|
||||
}
|
||||
|
||||
return <></>;
|
||||
}
|
||||
|
||||
function buildIcon(nativeImage: typeof Electron.nativeImage, name: string) {
|
||||
const sourceImage = nativeImage.createFromNamedImage(name, [-1, 0, 1]);
|
||||
const { width, height } = sourceImage.getSize();
|
||||
|
||||
Reference in New Issue
Block a user