Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    OS X titlebar move buttons (like iTunes or SourceTree)

    General and Desktop
    1
    2
    657
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      burnshred last edited by burnshred

      Hey guys,

      I am trying to make a translucent title bar on OS X. Therefore I am using native NSWindow API to hide the title and rearrange the buttons (close, ...) accordingly. I am doing it like here: https://github.com/stonesam92/ChitChat/blob/master/WhatsMac/AppDelegate.m#L54-L62

      I also hook into the resize delegate method of NSWindowDelegate to adjust the buttons when resizing.

      When my application starts, the buttons are placed correctly, but if I am interacting with the window (Enter text, ...) then the buttons are misplaced (like they would be placed when having a normal title bar). I do not really know why this is happening, maybe because Qt repaints (or triggers a repaint) of the titlebar and my placement code is not called?

      I attached pictures to demonstrate the misbehaviour.

      I also tried to use Qt::FramelessWindowHint, but then the buttons are completely gone, and they do not appear even when I am settings the correct NSWindow styleFlags on the native NSWindow (from mainWindow->winId().window).

      So is there a proper way to do this? Can I say Qt somehow that I want to take care of the title bar on OS X? Or can I interrupt or listen to an event when repainting titlebar? Why are the buttons gone, even if I am settings the correct flags on the NSWindow instance?

      Do you have any hints?

      Thanks in advance

      Correct
      Misplaced

      1 Reply Last reply Reply Quote 0
      • B
        burnshred last edited by

        PUSH

        Any hint would be really appreciated!

        No OS X Qt intern here?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post