PDA

View Full Version : An app is hearing you?



fullmetalcoder
11th March 2007, 18:09
If, like me, you follow KDE-related blogs through Akregator (any other feed reader would work as well but Akregator add these feed by default ;)) you may have spotted this article about ears (http://metin.org/weblog/2007/03/06/34/).

I tried the code, palyed with it a little and liked the idea so much that I decided to do some enhancements. I thus removed references to KDE, added header facilities, implemented auto-hiding, made the ear ("external dock" if you prefer) a little nicer by using a QFrame (but still frameless window...) and finally cleaned the code a little and documented it.

The result of my experiments is available in a small package with a very (too?) simple example : http://edyuk.tuxfamily.org/misc/kulak-qt.tar.gz

jpn
27th March 2007, 21:48
Just curious, what happens when main window is maximized? :)

fullmetalcoder
28th March 2007, 14:18
Just curious, what happens when main window is maximized? :)
I've not played with that yet but I guess there would be a few options :

Hiding the so-called "Kulak" widget
Detaching it (would behave just like a detached dock)
Attach it within a dock widget (and hiding the title bar)But maybe you have a better idea ? :p

wysota
28th March 2007, 19:17
Is the "ear" animated? If not, then why? :)

fullmetalcoder
28th March 2007, 19:22
Is the "ear" animated? If not, then why? :)Because I'm not experienced enough to play with animation.... I must also admit that I'm way too lazy and currently kept busy by other tasks...
Anyway nothing prevents a Guru like you from adding the proper code... :p

wysota
28th March 2007, 20:39
Anyway nothing prevents a Guru like you from adding the proper code
1. I don't consider myself a guru
2. Do you think I'm not limited by time? :)

fullmetalcoder
29th March 2007, 09:32
That's what the board says, I'd tend to agree with it and I'm pretty sure many others also would... :)
Everyone is limited on time. However, AFAIK you don't have any big projects under development ATM, do you? :p
There is already some minimalistic animation when hiding the "ear" (smooth move to the center of the main window then hide) but it can be improved (for example gradual hiding using QWidget::setMask(). The only problem here is that I don't know how to generate a proper mask... (which value implies transparency and what's the best way to generate such a dynamic mask...) :o

wysota
29th March 2007, 16:13
Everyone is limited on time. However, AFAIK you don't have any big projects under development ATM, do you? :p
Depends what you consider a project. Actually I have two - one is my PhD studies and responsibilities that go with it and the other is a telecom project I'm taking part in. Apart from that I have three smaller projects, all regarding Qt.


There is already some minimalistic animation when hiding the "ear" (smooth move to the center of the main window then hide) but it can be improved (for example gradual hiding using QWidget::setMask(). The only problem here is that I don't know how to generate a proper mask... (which value implies transparency and what's the best way to generate such a dynamic mask...) :o

Masking is not the way to go. I know how to make the animation as I use such thing in one of my projects. The only problem is to determine the size the widget will have when fully opened. Unfortunately, before the widget is shown for the first time, it doesn't have its size and layout determined. And that makes it hard to prepare the animation. When I manage to solve the problem with my widget, I'm sure I can write an animation effect for your widget in no time.

fullmetalcoder
29th March 2007, 18:17
Depends what you consider a project. Actually I have two - one is my PhD studies and responsibilities that go with it and the other is a telecom project I'm taking part in. Apart from that I have three smaller projects, all regarding Qt.
Beg your forgiveness... You must be quite busy indeed! :eek:



Masking is not the way to go. I know how to make the animation as I use such thing in one of my projects. The only problem is to determine the size the widget will have when fully opened. Unfortunately, before the widget is shown for the first time, it doesn't have its size and layout determined. And that makes it hard to prepare the animation. When I manage to solve the problem with my widget, I'm sure I can write an animation effect for your widget in no time. Nice! But why wouldn't masking fit? How do you want to do gradual hiding without mask or tricky paint event??? Or are you talking about a different animation? :confused:

fullmetalcoder
31st March 2007, 23:28
Masking is not the way to go. I know how to make the animation as I use such thing in one of my projects. The only problem is to determine the size the widget will have when fully opened. Unfortunately, before the widget is shown for the first time, it doesn't have its size and layout determined. And that makes it hard to prepare the animation. When I manage to solve the problem with my widget, I'm sure I can write an animation effect for your widget in no time.
I've just played with the concept of masking and here comes the result : http://edyuk.tuxfamily.org/misc/kulak-qt-animated.tar.gz