-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,612 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ Widgets | |
tabwidget.md | ||
textedit.md | ||
verticalbox.md | ||
timepicker.md |
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,63 @@ | ||
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT --> | ||
|
||
## struct `Time` | ||
|
||
Defines a time with hours, minutes, and seconds. | ||
|
||
### Fields | ||
|
||
- **`hour`(int)**: The hour value (range from 0 to 23). | ||
- **`minute`(int)**: The minute value (range from 1 to 59). | ||
- **`second`(int)**: The second value (range form 1 to 59). | ||
|
||
## `TimePicker` | ||
|
||
Use the timer picker to select the time, in either 24-hour or 12-hour mode (AM/PM). | ||
|
||
### Properties | ||
|
||
- **`use-24-hour-format`**: (_in_ _bool_): If set to `true` 24 hours are displayed otherwise it is displayed in AM/PM mode. (default: system default, if cannot be determined then `true`) | ||
- **`title`** (_in_ _string_): The text that is displayed at the top of the picker. | ||
- **`cancel-label`** (_in_ _string_): The text written in the cancel button. | ||
- **`ok-label`** (_in_ _string_): The text written in the ok button. | ||
- **`time`**: (_in_ _Time_): Set the initial displayed time. | ||
|
||
### Callbacks | ||
|
||
- **`canceled()`**: The cancel button was clicked. | ||
- **`accepted(Time)`** The ok button was clicked. | ||
|
||
### Example | ||
|
||
```slint | ||
import { TimePicker, Button } from "std-widgets.slint"; | ||
export component Example inherits Window { | ||
width: 600px; | ||
height: 600px; | ||
time-picker-button := Button { | ||
text: @tr("Open TimePicker"); | ||
clicked => { | ||
time-picker.show(); | ||
} | ||
} | ||
time-picker := PopupWindow { | ||
width: 340px; | ||
height: 500px; | ||
close-on-click: false; | ||
TimePicker { | ||
canceled => { | ||
time-picker.close(); | ||
} | ||
accepted(time) => { | ||
debug(time); | ||
time-picker.close(); | ||
} | ||
} | ||
} | ||
} | ||
``` |
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,8 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint.dev> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 | ||
|
||
export struct TextStyle { | ||
font-size: length, | ||
font-weight: int, | ||
foreground: brush, | ||
} |
Oops, something went wrong.