@@ -109,10 +109,14 @@ struct EditorScreen: View {
109109
110110 PinButton ( )
111111
112- CopyMenuButton ( note : note )
112+ GlassControlGroup {
113+ HStack ( spacing : SurfaceMetrics . controlGroupSpacing ) {
114+ CopyMenuButton ( note : note )
113115
114- DeleteIconButton {
115- showDeleteConfirm = true
116+ DeleteIconButton {
117+ showDeleteConfirm = true
118+ }
119+ }
116120 }
117121 }
118122
@@ -148,8 +152,33 @@ private struct CopyMenuButton: View {
148152 @ State private var isHovered = false
149153
150154 var body : some View {
155+ if #available( macOS 26 . 0 , * ) {
156+ menu
157+ . menuStyle ( . button )
158+ . buttonStyle ( . glass )
159+ . menuIndicator ( . hidden )
160+ . fixedSize ( )
161+ . help ( L10n . shared [ " editor.copyNote " ] )
162+ . accessibilityLabel ( L10n . shared [ " editor.copyNote " ] )
163+ } else {
164+ menu
165+ . menuStyle ( . button )
166+ . buttonStyle ( . plain )
167+ . menuIndicator ( . hidden )
168+ . fixedSize ( )
169+ . help ( L10n . shared [ " editor.copyNote " ] )
170+ . accessibilityLabel ( L10n . shared [ " editor.copyNote " ] )
171+ . onHover { hovering in
172+ withAnimation ( . easeInOut ( duration : 0.15 ) ) {
173+ isHovered = hovering
174+ }
175+ }
176+ }
177+ }
178+
179+ private var menu : some View {
151180 let l10n = L10n . shared
152- Menu {
181+ return Menu {
153182 Button ( l10n [ " common.copyPlainText " ] ) {
154183 let selected = Self . getSelectedText ( )
155184 let source = selected . isEmpty ? note . content : selected
@@ -175,24 +204,20 @@ private struct CopyMenuButton: View {
175204 }
176205 } label : {
177206 Image ( systemName : " doc.on.doc " )
178- . font ( . system ( size : 14 , weight : . medium ) )
207+ . font ( . system ( size : SurfaceMetrics . compactSymbolSize , weight : . medium ) )
179208 . foregroundStyle ( isHovered ? . primary : . secondary )
180- . frame ( width : 28 , height : 28 )
209+ . frame (
210+ width : SurfaceMetrics . compactControlSize ,
211+ height : SurfaceMetrics . compactControlSize ,
212+ )
181213 . background {
182- RoundedRectangle ( cornerRadius : 6 )
183- . fill ( . primary . opacity ( isHovered ? 0.1 : 0 ) )
214+ if #unavailable( macOS 26 . 0 ) {
215+ RoundedRectangle ( cornerRadius : SurfaceMetrics . compactControlCornerRadius )
216+ . fill ( . primary . opacity ( isHovered ? 0.1 : 0 ) )
217+ }
184218 }
185219 . contentShape ( Rectangle ( ) )
186220 }
187- . menuStyle ( . borderlessButton )
188- . menuIndicator ( . hidden )
189- . fixedSize ( )
190- . help ( l10n [ " editor.copyNote " ] )
191- . onHover { hovering in
192- withAnimation ( . easeInOut ( duration : 0.15 ) ) {
193- isHovered = hovering
194- }
195- }
196221 }
197222
198223 private static func getSelectedText ( ) -> String {
@@ -209,27 +234,13 @@ private struct CopyMenuButton: View {
209234private struct DeleteIconButton : View {
210235 let action : ( ) -> Void
211236
212- @ State private var isHovered = false
213-
214237 var body : some View {
215- Button ( action : action ) {
216- Image ( systemName : " trash " )
217- . font ( . system ( size : 14 , weight : . medium ) )
218- . foregroundStyle ( isHovered ? . red : . secondary )
219- . frame ( width : 28 , height : 28 )
220- . background {
221- RoundedRectangle ( cornerRadius : 6 )
222- . fill ( . primary . opacity ( isHovered ? 0.1 : 0 ) )
223- }
224- . contentShape ( Rectangle ( ) )
225- }
226- . buttonStyle ( . plain )
227- . help ( L10n . shared [ " editor.deleteNote " ] )
228- . onHover { hovering in
229- withAnimation ( . easeInOut ( duration : 0.15 ) ) {
230- isHovered = hovering
231- }
232- }
238+ AdaptiveIconButton (
239+ systemName : " trash " ,
240+ help : L10n . shared [ " editor.deleteNote " ] ,
241+ role : . destructive ,
242+ action : action ,
243+ )
233244 }
234245}
235246
0 commit comments