93 QFont fontText( pPref->getLevel2FontFamily(),
getPointSize( pPref->getFontSize() ) );
96 p.fillRect( ev->rect(), pPref->getColorTheme()->m_windowColor );
103 auto pLayer = pComponent->get_layer( i );
104 if ( pLayer !=
nullptr ) {
113 int nColorScalingWidth = 90;
114 int nColorScaling = 100;
116 QColor layerLabelColor, layerSegmentColor;
121 QString label =
"< - >";
126 auto pLayer = pComponent->get_layer( i );
128 if ( pLayer && nLayers > 0 ) {
129 auto pSample = pLayer->get_sample();
130 if( pSample !=
nullptr) {
131 label = pSample->get_filename();
133 pPref->getColorTheme()->m_accentColor.lighter( 130 );
136 pPref->getColorTheme()->m_buttonRedColor;
140 int x1 = (int)( pLayer->get_start_velocity() * width() );
141 int x2 = (int)( pLayer->get_end_velocity() * width() );
146 static_cast<int>(std::round(
static_cast<float>(nLayer) /
147 static_cast<float>(nLayers) * 2 *
148 static_cast<float>(nColorScalingWidth) ) ) -
149 nColorScalingWidth + 100;
151 pPref->getColorTheme()->m_windowColor.lighter( nColorScaling );
153 p.fillRect( x1, 0, x2 - x1, 19, layerLabelColor );
154 p.setPen( pPref->getColorTheme()->m_windowTextColor );
155 p.setFont( fontButton );
156 p.drawText( x1, 0, x2 - x1, 20, Qt::AlignCenter, QString(
"%1").arg( i + 1 ) );
159 p.setPen( pPref->getColorTheme()->m_highlightColor );
161 p.setPen( pPref->getColorTheme()->m_windowTextColor.darker( 145 ) );
163 p.drawRect( x1, 1, x2 - x1 - 1, 18 );
167 pPref->getColorTheme()->m_windowColor );
175 pPref->getColorTheme()->m_windowColor );
181 pPref->getColorTheme()->m_windowColor );
187 pPref->getColorTheme()->m_windowColor );
189 QColor layerTextColor = pPref->getColorTheme()->m_windowTextColor;
190 layerTextColor.setAlpha( 155 );
191 p.setPen( layerTextColor );
192 p.setFont( fontText );
193 p.drawText( 10, y, width() - 10, 20, Qt::AlignLeft, QString(
"%1: %2" ).arg( i + 1 ).arg( label ) );
194 p.setPen( layerTextColor.darker( 145 ) );
199 p.setPen( pPref->getColorTheme()->m_highlightColor );
253 setCursor( QCursor( Qt::ArrowCursor ) );
270 int x1 = (int)( pLayer->get_start_velocity() * width() );
271 int x2 = (int)( pLayer->get_end_velocity() * width() );
273 if ( ( pEv->position().x() < x1 + 5 ) &&
274 ( pEv->position().x() > x1 - 5 ) ){
275 setCursor( QCursor( Qt::SizeHorCursor ) );
278 else if ( ( pEv->position().x() < x2 + 5 ) &&
279 ( pEv->position().x() > x2 - 5 ) ) {
280 setCursor( QCursor( Qt::SizeHorCursor ) );
289 const int nPosition = 0;
296 if ( pEv->position().y() < 20 ) {
297 const float fVelocity = (float)pEv->position().x() / (float)width();
308 auto pLayer = pCompo->get_layer( i );
310 if ( ( fVelocity > pLayer->get_start_velocity()) && ( fVelocity < pLayer->get_end_velocity() ) ) {
329 if( pCompo !=
nullptr ) {
331 if ( pLayer !=
nullptr ) {
332 const float fVelocity = pLayer->get_end_velocity() - 0.01;
337 int x1 = (int)( pLayer->get_start_velocity() * width() );
338 int x2 = (int)( pLayer->get_end_velocity() * width() );
340 if ( ( pEv->position().x() < x1 + 5 ) && ( pEv->position().x() > x1 - 5 ) ){
341 setCursor( QCursor( Qt::SizeHorCursor ) );
346 else if ( ( pEv->position().x() < x2 + 5 ) && ( pEv->position().x() > x2 - 5 ) ){
347 setCursor( QCursor( Qt::SizeHorCursor ) );
353 setCursor( QCursor( Qt::ArrowCursor ) );
369 int y = pEv->position().y();
371 float fVel = (float)x / (
float)width();
387 bool bChanged =
false;
389 if ( fVel < pLayer->get_end_velocity()) {
390 pLayer->set_start_velocity( fVel );
396 if ( fVel > pLayer->get_start_velocity()) {
397 pLayer->set_end_velocity( fVel );
417 int x1 = (int)( pLayer->get_start_velocity() * width() );
418 int x2 = (int)( pLayer->get_end_velocity() * width() );
420 if ( ( x < x1 + 5 ) && ( x > x1 - 5 ) ){
421 setCursor( QCursor( Qt::SizeHorCursor ) );
424 else if ( ( x < x2 + 5 ) && ( x > x2 - 5 ) ){
425 setCursor( QCursor( Qt::SizeHorCursor ) );
429 setCursor( QCursor( Qt::ArrowCursor ) );
430 QToolTip::hideText();
434 setCursor( QCursor( Qt::ArrowCursor ) );
435 QToolTip::hideText();
439 setCursor( QCursor( Qt::ArrowCursor ) );
440 QToolTip::hideText();