comparison view/View.cpp @ 339:ac954fc0ec6f

* Fix #1844539 confusing waveform navigator with secondary files
author Chris Cannam
date Wed, 12 Dec 2007 17:42:23 +0000
parents 1d3b27e69bf0
children 94ada7dbae3c
comparison
equal deleted inserted replaced
338:1d3b27e69bf0 339:ac954fc0ec6f
520 520
521 m_progressBars[layer] = new LayerProgressBar(this); 521 m_progressBars[layer] = new LayerProgressBar(this);
522 m_progressBars[layer]->setMinimum(0); 522 m_progressBars[layer]->setMinimum(0);
523 m_progressBars[layer]->setMaximum(100); 523 m_progressBars[layer]->setMaximum(100);
524 m_progressBars[layer]->setMinimumWidth(80); 524 m_progressBars[layer]->setMinimumWidth(80);
525
525 QFont f(m_progressBars[layer]->font()); 526 QFont f(m_progressBars[layer]->font());
526 f.setPointSize(Preferences::getInstance()->getViewFontSize()); 527 int fs = Preferences::getInstance()->getViewFontSize();
528 f.setPointSize(std::min(fs, int(ceil(fs * 0.85))));
529
527 m_progressBars[layer]->setFont(f); 530 m_progressBars[layer]->setFont(f);
528 m_progressBars[layer]->hide(); 531 m_progressBars[layer]->hide();
529 532
530 connect(layer, SIGNAL(layerParametersChanged()), 533 connect(layer, SIGNAL(layerParametersChanged()),
531 this, SLOT(layerParametersChanged())); 534 this, SLOT(layerParametersChanged()));
1396 if (i->second->isVisible()) { 1399 if (i->second->isVisible()) {
1397 ph -= i->second->height(); 1400 ph -= i->second->height();
1398 } 1401 }
1399 } 1402 }
1400 } 1403 }
1404 }
1405
1406 void
1407 View::setPaintFont(QPainter &paint)
1408 {
1409 QFont font(paint.font());
1410 font.setPointSize(Preferences::getInstance()->getViewFontSize());
1411 paint.setFont(font);
1401 } 1412 }
1402 1413
1403 void 1414 void
1404 View::paintEvent(QPaintEvent *e) 1415 View::paintEvent(QPaintEvent *e)
1405 { 1416 {
1583 1594
1584 if (!paintedCacheRect) { 1595 if (!paintedCacheRect) {
1585 1596
1586 if (repaintCache) paint.begin(m_cache); 1597 if (repaintCache) paint.begin(m_cache);
1587 else paint.begin(this); 1598 else paint.begin(this);
1588 1599 setPaintFont(paint);
1589 QFont font(paint.font());
1590 font.setPointSize(Preferences::getInstance()->getViewFontSize());
1591 paint.setFont(font);
1592
1593 paint.setClipRect(cacheRect); 1600 paint.setClipRect(cacheRect);
1594 1601
1595 paint.setPen(getBackground()); 1602 paint.setPen(getBackground());
1596 paint.setBrush(getBackground()); 1603 paint.setBrush(getBackground());
1597 paint.drawRect(cacheRect); 1604 paint.drawRect(cacheRect);
1628 1635
1629 nonCacheRect |= cacheRect; 1636 nonCacheRect |= cacheRect;
1630 1637
1631 paint.begin(this); 1638 paint.begin(this);
1632 paint.setClipRect(nonCacheRect); 1639 paint.setClipRect(nonCacheRect);
1633 1640 setPaintFont(paint);
1634 QFont font(paint.font());
1635 font.setPointSize(Preferences::getInstance()->getViewFontSize());
1636 paint.setFont(font);
1637
1638 if (scrollables.empty()) { 1641 if (scrollables.empty()) {
1639 paint.setPen(getBackground()); 1642 paint.setPen(getBackground());
1640 paint.setBrush(getBackground()); 1643 paint.setBrush(getBackground());
1641 paint.drawRect(nonCacheRect); 1644 paint.drawRect(nonCacheRect);
1642 } 1645 }
1650 } 1653 }
1651 1654
1652 paint.end(); 1655 paint.end();
1653 1656
1654 paint.begin(this); 1657 paint.begin(this);
1658 setPaintFont(paint);
1655 if (e) paint.setClipRect(e->rect()); 1659 if (e) paint.setClipRect(e->rect());
1656 if (!m_selectionCached) { 1660 if (!m_selectionCached) {
1657 drawSelections(paint); 1661 drawSelections(paint);
1658 } 1662 }
1659 paint.end(); 1663 paint.end();