// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 import { VerticalBox } from "../common/layout.slint"; import { Button } from "./button.slint"; import { CosmicPalette, CosmicFontSettings, Icons } from "styling.slint"; import { MenuBorder } from "./components.slint"; import { StandardButton } from "../common/standardbutton.slint"; import { Date, DatePickerBase } from "../common/datepicker_base.slint"; export { Date } export component DatePickerPopup inherits PopupWindow { in property title: "Select date"; in property date <=> base.date; callback canceled(); callback accepted(date: Date); width: 360px; height: 524px; close-policy: PopupClosePolicy.no-auto-close; background-layer := MenuBorder { width: dialog.width; height: dialog.height; } dialog := Dialog { padding: 8px; base := DatePickerBase { title: root.title; style: { border-brush: CosmicPalette.border, vertical-spacing: 8px, horizontal-spacing: 4px, calendar-style: { spacing: 8px, delegate-style: { font-size: CosmicFontSettings.body-strong.font-size, font-weight: CosmicFontSettings.body-strong.font-weight, foreground: CosmicPalette.foreground, state-brush: CosmicPalette.state, background-selected: CosmicPalette.accent-background, foreground-selected: CosmicPalette.accent-foreground, state-brush-selected: CosmicPalette.state-secondary, border-color-today: CosmicPalette.accent-background, foreground-today: CosmicPalette.accent-background, state-brush-today: CosmicPalette.state, } }, icon-button-style: { foreground: CosmicPalette.foreground, state-brush: CosmicPalette.state, icon-size: 12px, }, current-day-style: { font-size: CosmicFontSettings.title.font-size, font-weight: CosmicFontSettings.title.font-weight, foreground: CosmicPalette.foreground, }, title-style: { font-size: CosmicFontSettings.body.font-size, font-weight: CosmicFontSettings.body.font-weight, foreground: CosmicPalette.foreground, }, previous-icon: Icons.arrow-back, next-icon: Icons.arrow-forward, drop-down-icon: Icons.dropdown, input-icon: Icons.edit, calendar-icon: Icons.calendar, selection-button-style: { foreground: CosmicPalette.foreground, state-brush: CosmicPalette.state, icon-size: 8px, font-size: CosmicFontSettings.body.font-size, font-weight: CosmicFontSettings.body.font-weight } }; } StandardButton { kind: cancel; clicked => { root.close(); root.canceled(); } } StandardButton { enabled: base.ok-enabled(); kind: ok; clicked => { root.close(); root.accepted(base.get-current-date()); } } } }