예제 #1
0
void VideoWidget::mouseMoveEvent( QMouseEvent * event )
{
	int target = 0;
	if ( !playing && lastFrame && lastFrame->sample ) {
		for ( int i = 0; i < lastFrame->sample->frames.count(); ++i ) {
			Frame *f = lastFrame->sample->frames[i]->frame ;
			if ( f && f->glOVD ) {
				if ( leftButtonPressed ) {
					if ( ovdTarget > 0 )
						ovdUpdate( lastFrame->sample->frames[i], QPointF( event->pos() ) );
					return;
				}
				if ( event->modifiers() & Qt::ControlModifier ) {
					bool inside = cursorInside( event->pos() );
					if ( inside ) {
						if ( f->glOVD & FilterTransform::SCALE ) {
							setCursor( QCursor(Qt::SizeAllCursor) );
							target = OVDZOOMCENTER;
						}
					}
					else {
						setCursor( QCursor(Qt::PointingHandCursor) );
						target = OVDOUTSIDE;
					}					
				}
				else {
					if ( f->glOVD & FilterTransform::SCALE ) {
						if ( qAbs((ovdPoints[0] - event->pos()).manhattanLength()) < CURSORDISTANCE ) {
							setCursor( QCursor(Qt::SizeAllCursor) );
							target = OVDTOPLEFT;
						}
						else if ( qAbs((ovdPoints[2] - event->pos()).manhattanLength()) < CURSORDISTANCE ) {
							setCursor( QCursor(Qt::SizeAllCursor) );
							target = OVDBOTTOMRIGHT;
						}
						else if ( qAbs((ovdPoints[1] - event->pos()).manhattanLength()) < CURSORDISTANCE ) {
							setCursor( QCursor(Qt::SizeAllCursor) );
							target = OVDTOPRIGHT;
						}
						else if ( qAbs((ovdPoints[3] - event->pos()).manhattanLength()) < CURSORDISTANCE ) {
							setCursor( QCursor(Qt::SizeAllCursor) );
							target = OVDBOTTOMLEFT;
						}
					}
					if ( !target && cursorInside( event->pos() ) ) {
						setCursor( QCursor(Qt::PointingHandCursor) );
						target = OVDINSIDE;
					}
				}
				
				break;
			}
		}
	}
	
	ovdTarget = target;
	if ( ovdTarget == 0 && cursor().shape() != Qt::ArrowCursor )
		setCursor( QCursor(Qt::ArrowCursor) );
}
예제 #2
0
파일: popup.cpp 프로젝트: AdamSC1-ddg/yatc
void Popup::mouseClick(int x, int y) {
    if (cursorInside(x,y)) {
        y -= int(m_pnl.GetY() + m_list.GetY());
        y /= 14;
        if (y < int(items.size()))
            if (items[y]->cb)
                items[y]->cb(items[y]);
    }
    prepareToDie();
}
예제 #3
0
파일: popup.cpp 프로젝트: AdamSC1-ddg/yatc
void Popup::mouseOver(int x, int y) {
    for (std::vector<Popup::Item*>::iterator it = items.begin(); it != items.end(); it++) {
        Popup::Item* pi = *it;

        pi->pnl.SetBGActiveness(false);
    }
    if (cursorInside(x,y)) {
        y -= int(m_pnl.GetY() + m_list.GetY());
        y /= 14;
        if (y < int(items.size()) && items[y]->txt != "-")
            items[y]->pnl.SetBGActiveness(true);
        else if (items[y]->txt != "-") // separator
            printf("Warning: popup tried to highligh nonexisting listitem\n");
    }
}