Comments (2)
API draft
This is the collection of some ideas how the TimePicker
could looks like from API side and should be used as base for discussions.
export component TimePicker {
in-out property <date-time> current-time;
in property <string> local: "en_US";
}
Use as component and inside of a PopupWindow
import { Button, TimePicker } from "std-widgets.slint";
export component MainWindow inherits Window {
width: 600px;
height: 400px;
time-picker-popup := PopupWindow {
width: 200px;
height: 200px;
TimePicker {}
}
VerticalLayout {
time-picker := TimePicker {}
Text {
text: time-picker.current-time;
}
Button {
text: "Open TimePicker Popup";
clicked => {
time-picker-popup.show();
}
}
}
}
Ready to use dialog
export component TimePickerPopup {
in-out property <date-time> current-time;
in property <string> local: "en_US";
public function show() -> date-time {
//...
}
}
import { TimePickerPopup } from "std-widgets.slint";
export component MainWindow inherits Window {
width: 600px;
height: 400px;
time-picker-popup := TimePickerPopup {
width: 200px;
height: 200px;
}
Button {
text: "Open TimePicker Popup";
clicked => {
debug(time-picker-popup.show());
}
}
}
Use with LineEdit
The idea is that if input-type
of LineEdit
is set and it gets focus a time picker popup open automatically. As alternative a more explicit method that give more flexibility when the popup should be open could be possible.
import { LineEdit } from "std-widgets.slint";
export component MainWindow inherits Window {
width: 600px;
height: 400px;
LineEdit {
input-type: InputType.time;
}
}
from slint.
Regarding the date-time
type, I added a separate issue to track this: #5122
from slint.
Related Issues (20)
- Why is the result of slint viewer different from vscode, and the rendering result of rust the same as that of slint viewer?
- Text blurry with femtovg renderer HOT 1
- Feature Request: Top Level Generic Widget HOT 4
- Dependencies within slint crates are out of sync with each other. HOT 4
- Winit-skia-vulkan crash HOT 3
- Moving a named element produces a syntax error HOT 3
- Partial override fields of a struct HOT 2
- VSCode language server panic in dynamic_item_tree.rs HOT 3
- Screen doesn't update until manually changing the window to fullscreen in Windows 10
- Property change is propagated too far (even when the value remains the same) HOT 2
- Updating the `model` of a `ComboBox` does not change the currently displayed text HOT 1
- Problem on ESP platform with Embassy HOT 9
- Compilation overflow when color name and function name are the same.
- debug_assert hit during debug builds gives no indication of where issue is HOT 1
- long string in slint lead to crash! HOT 2
- Android: LineEdit indicator can not hide
- Android: Unexpectedly showing the keyboard after switching the app from bacground to the foreground
- `Spinner` does not render at all in Windows or when using the `winit-software` back end HOT 2
- Wrong content positioning on Android
- Bug - Slint Server Crashed when trying to call function from States
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slint.