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. Aero Snap - Qt Main Window
Forum Updated to NodeBB v4.3 + New Features

Aero Snap - Qt Main Window

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 6.5k 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.
  • M Offline
    M Offline
    MahdiH
    wrote on last edited by
    #1

    I have a Qt Main Window, and I would like for it to have a custom titlebar while still behaving as though it was a part of Window's default DWM. Similar in effect to Photoshop CS6, or Steam or the New Spotify. One method I know of is handle the WM_NCCALCSIZE MSG in QtCoreApplication native filtering, but this introduces issues and conflicts with Qt's Borderless windows. So in essence how do I have a titlebar that aero-snaps similar to Photoshop or Steam, while also being draggable?

    edit: I feel that "this question from SO":https://stackoverflow.com/questions/16765561/borderless-window-using-areo-snap-shadow-minimize-animation-and-shake may be of use.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nicky j
      wrote on last edited by
      #2

      I'm not an expert on windows: what is aero-snap? I just made [as in 5 minutes ago] a title bar based on a QToolBar. Its incomplete but the idea is there.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MahdiH
        wrote on last edited by
        #3

        Aero-Snap is the animated glass maximization effect behind the window, and the window then snapping to maximized when you grab it by the title bar and drag to the top. The problem is that when you go borderless you have no "Native" title bar that does that. What WM_NCCALCSIZE does is instead just draw over the title bar if I am not mistaken. I am just trying to find out if there is a Qt version of this instead of me overriding Qt.

        ex: "Youtube":https://www.youtube.com/watch?v=sS7a0xDwvlM

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nicky j
          wrote on last edited by
          #4

          Ok I know what your talking about, just didn't know it was called aero-snap. You learn something new everyday :) ! I don't think Qt has a feature to do that, but I could be wrong.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MahdiH
            wrote on last edited by
            #5

            I am sure there must be some way of doing this? My main target for this project is Windows, but I truly do wish to use Qt instead of trying to use Mono/C# so that I can have Cross-Platform ability.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nicky j
              wrote on last edited by
              #6

              You could try to implement it yourself, but I'm not exactly sure how. Obviously the Aero-Snap feature is not cross platform, so if you go to the effort of implementing it, it will only be usable on windows. But don't let me dissuade you!

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nicky j
                wrote on last edited by
                #7

                check out "this":http://stackoverflow.com/questions/16765561/borderless-window-using-areo-snap-shadow-minimize-animation-and-shake link. It seems that aero snap is only possible when using the windows-provided border

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MahdiH
                  wrote on last edited by
                  #8

                  I am aware of this, but Qt does natively use the Windows Titlebar. I know this has been done using Qt so it is most definitely possible. I am just not sure how to do it...

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    nicky j
                    wrote on last edited by
                    #9

                    Sorry I can't be of much help :( I hope you figure it out!

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lygstate
                      wrote on last edited by
                      #10

                      I have a very good demo for it, even though its pure Win32 API implemented, but I think it's would be your requirements.

                      https://github.com/melak47/BorderlessWindow

                      The following may be the Qt way to solve this problem, but I didn't test it:
                      https://github.com/deimos1877/BorderlessWindow

                      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