Results 1 to 6 of 6

Thread: [Partially-Solved] Making a window snap to the desktop's borders(& resize desktop)

  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [Partially-Solved] Making a window snap to the desktop's borders(& resize desktop)

    Hi guys!

    Here it comes, my first post out of hopefully many more:

    I want to write a sort of Statbar, that snaps to one of the desktop's borders and decreases the size of the remaining desktop for other applications.

    How would you go about doing that?

    PS: another little question: is it easy to make QT windows transparent/translucent?

    Thanks for the reply

    Greets from Cape Town
    Rainer
    Last edited by rdrey; 30th January 2009 at 11:21. Reason: updated contents

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Making a window snap to the desktop's borders

    and decreases the size of the remaining desktop for other applications.
    didnt get that.

    As for snapping to desktop corner, u can catch QWidget::moveEvent and set position of widget accordingly.

    PS: another little question: is it easy to make QT windows transparent/translucent?
    This little question has big and complex answers. Search forum.
    For simple use see QWidget::setWindowOpacity

  3. #3
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Making a window snap to the desktop's borders

    Thanks for the quick answer!

    and decreases the size of the remaining desktop for other applications.
    When other windows get maximized for example, they shouldn't overlap the bar. The bar is not just "always ontop", it also restricts other apps from fully maximizing.

    Any idea how to achieve that effect?

    Can also be observed in AWN in linux. (Maximized apps don't fill the AWN dock area)

    EDIT: I had thought of using a move function, what do I query to figure out the desktop's dimension and the window's position on the desktop?
    Last edited by rdrey; 30th January 2009 at 10:46. Reason: updated contents

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Making a window snap to the desktop's borders

    I dont think it will be easy. That functionality is of window manager.
    It will be tedious if you wanna have your control.

    Also it wont be platform specific I guess

  5. #5
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Making a window snap to the desktop's borders

    Thanks, I had hoped that Qt has a nifty bar window class somewhere. I guess I'll have a look at how AWN does it in linux, and a friend of mine wrote a statbar for windows, that I can look at.

  6. #6
    Join Date
    Jan 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Partially-Solved] Making a window snap to the desktop's borders(& resize desktop

    <bump>

    Anyone found anything that can manipulate the desktop's size?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.