macos_ui icon indicating copy to clipboard operation
macos_ui copied to clipboard

Toolbar fidelity issues

Open bernaferrari opened this issue 3 years ago • 6 comments

The trailing icon becomes darker when clicked. On macOS it becomes lighter. Dragging the trailing icon doesn't drag the toolbar on macOS. Double clicking the trailing icon doesn't minimize the screen on macOS.

https://user-images.githubusercontent.com/351125/200045237-fbcc1a82-3aca-4773-beb2-1b5776ed1be9.mov

bernaferrari avatar Nov 04 '22 18:11 bernaferrari

Hi @bernaferrari! Thanks for filing this issue.

Toolbar behavior is unfortunately pretty complex. We can certainly address the icon color discrepancy; as for the dragging/clicking issue, it will require deeper research.

GroovinChip avatar Jan 14 '23 14:01 GroovinChip

You probably want some form of absorb pointer.

bernaferrari avatar Jan 14 '23 14:01 bernaferrari

You probably want some form of absorb pointer.

I believe we have experimented with AbsorbPointer in this regard. @whiplashoo Can you confirm this?

GroovinChip avatar Jan 14 '23 15:01 GroovinChip

@bernaferrari There is an issue for the double clicking behaviour in #308

Solving this, might as well solve the draging behaviour you mention. Currently the toolbar is completely handled by the native side. I guess we need to handle part of it from the Flutter side instead to solve both issues. The experiments @whiplashoo made didn't seem to work. See https://github.com/GroovinChip/macos_ui/issues/308#issuecomment-1270448273.

@GroovinChip You might want to use / or get inspired by https://github.com/leanflutter/window_manager or https://github.com/bitsdojo/bitsdojo_window.

cbenhagen avatar Jan 17 '23 10:01 cbenhagen

Yes, it wouldn't work as the double click event gets captured by the native NSToolbar, which we use to have all the minimizing-maximizing native-like behavior of the toolbar. Blocking this in Flutter with widgets wouldn't work.

The window_manager plugin looks promising, will have a look when I find time

whiplashoo avatar Jan 17 '23 17:01 whiplashoo

@whiplashoo using https://github.com/leanflutter/window_manager/pull/290 you could disable window zoom on button clicks and start a timer to re-enable it 300ms later.

cbenhagen avatar Jan 24 '23 14:01 cbenhagen