Giter Club home page Giter Club logo

Comments (17)

knopp avatar knopp commented on September 21, 2024 1

You can make custom title bar (or any draggable section) by calling Window.of(context).beginDrag() from a gesture detector. There's currently no support for maximizing/minimizing window and listening to window states, but that will come soon. That should be enough to build any custom title bar.

from nativeshell.

knopp avatar knopp commented on September 21, 2024 1

That is not really possible, nor goal of flutter / nativeshell. If you want to do that, then you can just write native code and customize the GtkHeaderBar of the window. If you're making a custom window you're in charge of anything you put in there.

from nativeshell.

knopp avatar knopp commented on September 21, 2024 1

You can easily make it an extension method.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

This can be done by GTK on linux, UWP on windows and AppKit on macos.

from nativeshell.

knopp avatar knopp commented on September 21, 2024

Can you be more specific? By default (when not customizing title bar) GTK is using CSD on gnome and SSD on KDE. What better support exactly do you have in mind?

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024
  • Let us create a native looking header for desktop platforms
  • which also follow CSD standards like rounded corner and drop shadows like a native desktop app.
  • Follow theming for header like gtk theming and window buttons for linux or windows theming for light/dark mode , or macos inline title bar look

Ultimately I want to achieve this using nativeshell:

from nativeshell.

knopp avatar knopp commented on September 21, 2024

If you set window frame to WindowFrame.noTitle, it should still have shadow and possibly rounded corners.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

If you set window frame to WindowFrame.noTitle, it should still have shadow and possibly rounded corners.

Ok I will try it, also can we mimic current theming headerbar for platforms like gtk to lookmmore native, It is possible in GTK but I don't know much about it.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

@knopp And please if possible make max, min, close icon native to the current Operating system and theming.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

WindowFrame.noTitle

Can you guide me how or where to set that, I cannot find a way to set this for the parent/main window

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

@knopp Is there any way to get response from window manager to check if titlebar buttons are to be shown or not?

Use case:
on mobile linux with custom titlebar buttons, the visiblity of maximize, minimize and close button is not neccesary as it will always be controlled by window manager.

But because this was custom implementation inside flutter code so titlebar buttons will still be visible.

I want to get a callback from shell something like Window.of(context).isTitlebarButtonVisible.

This can also be used for windows phone and apps, I don't know about mac as it only have a desktop ui so this method will always return true on that.

For ios / android this method will return false as titlebar is not needed there.

from nativeshell.

knopp avatar knopp commented on September 21, 2024

You can not use nativeshell with iOS / Android. It is desktop only at this point.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

@knopp Yeah, I only gave an example if the callback is added to this plugin.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

6799261 has this implemented but it is not auto and you need to provide the maximize value.

Like
setMaximize(true)

But I wanted an auto method which would restore if maximized and maximize if restore like
maximizeOrRestore()

@knopp Can this be implemented?

from nativeshell.

knopp avatar knopp commented on September 21, 2024

Something like this should work:

    final flags = await window.getWindowStateFlags();
    await window.setMaximized(!flags.maximized);

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

@knopp Can this be a method so that it would be easy and I will not have to repeat the code, Thanks.

from nativeshell.

prateekmedia avatar prateekmedia commented on September 21, 2024

Thanks, I will close this then.

from nativeshell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.