Tooltips to QML: PlasmaCore.Dialog questions
Mark
markg85 at gmail.com
Mon Jun 18 12:41:20 UTC 2012
On Mon, Jun 18, 2012 at 1:52 PM, Marco Martin <notmart at gmail.com> wrote:
> On Monday 18 June 2012, Mark wrote:
>>
>> Here is what's wrong with it.
>> 1. I "need" to use the popupPosition function. But for which purpose?
>> I can perfectly align my tooltip using X and Y based on the component.
>> Actually, my earlier issue of having a default 100x100 sized dialog is
>> because i wasn't using popupPosition! Yeah, go figure that one out. I
>> just don't like the fact that i need to use that function. What i am
>> doing right now is calling popupPosition (because it has to be done)
>> then just use my own X and Y since the popupPosition isn't even
>> working as i want it. So yeah, i'm really doing
>> dialog.popupPosition(null, Qt.AlignCenter) because i have to..
>
> yes, this function is ugly, however, let's backtrack a bit to see why it does
> exists:
> this is about positioning an x11 top level window on screen, coordinates you
> have no idea in qml because they don't have a relationship with the position x
> and y of an item or even the position mapped to the scene coordinates, so you
> need somebody that tells you a "correct" position
> that has also to take into accound problems like actially fitting into the
> screen (and not cut a piece away), popping up in the right screen, taking into
> account extended struts to take panels into account.
>
> that's why as soon you touch an x11 window things get ugly ;)
I fully understand your case and it makes sense. No issue about that.
The issue i have have is that i simply don't have an Item object to
run popupPosition against! What i'm getting is just a simple QRect
with the position of where a given widget is positioned that should
have a Dialog on top of it. Then i manually calculate the position in
QML with this exact code: http://paste.kde.org/502508/
Now i could go a few ways here.
- Don't send the QRect to QML, but send the QGraphicsWidget to QML
which seems to be very well hidden. I won't say it's impossible
because nothing is in C++, but it certainly is very difficult and
something i'd like to prevent
- Calculate the stuff mentioned in the above paste link in C++ (will
need to do that anyway) and just send the X and Y to QML but that
still leaves me without any Item objet to pass in popupPosition.
In my case i simply don't need popupPosition and i don't even have a
use for it. What i would really like is if PlasmaCore.Dialog could
start working without that function. That would really help me.
>
>> 2. This is a very important one which is not possible in the current
>> dialog. When you hover your taskbar to some element that has a bigger
>> tooltip (like the network manager icon) i want the tooltip to resize
>> in an animated way. That's not possible because width and height are
>> read-only!
>
> resizing X11 windows is quite slow (and asynchronous, even), so accessing it
> directly from qml would have quite slow and cpu intensive results.
> until wayland the only possibility would be approximating smooth resizing with
> a kwin plugin
Right, so this one is probably impossible in it's current form.
Unless we make the window the full vertical screen height and simply
position a QML element inside it. That would be very nasty but make
the animation fluid without the need to resize the window. I don't
know how feasible this option is.
>
>> 3. The margin stuff that's done somewhere in the dialog C++ side is
>> not always working correctly when you animate the dialog. For
>> instance, my dialog is the right size, but when animation it kinda
>> "jumps" just when the animation is done thus screwing the layout!
>> 4. The way that i need to set a "main item" inside the
>> PlasmaCore.Dialog looks really really really ugly!
>>
>> So here we are again. I'm still working on the same issue and the darn
>> popup dialog thing with it's custom security measures to prevent full
>> screen stuff is really irritating me! So i would like to ask - again!
>> - to allow me to implement the Window in QML just like it is in Qt
>> Desktop Components and add it to probably QtExtraComponents. Right now
>> these dialog issues are blocking me to continue since it's not that
>> obvious when i hit another snag if it's in the dialog (again) or in my
>> code.
>
> seriously, top level windows are too hard to get right if any kind of control
> is given:
> * the window background has to be done in the c++ part: it needs to change svg
> if composite is off, and in this case to set a window mask to get the window
> shape right (no usecase without compositing isn't going to be dropped as long
> as we are on X11)
> * window positioning is hard to get right: it has zero relationship with scene
> positioning of the items and has some corner cases to get right multimonitor
> and extended struts
> * plasma components are mostly for plasmoids, where creation of windows is a
> corner use case, normally they just should not. Again, they are not for
> desktop applications, something else would be needed. I know that at the
> moment there isn't any solution we can depend of to do desktop applications,
> but doesn't change the scope of qml in plasma (that is a limited subset of the
> use of qml in the future)
>
>> I understand that you guys (marco only?) want to prevent abusive
>> applications popping up that make fullscreen plasmoids, but that
>> argument is really faulty. I already made a fullscreen dialog just to
>> see if it's possible. Obviously it is and it's easy once you know how
>> to. You can make it as hard as possible like it is now, but that is
>> really making it limited (and ugly) for other real world usages like
>> these tooltips.
>>
>> Lastly, i noticed there is a PlasmaCore.Dialog and a
>> PlasmaComponents.Dialog ... Does anyone know what the difference is
>> and why there are 2 of them? I also added
>
> yep, that sucks (but reading documentation of them helps :p)
> after Dialog was binded in plasmacore, qtcomponents got a standard-ish Dialog
> component, but that one is higher level:
> it's a message dialog with optional ok/cancel buttons, titlebar and what not
>
> --
> Marco Martin
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
More information about the Plasma-devel
mailing list