wip: meter bar
This commit is contained in:
parent
cdadee58fc
commit
20a82b42d4
9 changed files with 104 additions and 36 deletions
|
|
@ -5,6 +5,31 @@ CustomWidgetEvent<T>::CustomWidgetEvent(QEvent::Type type, T payload) : QEvent(t
|
|||
this->payload = payload;
|
||||
}
|
||||
|
||||
void MeterSlider::paintEvent(QPaintEvent *event) {
|
||||
//Q_D(QSlider);
|
||||
/*
|
||||
* QStylePainter p(this);
|
||||
* QStyleOptionSlider opt;
|
||||
* initStyleOption(&opt);
|
||||
*
|
||||
* opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
|
||||
* //if (d->tickPosition != NoTicks)
|
||||
* // opt.subControls |= QStyle::SC_SliderTickmarks;
|
||||
*
|
||||
* //p.drawComplexControl(QStyle::CC_Slider, opt);
|
||||
*/
|
||||
QSlider::paintEvent(event);
|
||||
|
||||
QStyle *style = QApplication::style();
|
||||
int lol = style->pixelMetric(QStyle::PM_SliderSpaceAvailable);
|
||||
QPainter painter(this);
|
||||
painter.setPen(Qt::blue);
|
||||
painter.setOpacity(1.0);
|
||||
painter.setClipping(false);
|
||||
painter.setCompositionMode(QPainter::CompositionMode::CompositionMode_Source);
|
||||
painter.fillRect(0, (this->height() / 2) - 3, this->width(), 4, Qt::black);
|
||||
}
|
||||
|
||||
void ExtendedCheckBox::customEvent(QEvent* ev) {
|
||||
//QEvent::Type tipo = ev->type();
|
||||
if (ev->type() == (QEvent::Type)CustomQEvent::EndpointDefaultChange) {
|
||||
|
|
@ -106,7 +131,7 @@ void MainWindow::compose() {
|
|||
if (!epw) continue;
|
||||
epw->calculateSize(windowWidth, screenHeight);
|
||||
log_debugcpp("epw loop");
|
||||
log_debugcpp("epw roles: " + print_as_binary((epw->getEndpointHandler()->getRoles())).to_string());
|
||||
log_debugcpp("epw roles: " + print_as_binary((epw->getEndpointHandler()->getRoles())));
|
||||
//std::bitset<sizeof(uint8_t)> content =
|
||||
//content);
|
||||
//varToBitset<sizeof(uint8_t), uint8_t>(epw->getEndpointHandler()->getRoles());
|
||||
|
|
@ -360,7 +385,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent, uint64_t i
|
|||
*/
|
||||
muteButton = new QCheckBox(this);
|
||||
mainLabel = new QLabel(QString::fromStdWString(eph->getName()), this);
|
||||
mainSlider = new QSlider(Qt::Horizontal, this);
|
||||
mainSlider = new MeterSlider(Qt::Horizontal, this);
|
||||
mainVolumeLabel = new QLabel(this);
|
||||
|
||||
if (this->eph->getState() != EndpointState::ENDPOINT_ACTIVE) {
|
||||
|
|
@ -749,6 +774,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
//scrollArea->verticalScrollBar()->setSingleStep(1);
|
||||
|
||||
scrollArea->setStyleSheet("QScrollBar:vertical { width: 4px; }");
|
||||
//scrollArea->setMinimumWidth(500);
|
||||
setCentralWidget(scrollArea);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue