Mercurial > hg > svgui
comparison view/View.cpp @ 1351:9fb7133dd818
Scale positioning
author | Chris Cannam |
---|---|
date | Wed, 03 Oct 2018 12:59:55 +0100 |
parents | 5ac1c323ac55 |
children | 86429ff00f05 |
comparison
equal
deleted
inserted
replaced
1350:5ac1c323ac55 | 1351:9fb7133dd818 |
---|---|
571 pb->setTextVisible(false); | 571 pb->setTextVisible(false); |
572 | 572 |
573 QPushButton *cancel = new QPushButton(this); | 573 QPushButton *cancel = new QPushButton(this); |
574 cancel->setIcon(IconLoader().load("cancel")); | 574 cancel->setIcon(IconLoader().load("cancel")); |
575 cancel->setFlat(true); | 575 cancel->setFlat(true); |
576 cancel->setFixedSize(QSize(20, 20)); | 576 int scaled20 = ViewManager::scalePixelSize(20); |
577 cancel->setFixedSize(QSize(scaled20, scaled20)); | |
577 connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked())); | 578 connect(cancel, SIGNAL(clicked()), this, SLOT(cancelClicked())); |
578 | 579 |
579 ProgressBarRec pbr; | 580 ProgressBarRec pbr; |
580 pbr.cancel = cancel; | 581 pbr.cancel = cancel; |
581 pbr.bar = pb; | 582 pbr.bar = pb; |
1576 i->second.lastCheck = 0; | 1577 i->second.lastCheck = 0; |
1577 timer->setInterval(2000); | 1578 timer->setInterval(2000); |
1578 timer->start(); | 1579 timer->start(); |
1579 } | 1580 } |
1580 | 1581 |
1581 cancel->move(0, ph - pb->height()/2 - 10); | 1582 int scaled20 = ViewManager::scalePixelSize(20); |
1583 | |
1584 cancel->move(0, ph - pb->height()/2 - scaled20/2); | |
1582 cancel->show(); | 1585 cancel->show(); |
1583 | 1586 |
1584 pb->setValue(completion); | 1587 pb->setValue(completion); |
1585 pb->move(20, ph - pb->height()); | 1588 pb->move(scaled20, ph - pb->height()); |
1586 | 1589 |
1587 pb->show(); | 1590 pb->show(); |
1588 pb->update(); | 1591 pb->update(); |
1589 | 1592 |
1590 ph -= pb->height(); | 1593 ph -= pb->height(); |