PDA

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



rdrey
30th January 2009, 09:09
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

aamer4yu
30th January 2009, 09:45
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

rdrey
30th January 2009, 10:31
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?

aamer4yu
30th January 2009, 10:45
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

rdrey
30th January 2009, 10:48
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.

rdrey
31st January 2009, 07:36
<bump>

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