mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 10:39:00 +01:00
chore(react/collections): use normal buttons for calendar prev/next
This commit is contained in:
parent
5966b9ff23
commit
05299952a9
@ -340,18 +340,13 @@ function CalendarTouchBar({ calendarRef }: { calendarRef: RefObject<FullCalendar
|
|||||||
label={t("calendar.today")}
|
label={t("calendar.today")}
|
||||||
click={() => calendarRef.current?.today()}
|
click={() => calendarRef.current?.today()}
|
||||||
/>
|
/>
|
||||||
<TouchBarSegmentedControl
|
<TouchBarButton
|
||||||
mode="buttons"
|
icon="NSImageNameTouchBarGoBackTemplate"
|
||||||
segments={[
|
click={() => calendarRef.current?.prev()}
|
||||||
{
|
/>
|
||||||
icon: "NSImageNameTouchBarGoBackTemplate",
|
<TouchBarButton
|
||||||
onClick: () => calendarRef.current?.prev()
|
icon="NSImageNameTouchBarGoForwardTemplate"
|
||||||
},
|
click={() => calendarRef.current?.next()}
|
||||||
{
|
|
||||||
icon: "NSImageNameTouchBarGoForwardTemplate",
|
|
||||||
onClick: () => calendarRef.current?.next()
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</TouchBar>
|
</TouchBar>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -21,7 +21,8 @@ interface SliderProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface ButtonProps {
|
interface ButtonProps {
|
||||||
label: string;
|
label?: string;
|
||||||
|
icon?: string;
|
||||||
click: () => void;
|
click: () => void;
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
}
|
}
|
||||||
@ -122,12 +123,13 @@ export function TouchBarSlider({ label, value, minValue, maxValue, onChange }: S
|
|||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TouchBarButton({ label, click, enabled }: ButtonProps) {
|
export function TouchBarButton({ label, icon, click, enabled }: ButtonProps) {
|
||||||
const api = useContext(TouchBarContext);
|
const api = useContext(TouchBarContext);
|
||||||
|
|
||||||
if (api) {
|
if (api) {
|
||||||
const item = new api.TouchBar.TouchBarButton({
|
const item = new api.TouchBar.TouchBarButton({
|
||||||
label, click, enabled
|
label, click, enabled,
|
||||||
|
icon: icon ? buildIcon(api.nativeImage, icon) : undefined
|
||||||
});
|
});
|
||||||
api.addItem(item);
|
api.addItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user