Comments (17)
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.
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.
You can easily make it an extension method.
from nativeshell.
This can be done by GTK on linux, UWP on windows and AppKit on macos.
from nativeshell.
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.
- 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.
If you set window frame to WindowFrame.noTitle, it should still have shadow and possibly rounded corners.
from nativeshell.
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.
@knopp And please if possible make max, min, close icon native to the current Operating system and theming.
from nativeshell.
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.
@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.
You can not use nativeshell with iOS / Android. It is desktop only at this point.
from nativeshell.
@knopp Yeah, I only gave an example if the callback is added to this plugin.
from nativeshell.
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.
Something like this should work:
final flags = await window.getWindowStateFlags();
await window.setMaximized(!flags.maximized);
from nativeshell.
@knopp Can this be a method so that it would be easy and I will not have to repeat the code, Thanks.
from nativeshell.
Thanks, I will close this then.
from nativeshell.
Related Issues (20)
- Is there any way to lower the minimum supported version of macOS HOT 1
- way to run existing flutter code HOT 4
- How to specify libflutter location
- Frameless windows are not resizable on macOS
- Fails to build on apple silicon with Flutter 3.0.0 HOT 2
- The Flutter Attach to Process gets stuck on Waiting... HOT 3
- Invalid read causes segmentation fault HOT 3
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- MenuItem clash with flutter widget of the same name HOT 1
- Getting an error when trying to run the examples HOT 2
- Build Error on MacOS 13.2.1 - cargo run or cargo run --release unable to build and run the flutter app for example provided
- Issues with native plugin `media_kit` HOT 2
- Latest SharedPreferences not working HOT 1
- Jitter when resizing on Windows when frame is `WindowFrame.noTitle` HOT 1
- Unable to build sample project HOT 2
- [super_context_menu] Change/Remove Progress Indicator for DeferredMenuElement
- Calling dart from rust side?
- Support current stable version of Flutter HOT 1
- canβt build examples in macos, Shows that 'Podfile' was not found in the project directory.
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 nativeshell.