void KPassivePopup::setVisible( bool visible ) { if (! visible ) { QFrame::setVisible( visible ); return; } if ( size() != sizeHint() ) resize( sizeHint() ); if ( d->fixedPosition.isNull() ) positionSelf(); else { if( d->popupStyle == Balloon ) setAnchor( d->fixedPosition ); else move( d->fixedPosition ); } QFrame::setVisible( /*visible=*/ true ); int delay = d->hideDelay; if ( delay < 0 ) { delay = DEFAULT_POPUP_TIME; } if ( delay > 0 ) { d->hideTimer->start( delay ); } }
void Tooltip::setTargetWindow(Window* wnd) { if (!wnd) { d_target = wnd; } else if (wnd != this) { if (d_target != wnd) { wnd->getGUIContext().getRootWindow()->addChild(this); d_target = wnd; } // set text to that of the tooltip text of the target setText(wnd->getTooltipText()); // set size and position of the tooltip window. sizeSelf(); positionSelf(); } resetTimer(); if (d_active) { WindowEventArgs args(this); onTooltipTransition(args); } }
void KasPopup::show() { emit aboutToShow(); positionSelf(); QWidget::show(); emit shown(); }
void Tooltip::switchToActiveState(void) { positionSelf(); show(); d_active = true; d_elapsed = 0; WindowEventArgs args(this); onTooltipActive(args); }
void Tooltip::onTextChanged(WindowEventArgs& e) { // base class processing Window::onTextChanged(e); // set size and position of the tooltip window to consider new text sizeSelf(); positionSelf(); // we do not signal we handled it, in case user wants to hear // about text changes too. }
void Tooltip::switchToFadeInState(void) { positionSelf(); d_state = FadeIn; d_elapsed = 0; show(); // fire event. Not really active at the moment, but this is the "right" time // for this event (just prior to anything getting displayed). WindowEventArgs args(this); onTooltipActive(args); }
void Tooltip::setTargetWindow(Window* wnd) { if (!wnd) { d_target = wnd; } else if (wnd != this) { if (d_target != wnd) { System::getSingleton().getGUISheet()->addChildWindow(this); d_target = wnd; } // set text to that of the tooltip text of the target setText(wnd->getTooltipText()); // set size and potition of the tooltip window. sizeSelf(); positionSelf(); } resetTimer(); }
void Tooltip::onCursorEnters(CursorInputEventArgs& e) { positionSelf(); Window::onCursorEnters(e); }
void Tooltip::onMouseEnters(MouseEventArgs& e) { positionSelf(); Window::onMouseEnters(e); }
void KRandrPassivePopup::slotPositionSelf() { positionSelf(); }