Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OS X titlebar move buttons (like iTunes or SourceTree)
Qt 6.11 is out! See what's new in the release blog

OS X titlebar move buttons (like iTunes or SourceTree)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.2k Views 1 Watching
  • 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 Offline
    B Offline
    burnshred
    wrote on last edited by burnshred
    #1

    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
    0
    • B Offline
      B Offline
      burnshred
      wrote on last edited by
      #2

      PUSH

      Any hint would be really appreciated!

      No OS X Qt intern here?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved