@@ -20,12 +20,18 @@ class MenuBar
20
20
21
21
protected string $ label = '' ;
22
22
23
- protected bool $ onlyShowContextWindow = false ;
23
+ protected string $ tooltip = '' ;
24
+
25
+ protected bool $ resizable = true ;
26
+
27
+ protected bool $ onlyShowContextMenu = false ;
24
28
25
29
protected ?Menu $ contextMenu = null ;
26
30
27
31
protected bool $ alwaysOnTop = false ;
28
32
33
+ protected ?string $ event = null ;
34
+
29
35
protected bool $ showDockIcon = false ;
30
36
31
37
protected Client $ client ;
@@ -51,28 +57,35 @@ public function icon(string $icon): self
51
57
52
58
public function onlyShowContextMenu (bool $ onlyContextMenu = true ): self
53
59
{
54
- $ this ->onlyShowContextWindow = $ onlyContextMenu ;
60
+ $ this ->onlyShowContextMenu = $ onlyContextMenu ;
55
61
56
62
return $ this ;
57
63
}
58
64
59
- public function url ( string $ url ): self
65
+ public function showDockIcon ( $ value = true ): self
60
66
{
61
- $ this ->url = $ url ;
67
+ $ this ->showDockIcon = $ value ;
62
68
63
69
return $ this ;
64
70
}
65
71
66
- public function showDockIcon ( $ value = true ): self
72
+ public function label ( string $ label = '' ): self
67
73
{
68
- $ this ->showDockIcon = $ value ;
74
+ $ this ->label = $ label ;
69
75
70
76
return $ this ;
71
77
}
72
78
73
- public function label (string $ label = '' ): self
79
+ public function tooltip (string $ tooltip = '' ): self
74
80
{
75
- $ this ->label = $ label ;
81
+ $ this ->tooltip = $ tooltip ;
82
+
83
+ return $ this ;
84
+ }
85
+
86
+ public function resizable (bool $ resizable = true ): static
87
+ {
88
+ $ this ->resizable = $ resizable ;
76
89
77
90
return $ this ;
78
91
}
@@ -84,6 +97,13 @@ public function alwaysOnTop($alwaysOnTop = true): self
84
97
return $ this ;
85
98
}
86
99
100
+ public function event (string $ event ): self
101
+ {
102
+ $ this ->event = $ event ;
103
+
104
+ return $ this ;
105
+ }
106
+
87
107
public function withContextMenu (Menu $ menu ): self
88
108
{
89
109
$ this ->contextMenu = $ menu ;
@@ -100,15 +120,18 @@ public function toArray(): array
100
120
'x ' => $ this ->x ,
101
121
'y ' => $ this ->y ,
102
122
'label ' => $ this ->label ,
123
+ 'tooltip ' => $ this ->tooltip ,
124
+ 'resizable ' => $ this ->resizable ,
103
125
'width ' => $ this ->width ,
104
126
'height ' => $ this ->height ,
105
127
'vibrancy ' => $ this ->vibrancy ,
106
128
'showDockIcon ' => $ this ->showDockIcon ,
107
129
'transparency ' => $ this ->transparent ,
108
130
'backgroundColor ' => $ this ->backgroundColor ,
109
- 'onlyShowContextWindow ' => $ this ->onlyShowContextWindow ,
131
+ 'onlyShowContextMenu ' => $ this ->onlyShowContextMenu ,
110
132
'contextMenu ' => ! is_null ($ this ->contextMenu ) ? $ this ->contextMenu ->toArray ()['submenu ' ] : null ,
111
133
'alwaysOnTop ' => $ this ->alwaysOnTop ,
134
+ 'event ' => $ this ->event ,
112
135
];
113
136
}
114
137
}
0 commit comments