File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ class Window
43
43
44
44
protected string $ titleBarStyle = 'default ' ;
45
45
46
+ protected array $ trafficLightPosition = [];
47
+
46
48
protected string $ title = '' ;
47
49
48
50
protected string $ id = 'main ' ;
@@ -88,6 +90,13 @@ public function titleBarHiddenInset(): self
88
90
return $ this ->titleBarStyle ('hiddenInset ' );
89
91
}
90
92
93
+ public function trafficLightPosition (int $ x , int $ y ): self
94
+ {
95
+ $ this ->trafficLightPosition = ['x ' => $ x , 'y ' => $ y ];
96
+
97
+ return $ this ;
98
+ }
99
+
91
100
public function rememberState (): self
92
101
{
93
102
$ this ->rememberState = true ;
@@ -225,6 +234,7 @@ public function toArray()
225
234
'hasShadow ' => $ this ->hasShadow ,
226
235
'frame ' => $ this ->frame ,
227
236
'titleBarStyle ' => $ this ->titleBarStyle ,
237
+ 'trafficLightPosition ' => $ this ->trafficLightPosition ,
228
238
'showDevTools ' => $ this ->showDevTools ,
229
239
'vibrancy ' => $ this ->vibrancy ,
230
240
'transparency ' => $ this ->transparent ,
Original file line number Diff line number Diff line change 58
58
expect ($ window ->toArray ()['titleBarStyle ' ])->toBe ('customButtonsOnHover ' );
59
59
});
60
60
61
+ it ('test for trafficLightPosition in window ' , function () {
62
+ $ window = Window::open ()
63
+ ->trafficLightPosition (10 , 10 );
64
+
65
+ expect ($ window ->toArray ()['trafficLightPosition ' ])
66
+ ->toBeArray ()
67
+ ->toHaveKeys (['x ' , 'y ' ])
68
+ ->toHaveLength (2 )
69
+ ->toMatchArray (['x ' => 10 , 'y ' => 10 ]);
70
+
71
+ $ window ->trafficLightPosition (5 , 15 );
72
+
73
+ expect ($ window ->toArray ()['trafficLightPosition ' ])
74
+ ->toBeArray ()
75
+ ->toHaveKeys (['x ' , 'y ' ])
76
+ ->toHaveLength (2 )
77
+ ->toMatchArray (['x ' => 5 , 'y ' => 15 ]);
78
+ });
79
+
61
80
it ('test for invisibleFrameless in window ' , function () {
62
81
$ window = Window::open ()->invisibleFrameless ();
63
82
$ windowArray = $ window ->toArray ();
You can’t perform that action at this time.
0 commit comments