Skip to content

Commit 3cf0c12

Browse files
committed
v0.5.0
1 parent 56ae6e9 commit 3cf0c12

File tree

11 files changed

+55
-46
lines changed

11 files changed

+55
-46
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- run: |
1919
sudo apt-get update
2020
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
21-
sudo apt-get install -y ayatana-appindicator3-0.1
21+
sudo apt-get install -y libayatana-appindicator3-dev
2222
- uses: bluefireteam/melos-action@v3
2323
- working-directory: ./packages/window_manager/example
2424
run: |
@@ -37,18 +37,18 @@ jobs:
3737
run: |
3838
flutter build macos --release
3939
40-
build-web:
41-
runs-on: macos-latest
42-
steps:
43-
- uses: actions/checkout@v3
44-
- uses: subosito/flutter-action@v2
45-
with:
46-
flutter-version: "3.32.0"
47-
channel: "stable"
48-
- uses: bluefireteam/melos-action@v3
49-
- working-directory: ./packages/window_manager/example
50-
run: |
51-
flutter build web --release
40+
# build-web:
41+
# runs-on: macos-latest
42+
# steps:
43+
# - uses: actions/checkout@v3
44+
# - uses: subosito/flutter-action@v2
45+
# with:
46+
# flutter-version: "3.32.0"
47+
# channel: "stable"
48+
# - uses: bluefireteam/melos-action@v3
49+
# - working-directory: ./packages/window_manager/example
50+
# run: |
51+
# flutter build web --release
5252

5353
build-windows:
5454
runs-on: windows-latest

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
flutter-version: "3.32.0"
1818
- run: |
1919
sudo apt-get update -y
20-
sudo apt-get install -y ninja-build libgtk-3-dev ayatana-appindicator3-0.1 xvfb
20+
sudo apt-get install -y ninja-build libgtk-3-dev libayatana-appindicator3-dev xvfb
2121
- uses: bluefireteam/melos-action@v3
2222
- working-directory: ./packages/window_manager/example
2323
run: xvfb-run -a flutter test integration_test -v

docs/en/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Add this to your package's `pubspec.yaml` file:
88

99
```yaml
1010
dependencies:
11-
window_manager: ^0.4.2
11+
window_manager: ^0.5.0
1212
```
1313
1414
Or

docs/zh/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
```yaml
1010
dependencies:
11-
window_manager: ^0.4.2
11+
window_manager: ^0.5.0
1212
```
1313
1414
或者

melos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ scripts:
2323
- test
2424

2525
format:
26-
exec: dart format . --fix
26+
exec: dart format .
2727
description: Run `dart format` for all packages.
2828

2929
format-check:
30-
exec: dart format . --fix --set-exit-if-changed
30+
exec: dart format . --set-exit-if-changed
3131
description: Run `dart format` checks for all packages.
3232

3333
fix:

packages/window_manager/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### 0.5.0
2+
3+
* feat: Add `getId` method for retrieving window ID on macOS and Windows
4+
* feat: Add `getWindowHandle` method (#548)
5+
* feat: Add Swift Package Manager support
6+
* fix: Crash when using window_manager by multi engine on Windows platform (#546)
7+
* fix: [Windows] Use frameless window to implement fullscreen (#531)
8+
* fix: Initialize window_hints to fix minimum size setting in release mode (#510)
9+
110
### 0.4.3
211

312
* [windows] fix: scale ratio on dpi change (#496)

packages/window_manager/example/lib/pages/home.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -928,10 +928,10 @@ class _HomePageState extends State<HomePage> with TrayListener, WindowListener {
928928
margin: const EdgeInsets.all(0),
929929
decoration: const BoxDecoration(
930930
color: Colors.white,
931-
// border: Border.all(color: Colors.grey.withOpacity(0.4), width: 1),
931+
// border: Border.all(color: Colors.grey.withValues(alpha: 0.4), width: 1),
932932
// boxShadow: <BoxShadow>[
933933
// BoxShadow(
934-
// color: Colors.black.withOpacity(0.2),
934+
// color: Colors.black.withValues(alpha: 0.2),
935935
// offset: Offset(1.0, 1.0),
936936
// blurRadius: 6.0,
937937
// ),
@@ -966,7 +966,7 @@ class _HomePageState extends State<HomePage> with TrayListener, WindowListener {
966966
margin: const EdgeInsets.all(0),
967967
width: double.infinity,
968968
height: 54,
969-
color: Colors.grey.withOpacity(0.3),
969+
color: Colors.grey.withValues(alpha: 0.3),
970970
child: const Center(
971971
child: Text('DragToMoveArea'),
972972
),
@@ -978,11 +978,11 @@ class _HomePageState extends State<HomePage> with TrayListener, WindowListener {
978978
margin: const EdgeInsets.all(20),
979979
child: DragToResizeArea(
980980
resizeEdgeSize: 6,
981-
resizeEdgeColor: Colors.red.withOpacity(0.2),
981+
resizeEdgeColor: Colors.red.withValues(alpha: 0.2),
982982
child: Container(
983983
width: double.infinity,
984984
height: double.infinity,
985-
color: Colors.grey.withOpacity(0.3),
985+
color: Colors.grey.withValues(alpha: 0.3),
986986
child: Center(
987987
child: GestureDetector(
988988
child: const Text('DragToResizeArea'),

packages/window_manager/lib/src/widgets/virtual_window_frame.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class _VirtualWindowFrameState extends State<VirtualWindowFrame>
5555
boxShadow: <BoxShadow>[
5656
if (!_isMaximized && !_isFullScreen)
5757
BoxShadow(
58-
color: Colors.black.withOpacity(0.1),
58+
color: Colors.black.withValues(alpha: 0.1),
5959
offset: Offset(0.0, _isFocused ? 4 : 2),
6060
blurRadius: 6,
6161
),

packages/window_manager/lib/src/widgets/window_caption.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class _WindowCaptionState extends State<WindowCaption> with WindowListener {
7474
child: DefaultTextStyle(
7575
style: TextStyle(
7676
color: widget.brightness == Brightness.light
77-
? Colors.black.withOpacity(0.8956)
77+
? Colors.black.withValues(alpha: 0.8956)
7878
: Colors.white,
7979
fontSize: 14,
8080
),

packages/window_manager/lib/src/widgets/window_caption_button.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -314,24 +314,24 @@ class WindowCaptionButton extends StatefulWidget {
314314
_lightButtonBgColorScheme = _ButtonBgColorScheme(
315315
normal: Colors.transparent,
316316
hovered: const Color(0xffC42B1C),
317-
pressed: const Color(0xffC42B1C).withOpacity(0.9),
317+
pressed: const Color(0xffC42B1C).withValues(alpha: 0.9),
318318
),
319319
_lightButtonIconColorScheme = _ButtonIconColorScheme(
320-
normal: Colors.black.withOpacity(0.8956),
320+
normal: Colors.black.withValues(alpha: 0.8956),
321321
hovered: Colors.white,
322-
pressed: Colors.white.withOpacity(0.7),
323-
disabled: Colors.black.withOpacity(0.3614),
322+
pressed: Colors.white.withValues(alpha: 0.7),
323+
disabled: Colors.black.withValues(alpha: 0.3614),
324324
),
325325
_darkButtonBgColorScheme = _ButtonBgColorScheme(
326326
normal: Colors.transparent,
327327
hovered: const Color(0xffC42B1C),
328-
pressed: const Color(0xffC42B1C).withOpacity(0.9),
328+
pressed: const Color(0xffC42B1C).withValues(alpha: 0.9),
329329
),
330330
_darkButtonIconColorScheme = _ButtonIconColorScheme(
331331
normal: Colors.white,
332332
hovered: Colors.white,
333-
pressed: Colors.white.withOpacity(0.786),
334-
disabled: Colors.black.withOpacity(0.3628),
333+
pressed: Colors.white.withValues(alpha: 0.786),
334+
disabled: Colors.black.withValues(alpha: 0.3628),
335335
);
336336

337337
final Brightness? brightness;
@@ -341,25 +341,25 @@ class WindowCaptionButton extends StatefulWidget {
341341

342342
_ButtonBgColorScheme _lightButtonBgColorScheme = _ButtonBgColorScheme(
343343
normal: Colors.transparent,
344-
hovered: Colors.black.withOpacity(0.0373),
345-
pressed: Colors.black.withOpacity(0.0241),
344+
hovered: Colors.black.withValues(alpha: 0.0373),
345+
pressed: Colors.black.withValues(alpha: 0.0241),
346346
);
347347
_ButtonIconColorScheme _lightButtonIconColorScheme = _ButtonIconColorScheme(
348-
normal: Colors.black.withOpacity(0.8956),
349-
hovered: Colors.black.withOpacity(0.8956),
350-
pressed: Colors.black.withOpacity(0.6063),
351-
disabled: Colors.black.withOpacity(0.3614),
348+
normal: Colors.black.withValues(alpha: 0.8956),
349+
hovered: Colors.black.withValues(alpha: 0.8956),
350+
pressed: Colors.black.withValues(alpha: 0.6063),
351+
disabled: Colors.black.withValues(alpha: 0.3614),
352352
);
353353
_ButtonBgColorScheme _darkButtonBgColorScheme = _ButtonBgColorScheme(
354354
normal: Colors.transparent,
355-
hovered: Colors.white.withOpacity(0.0605),
356-
pressed: Colors.white.withOpacity(0.0419),
355+
hovered: Colors.white.withValues(alpha: 0.0605),
356+
pressed: Colors.white.withValues(alpha: 0.0419),
357357
);
358358
_ButtonIconColorScheme _darkButtonIconColorScheme = _ButtonIconColorScheme(
359359
normal: Colors.white,
360360
hovered: Colors.white,
361-
pressed: Colors.white.withOpacity(0.786),
362-
disabled: Colors.black.withOpacity(0.3628),
361+
pressed: Colors.white.withValues(alpha: 0.786),
362+
disabled: Colors.black.withValues(alpha: 0.3628),
363363
);
364364

365365
_ButtonBgColorScheme get buttonBgColorScheme => brightness != Brightness.dark

packages/window_manager/lib/src/window_manager.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ class WindowManager {
328328
/// Sets the background color of the window.
329329
Future<void> setBackgroundColor(Color backgroundColor) async {
330330
final Map<String, dynamic> arguments = {
331-
'backgroundColorA': backgroundColor.alpha,
332-
'backgroundColorR': backgroundColor.red,
333-
'backgroundColorG': backgroundColor.green,
334-
'backgroundColorB': backgroundColor.blue,
331+
'backgroundColorA': (backgroundColor.a * 255).round() & 0xff,
332+
'backgroundColorR': (backgroundColor.r * 255).round() & 0xff,
333+
'backgroundColorG': (backgroundColor.g * 255).round() & 0xff,
334+
'backgroundColorB': (backgroundColor.b * 255).round() & 0xff,
335335
};
336336
await _channel.invokeMethod('setBackgroundColor', arguments);
337337
}

0 commit comments

Comments
 (0)