-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Term confusion (Window
/ component
/ ComponentHandle
/ AppWindow
)
#6027
Comments
That's correct, although the forced association with
That's a nice idea.
I'm unsure about this one. I find
I agree. If there are multiple windows involved, there is - towards the user - typically one "bigger" window, also known as the "main window". So
I'm also a bit torn on mobile, but on the other hand: On Android there's clearly a concept and type "Window", and on Apple it's the same: The UIWindow is the "backdrop for your app’s user interface and the object that dispatches events to your views". So Window seems still appropriate to me, and more concrete than "Surface" or "Backdrop" :)
👍 |
I've removed the triaging label here and turned this into an rfc, as there's clearly a discussion with some degree of consensus before we can take action, but the case @Enyium presented is beautifully summarised and perfectly valid. I appreciated the time and thought that went into this :) |
But if you keep It's like with let window = app_window.window();
let handle = window.window_handle().window_handle()?.as_raw(); This hierarchy would ideally be flattened. |
Oh that’s a very good point… Hmm. |
Window
/ component
/ ComponentHandle
/ AppWindow
)
(I'm using Rust.)
When teaching Slint, you call the exported
component
inheritingWindow
a...Window
:MainWindow
: https://releases.slint.dev/1.7.2/docs/slint/src/quickstart/getting_started#id3AppWindow
: https://github.com/slint-ui/slint-rust-template/blob/main/src/main.rsThen, this
...Window
is indirectly called a "component" by the name of yourSampleComponent
(which inheritsWindow
in .slint code), implementsComponentHandle
, and, through that, has itself awindow()
getter, which returns aWindow
(giving you code likeapp_window.window()
).Exporting
component
s not inheritingWindow
to Rust isn't allowed:So, a
ComponentHandle
must always be acomponent
narrowed down to a .slintWindow
.The fact that a generated
struct
likeAppWindow
really only allows you to interact with the window's client area (disregarding the deeperwindow() -> Window
), and "window" may not even be the most suitable term for the rendering surface of an Android app tops off the confusion.Is the
Window
thewindow()
getter returns even a real window on every platform?Maybe, it would be justified to redefine and here and there switch or rename the terms for more clarity and presenting a more streamlined concept.
Possible improvement:
WindowComponent
instead ofComponentHandle
, because it can only be one narrow kind of component.component
inheritingWindow
a...Window
. For single-window apps, the recommendation could becomponent Main inherits Window
. In Rust, this could belet main_component
, although= Main::new();
would be rather undesirable. Maybecomponent MainComponent inherits Window
would be acceptable. OrAppComponent
. But the user may want to useApp
as their own struct that holds all of their business data and window components.Window
suffix. If it's a message box window, e.g., it could just becomponent MessageBox inherits Window
.window()
can be kept, because the struct providing the getter now is more recognizable as the property-based reactive client area of the window.Window
in .slint code? Even if this isn't necessarily always the most natural term for the app surface in an Android context, there can be movable windows on Android, like with Samsung DeX when connecting your monitor to your phone. An app on a regular phone could be seen as in a fullscreen window.Other way:
AppWindow
, which would also be aWindowComponent
(trait). This would be in harmony with these components presenting in dedicated associated windows.window()
and its return typeWindow
. But I don't know what that could be. (Perhaps something with "non-client"?)The text was updated successfully, but these errors were encountered: