92 QFont fontText( pPref->getLevel2FontFamily(),
getPointSize( pPref->getFontSize() ) );
95 p.fillRect( ev->rect(), pPref->getColorTheme()->m_windowColor );
102 auto pLayer = pComponent->get_layer( i );
103 if ( pLayer !=
nullptr ) {
112 int nColorScalingWidth = 90;
113 int nColorScaling = 100;
115 QColor layerLabelColor, layerSegmentColor;
120 QString label =
"< - >";
125 auto pLayer = pComponent->get_layer( i );
127 if ( pLayer && nLayers > 0 ) {
128 auto pSample = pLayer->get_sample();
129 if( pSample !=
nullptr) {
130 label = pSample->get_filename();
132 pPref->getColorTheme()->m_accentColor.lighter( 130 );
135 pPref->getColorTheme()->m_buttonRedColor;
139 int x1 = (int)( pLayer->get_start_velocity() * width() );
140 int x2 = (int)( pLayer->get_end_velocity() * width() );
145 static_cast<int>(std::round(
static_cast<float>(nLayer) /
146 static_cast<float>(nLayers) * 2 *
147 static_cast<float>(nColorScalingWidth) ) ) -
148 nColorScalingWidth + 100;
150 pPref->getColorTheme()->m_windowColor.lighter( nColorScaling );
152 p.fillRect( x1, 0, x2 - x1, 19, layerLabelColor );
153 p.setPen( pPref->getColorTheme()->m_windowTextColor );
154 p.setFont( fontButton );
155 p.drawText( x1, 0, x2 - x1, 20, Qt::AlignCenter, QString(
"%1").arg( i + 1 ) );
158 p.setPen( pPref->getColorTheme()->m_highlightColor );
160 p.setPen( pPref->getColorTheme()->m_windowTextColor.darker( 145 ) );
162 p.drawRect( x1, 1, x2 - x1 - 1, 18 );
166 pPref->getColorTheme()->m_windowColor );
174 pPref->getColorTheme()->m_windowColor );
180 pPref->getColorTheme()->m_windowColor );
186 pPref->getColorTheme()->m_windowColor );
188 QColor layerTextColor = pPref->getColorTheme()->m_windowTextColor;
189 layerTextColor.setAlpha( 155 );
190 p.setPen( layerTextColor );
191 p.setFont( fontText );
192 p.drawText( 10, y, width() - 10, 20, Qt::AlignLeft, QString(
"%1: %2" ).arg( i + 1 ).arg( label ) );
193 p.setPen( layerTextColor.darker( 145 ) );
198 p.setPen( pPref->getColorTheme()->m_highlightColor );
284 const int nPosition = 0;
289 if ( ev->y() < 20 ) {
290 const float fVelocity = (float)ev->x() / (float)width();
301 auto pLayer = pCompo->get_layer( i );
303 if ( ( fVelocity > pLayer->get_start_velocity()) && ( fVelocity < pLayer->get_end_velocity() ) ) {
322 if( pCompo !=
nullptr ) {
324 if ( pLayer !=
nullptr ) {
325 const float fVelocity = pLayer->get_end_velocity() - 0.01;
330 int x1 = (int)( pLayer->get_start_velocity() * width() );
331 int x2 = (int)( pLayer->get_end_velocity() * width() );
333 if ( ( ev->x() < x1 + 5 ) && ( ev->x() > x1 - 5 ) ){
334 setCursor( QCursor( Qt::SizeHorCursor ) );
339 else if ( ( ev->x() < x2 + 5 ) && ( ev->x() > x2 - 5 ) ){
340 setCursor( QCursor( Qt::SizeHorCursor ) );
346 setCursor( QCursor( Qt::ArrowCursor ) );
359 int x = ev->pos().x();
360 int y = ev->pos().y();
362 float fVel = (float)x / (
float)width();
378 bool bChanged =
false;
380 if ( fVel < pLayer->get_end_velocity()) {
381 pLayer->set_start_velocity( fVel );
387 if ( fVel > pLayer->get_start_velocity()) {
388 pLayer->set_end_velocity( fVel );
408 int x1 = (int)( pLayer->get_start_velocity() * width() );
409 int x2 = (int)( pLayer->get_end_velocity() * width() );
411 if ( ( x < x1 + 5 ) && ( x > x1 - 5 ) ){
412 setCursor( QCursor( Qt::SizeHorCursor ) );
415 else if ( ( x < x2 + 5 ) && ( x > x2 - 5 ) ){
416 setCursor( QCursor( Qt::SizeHorCursor ) );
420 setCursor( QCursor( Qt::ArrowCursor ) );
421 QToolTip::hideText();
425 setCursor( QCursor( Qt::ArrowCursor ) );
426 QToolTip::hideText();
430 setCursor( QCursor( Qt::ArrowCursor ) );
431 QToolTip::hideText();