Tooltips to QML: PlasmaCore.Dialog questions
Marco Martin
notmart at gmail.com
Mon Jun 18 11:52:07 UTC 2012
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 ;)
> 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
> 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
More information about the Plasma-devel
mailing list