void FloatingWidget::showOver(QWidget * widget, int size, Place place) { qDebug("FloatingWidget::showOver"); int w = widget->width() * size / 100; int h = height(); resize( w, h ); //qDebug("widget x: %d, y: %d, h: %d, w: %d", widget->x(), widget->y(), widget->width(), widget->height()); int x = (widget->width() - width() ) / 2; int y; if (place == Top) y = 0 + _margin; else y = widget->height() - height() - _margin; QPoint p = widget->mapToGlobal(QPoint(x, y)); //qDebug("FloatingWidget::showOver: x: %d, y: %d, w: %d, h: %d", x, y, w, h); //qDebug("FloatingWidget::showOver: global x: %d global y: %d", p.x(), p.y()); move(p); if (isAnimated()) { Movement m = Upward; if (place == Top) m = Downward; showAnimated(p, m); } else { show(); } }
void TabPreview::show() { if (!isVisible() && m_animationsEnabled) { showAnimated(); } QFrame::show(); }
void TabPreview::showOnRect(const QRect &r) { if (m_animation.state() == QTimeLine::Running) { m_animation.stop(); } m_startGeometry = geometry(); bool wasVisible = isVisible(); QRect finishingGeometry; resize(QSize(250, 170)); QFrame::show(); if (m_pixmapLabel->isVisible()) { m_title->setWordWrap(false); m_title->setText(m_title->fontMetrics().elidedText(m_title->text(), Qt::ElideRight, 240)); QSize previewSize(250, 170); finishingGeometry = QRect(calculatePosition(r, previewSize), previewSize); } else { m_title->setWordWrap(true); QSize previewSize = sizeHint(); previewSize.setWidth(qMin(previewSize.width() + 2 * 5, 240)); previewSize.setHeight(qMin(previewSize.height() + 2 * 5, 130)); finishingGeometry = QRect(calculatePosition(r, previewSize), previewSize); } #ifdef ENABLE_OPACITY_EFFECT if (!m_animationsEnabled) { m_opacityEffect.setOpacity(1.0); #else if (!m_animationsEnabled || !wasVisible) { #endif QFrame::setGeometry(finishingGeometry); return; } else { showAnimated(); } if (!wasVisible) { m_startGeometry = finishingGeometry; } QFrame::setGeometry(m_startGeometry); calculateSteps(m_startGeometry, finishingGeometry); m_animation.start(); } #ifdef ENABLE_OPACITY_EFFECT void TabPreview::setOpacity(int opacity) { m_opacityEffect.setOpacity(opacity / 100.0); }
void TabPreview::showOnRect(const QRect &r) { if (m_animation->state() == QPropertyAnimation::Running) { m_animation->stop(); } QRect oldGeometry = geometry(); bool wasVisible = isVisible(); resize(QSize(250, 170)); QFrame::show(); QRect finishingGeometry; if (m_pixmap->isVisible()) { m_title->setWordWrap(false); m_title->setText(m_title->fontMetrics().elidedText(m_title->text(), Qt::ElideRight, 240)); QSize previewSize(250, 170); finishingGeometry = QRect(calculatePosition(r, previewSize), previewSize); } else { m_title->setWordWrap(true); QSize previewSize = sizeHint(); previewSize.setWidth(qMin(previewSize.width() + 2 * 5, 240)); previewSize.setHeight(qMin(previewSize.height() + 2 * 5, 130)); finishingGeometry = QRect(calculatePosition(r, previewSize), previewSize); } if (!m_animationsEnabled) { m_opacityEffect->setOpacity(1.0); QFrame::setGeometry(finishingGeometry); return; } else { showAnimated(); } if (!wasVisible) { oldGeometry = finishingGeometry; } setFinishingGeometry(oldGeometry, finishingGeometry); m_animation->start(); }
void InnerDropdown::showAnimated(PanelAnimation::Origin origin) { setOrigin(origin); showAnimated(); }
void InnerDropdown::otherEnter() { if (_autoHiding) { showAnimated(_origin); } }
void InnerDropdown::enterEventHook(QEvent *e) { if (_autoHiding) { showAnimated(_origin); } return RpWidget::enterEventHook(e); }
void InnerDropdown::otherEnter() { showAnimated(_origin); }
void InnerDropdown::enterEventHook(QEvent *e) { showAnimated(_origin); return TWidget::enterEventHook(e); }