dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.18k stars 1.74k forks source link

Add support to create draggable window without title bar #10329

Open pablokentch opened 2 years ago

pablokentch commented 2 years ago

Description

The idea would be to add a function that does the same as a title bar, opening spaces for customizations,

I am currently working on a maui blazor app

I removed the default title bar, created one in blazor, but currently there is nothing that allows me to make the app draggable

In wpf there was a DragMove() function that did the service

Why doesn't maui have this kind of thing too?

This would make you have more customization possibilities and not get stuck in that windows title bar

Public API Changes

An example of a title bar created in blazor

The DragWindow() function would be the function provided from maui

<div class="lateral_title_bar" @onmousedown="@MoveWindow">
 ....
</div>

@code {
   private void MoveWindow() {
           App.DragWindow();
   }
}

Intended Use-Case

I know maui is still new, but this kind of implementation would allow new creations without having to get stuck in the default title bar

And an app built in maui and blazor needs it

Eilon commented 2 years ago

Hi @pablokentch , is the thing you're looking for the App.DragWindow() API, and you're saying it doesn't exist in .NET MAUI? I'm guessing such an API would be specific to each platform .NET MAUI runs on, so it might be worth looking to see if the Windows App SDK and/or Mac Catalyst UIKit have such an API available.

One other thing you might run into is that there is currently a bug with WebView2 for some drag/drop scenarios: https://github.com/MicrosoftEdge/WebView2Feedback/issues/2805

pablokentch commented 2 years ago

@Eilon It was just an example of how it could be on maui, there is no DragWindow() function

Eilon commented 2 years ago

Hi @pablokentch , it's probably something you could do by calling platform-specific APIs, like:

#if WINDOWS
    SomeWindowsAppSDKClass.DragWindow();
#endif

Though I don't know exactly which API it would be one ach platform.

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

samhouts commented 1 year ago

Related to #6210

mouralabank commented 1 year ago

Any updates?

mouralabank commented 1 year ago

Adding support for creating draggable windows without a title bar can be a useful feature for desktop apps in certain cases. This feature can provide more flexibility in designing the user interface of an application and can help to simplify the interface by removing the title bar.

By removing the title bar, the application can provide more space for displaying content and can create a more seamless and intuitive user experience. Additionally, draggable windows without a title bar can help to create a more modern and sleek design aesthetic, which can be particularly important for certain types of applications.

lfmouradasilva commented 1 year ago

Any updates on this issue?

kawishbit commented 4 days ago

Any update on this? I'm struggling to implement custom titlebar that can function like the normal title bar, which means that i need it so that If I click the titlebar it'll make the app movable or draggable