cosmetic, fix pan and pitch spinbox, style slider.

This commit is contained in:
snt 2024-05-26 14:40:15 +02:00
parent 029bcdc47e
commit d0f565e1c0
2 changed files with 45 additions and 14 deletions

View file

@ -61,7 +61,7 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, int layer):
m_progress->setFormat("%v / %m");
m_progress->setStyleSheet(
"margin: 0px;"
"font-size: 13px;"
"font-size: 10px;"
"background-color: black;"
);
layout->addWidget(m_progress);
@ -77,6 +77,12 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, int layer):
m_progressTime->setContentsMargins(0,0,0,0);
m_progressTime->setMinimumWidth(MIN_WIDTH);
m_progressTime->setMaximumWidth(MAX_WIDTH);
m_progressTime->setStyleSheet(
"margin: 0px;"
"color: white;"
"background-color: black;"
"font-size: 16px;"
);
m_totalTimeValue = new QTimeEdit;
m_totalTimeValue->setObjectName("Track Length");
m_totalTimeValue->setToolTip("Track Length");
@ -88,6 +94,12 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, int layer):
m_totalTimeValue->setContentsMargins(0,0,0,0);
m_totalTimeValue->setMinimumWidth(MIN_WIDTH);
m_totalTimeValue->setMaximumWidth(MAX_WIDTH);
m_totalTimeValue->setStyleSheet(
"margin: 0px;"
"color: white;"
"background-color: black;"
"font-size: 16px;"
);
QHBoxLayout *status = new QHBoxLayout;
status->addWidget(m_progressTime);
status->addWidget(m_totalTimeValue);
@ -160,7 +172,7 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, int layer):
layout->setContentsMargins(0, 0, 0, 0);
layout->addLayout(labelsBox);
layout->setAlignment(Qt::AlignHCenter);
layout->setSpacing(0);
layout->setSpacing(1);
this->setLayout(layout);
}

View file

@ -18,7 +18,8 @@ SliderGroup::SliderGroup(QString name,
else {
layout = new QHBoxLayout;
slider.setOrientation(Qt::Horizontal);
slider.setMinimumHeight(10);
slider.setMaximumHeight(15);
valueBox.setMaximumHeight(15);
}
layout->setAlignment(Qt::AlignHCenter);
layout->setContentsMargins(0, 0, 0, 0);
@ -32,9 +33,24 @@ SliderGroup::SliderGroup(QString name,
slider.setMinimumWidth(50);
slider.setToolTip(name);
slider.setStyleSheet("QSlider {"
"border: 1px solid #5a4855;"
"border: 1px solid #aa8895;"
"background: #20182d;"
"margin: 0px;}"
);
"QSlider::groove:vertical {"
"border: 1px solid #999999;"
"width: 25px;"
"margin: -4px;}"
"QSlider::handle:vertical {"
"background: white;"
"border: 1px solid #5c5c5c;"
"width: 29px;"
"height: 7px;"
"margin: -2px;"
"border-radius: 2px;}"
"Qslider::tickmarks:vertical {background: white;"
"color: white;}"
"QSlider::add-page:vertical {background: blue;}"
"QSlider::sub-page:vertical {background: #20182d;}");
slider.setContentsMargins(0, 0, 0, 0);
valueBox.setFocusPolicy(Qt::NoFocus);
valueBox.setButtonSymbols(QAbstractSpinBox::NoButtons);
@ -54,10 +70,9 @@ SliderGroup::SliderGroup(QString name,
connect(&valueBox, SIGNAL(click()), this, SLOT(enableSlider()));
layout->addWidget(&slider);
layout->addWidget(&valueBox);
this->setStyleSheet("border: 1px solid #5a4855;"
"width: 60px;"
"margin: 0px;"
"background-color: #383034;"
this->setStyleSheet("border: 1px solid #aa8895;"
"background-color: black;"
"margin: 1px;"
);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
@ -67,11 +82,15 @@ SliderGroup::SliderGroup(QString name,
void SliderGroup::sliderValueChanged(int value)
{
valueBox.blockSignals(true);
if (valueBox.decimals()) {
float db = ((float)value / 771.0f) - 85.0f;
if (db <= -84.5f) {
valueBox.setSpecialValueText("-inf");
} else
valueBox.setValue(db);
} else {
valueBox.setValue(value);
}
valueBox.blockSignals(false);
emit valueChanged(value);
};