Comments (3)
Suggested workaround didn't really work for me.
However, I made a dirty trick to work this through.
Locate CreateWindow()
call in windows\runner\win32_window.cpp
, and adjust styles to WS_POPUP|WS_VISIBLE|WS_SYSMENU
:
HWND window = CreateWindow(
window_class, title.c_str(), WS_POPUP|WS_VISIBLE|WS_SYSMENU,
Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
Scale(size.width, scale_factor), Scale(size.height, scale_factor),
nullptr, nullptr, GetModuleHandle(nullptr), this);
from flutter_acrylic.
Tell Microsoft.
from flutter_acrylic.
I figured out how to do this,
import 'dart:io';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:window_manager/window_manager.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Window.initialize();
await windowManager.ensureInitialized();
await Window.setEffect(effect: WindowEffect.acrylic);
var initialSize = const Size(375, 750);
WindowOptions windowOptions = WindowOptions(
size: initialSize,
center: false,
);
await windowManager.waitUntilReadyToShow(
windowOptions,
() async {
await windowManager.setAsFrameless();
await windowManager.show();
},
);
runApp(
const MyApp(),
);
if (Platform.isWindows) {
doWhenWindowReady(() {
const initialSize = Size(375, 750);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
appWindow.alignment = Alignment.bottomRight;
appWindow.show();
});
}
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> with WindowListener {
@override
void initState() {
super.initState();
Window.setEffect(effect: WindowEffect.acrylic);
setState(() {});
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: const Size(375, 750),
builder: ((context, child) {
ScreenUtil.init(context);
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(title: const Text('Test')),
body: const Center(
child: Text('Hello World'),
)));
}));
}
}
Here, main point is to add:
await windowManager.setAsFrameless();
Then:
We can add custom controls [minimize, maximize and close]
Also, is WindowEffect.aero applicable for Window versions below Window 11, since i don't have window 10?
I tried using acrylic, but it was applicable to only Windows 11 and macos,
I will really appreciate your answer.
from flutter_acrylic.
Related Issues (20)
- expose aera transparent ratio API on windows10
- macOS broken HOT 10
- Usage of `macos_window_utils` broken in 1.1.1 HOT 6
- [Question] is there any way for customize unfocused window color of Window Effects like mica/acrylic/tabbed?
- windows11 acrylic effect changed
- Upgrade to macos_window_utils 1.1.2
- Replace the deprecated `backgroundColor` with `colorScheme.background` in `/example/lib/widgets/macos_action_menu/description_display.dart`
- Setup linting and fix linter errors
- Improve macos_window_utils import
- hideTitle takes no effect HOT 3
- Facing error after upgrading to 1.1.2 HOT 12
- Not working on macOS 12.3.1 (21E258) and flutter 3.7.11 HOT 8
- Not work after importing flutter_easyloading HOT 2
- macOS - Running in release mode causes program to hang HOT 9
- flutter_acrylic.Window.hideWindowControls() not support on linux HOT 1
- Not Working on Android ,
- Tint colour does not work on Mac OS when using WindowEffect.acrylic HOT 2
- WindowEffect.aero not working properly in windows 11 its just transparent
- No acrylic effect at all - Windows 11 stable release HOT 4
- Crash on linux HOT 1
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 flutter_acrylic.