bitsdojo_window icon indicating copy to clipboard operation
bitsdojo_window copied to clipboard

How to Move/Position Window Buttons on macOS?

Open wottpal opened this issue 3 years ago • 15 comments

Hey, first thanks for this great package and your effort!

How can I achieve moving the window-buttons on macOS with your plugin? I would like them to be a little bit more to the right & the bottom (see attached screenshot).

Artboard

wottpal avatar Apr 26 '21 20:04 wottpal

@bitsdojo would be great to get a little hint here :) thanks in advance!!

wottpal avatar Apr 28 '21 10:04 wottpal

@bitsdojo You would make my day by helping me out 🙃

wottpal avatar May 04 '21 11:05 wottpal

Hey. Try wrapping the widgets in a container and adding a margin.

tomassasovsky avatar May 04 '21 15:05 tomassasovsky

I tried doing that first but unfortunately, the macOS window buttons are not part of the widget tree but added through swift/objective-c instead..

wottpal avatar May 04 '21 19:05 wottpal

Atm you can't do that using the plugin, I assume this is because macOS does not allow, or not easily allow to hide window buttons.

wolfenrain avatar May 07 '21 21:05 wolfenrain

Does anybody have enough Swift/Objective-C/macOS experience to tell me how to do so manually via Xcode :) Would be awesome

wottpal avatar May 13 '21 06:05 wottpal

This is on my list. Just need to find some time after work to implement it.

bitsdojo avatar May 13 '21 06:05 bitsdojo

So just to confirm, the current recommended implementation is to show MinimizeWindowButton/MaximizeWindowButton/CloseWindowButton on Linux/Windows, but on MacOS, we just leave a gap in place for the native ones to render?

esDotDev avatar May 13 '21 15:05 esDotDev

@esDotDev yes, that is the currently recommended implementation.

Ability to move/position window buttons on macOS is also coming with the next update.

bitsdojo avatar Aug 17 '21 08:08 bitsdojo

How long this is gonna take @bitsdojo.

nirmalsingnegi avatar Apr 15 '22 08:04 nirmalsingnegi

waiting since months still no update .

ashish007ratz avatar Apr 16 '22 05:04 ashish007ratz

@bitsdojo bump 💯

appinteractive avatar Aug 09 '22 17:08 appinteractive

Any updates?

Same issue to me: https://github.com/bitsdojo/bitsdojo_window/issues/111 .

I finally solved the problem by following these steps: https://medium.com/flutter-community/transparent-title-bar-on-macos-with-flutter-7043d44f25dc

image

Now its working for me.

shi-yang avatar Mar 06 '23 16:03 shi-yang

@bitsdojo any updates after 2 year ?

hieplee2997 avatar Jun 19 '23 08:06 hieplee2997

In case somebody is still looking for a solution, replacing the tool bar with a custom one does work for me:

import Cocoa
import FlutterMacOS
import FlutterMacOS
import bitsdojo_window_macos

class MainFlutterWindow: BitsdojoWindow {
  override func bitsdojo_window_configure() -> UInt {
    return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
  }

  override func awakeFromNib() {
    let flutterViewController = FlutterViewController()
    let windowFrame = self.frame
    self.contentViewController = flutterViewController
    self.setFrame(windowFrame, display: true)

    let customToolbar = NSToolbar()
    self.toolbar = customToolbar

    RegisterGeneratedPlugins(registry: flutterViewController)

    super.awakeFromNib()
  }
}
Bildschirmfoto 2024-08-21 um 01 52 12

chris91b avatar Aug 21 '24 00:08 chris91b