Mercurial > hg > svgui
comparison view/Pane.cpp @ 287:cd2492c5fe45
* Add SingleColourLayer to manage colours for layers that have a single
predominant colour (i.e. most of them).
author | Chris Cannam |
---|---|
date | Thu, 12 Jul 2007 16:14:59 +0000 |
parents | 86a112b5b319 |
children | 3101c68a00c1 |
comparison
equal
deleted
inserted
replaced
286:7554ae119882 | 287:cd2492c5fe45 |
---|---|
566 // Profiler profiler("Pane::paintEvent - painting vertical scale", true); | 566 // Profiler profiler("Pane::paintEvent - painting vertical scale", true); |
567 | 567 |
568 // std::cerr << "Pane::paintEvent: calling paint.save() in vertical scale block" << std::endl; | 568 // std::cerr << "Pane::paintEvent: calling paint.save() in vertical scale block" << std::endl; |
569 paint.save(); | 569 paint.save(); |
570 | 570 |
571 paint.setPen(Qt::black); | 571 paint.setPen(getForeground()); |
572 paint.setBrush(Qt::white); | 572 paint.setBrush(getBackground()); |
573 paint.drawRect(0, -1, m_scaleWidth, height()+1); | 573 paint.drawRect(0, -1, m_scaleWidth, height()+1); |
574 | 574 |
575 paint.setBrush(Qt::NoBrush); | 575 paint.setBrush(Qt::NoBrush); |
576 scaleLayer->paintVerticalScale | 576 scaleLayer->paintVerticalScale |
577 (this, paint, QRect(0, 0, m_scaleWidth, height())); | 577 (this, paint, QRect(0, 0, m_scaleWidth, height())); |
748 if (r.x() + r.width() >= llx) { | 748 if (r.x() + r.width() >= llx) { |
749 | 749 |
750 for (size_t i = 0; i < texts.size(); ++i) { | 750 for (size_t i = 0; i < texts.size(); ++i) { |
751 | 751 |
752 if (i + 1 == texts.size()) { | 752 if (i + 1 == texts.size()) { |
753 paint.setPen(Qt::black); | 753 paint.setPen(getForeground()); |
754 } | 754 } |
755 | 755 |
756 drawVisibleText(paint, llx, | 756 drawVisibleText(paint, llx, |
757 lly - fontHeight + fontAscent, | 757 lly - fontHeight + fontAscent, |
758 texts[i], OutlinedText); | 758 texts[i], OutlinedText); |
774 } else if (m_editingSelectionEdge > 0) { | 774 } else if (m_editingSelectionEdge > 0) { |
775 p0 = getXForFrame(m_editingSelection.getStartFrame()); | 775 p0 = getXForFrame(m_editingSelection.getStartFrame()); |
776 } | 776 } |
777 | 777 |
778 paint.save(); | 778 paint.save(); |
779 if (hasLightBackground()) { | 779 paint.setPen(QPen(getForeground(), 2)); |
780 paint.setPen(QPen(Qt::black, 2)); | |
781 } else { | |
782 paint.setPen(QPen(Qt::white, 2)); | |
783 } | |
784 | 780 |
785 //!!! duplicating display policy with View::drawSelections | 781 //!!! duplicating display policy with View::drawSelections |
786 | 782 |
787 if (m_editingSelectionEdge < 0) { | 783 if (m_editingSelectionEdge < 0) { |
788 paint.drawLine(p0, 1, p1, 1); | 784 paint.drawLine(p0, 1, p1, 1); |
854 for (LayerList::iterator vi = m_layers.end(); vi != m_layers.begin(); ) { | 850 for (LayerList::iterator vi = m_layers.end(); vi != m_layers.begin(); ) { |
855 --vi; | 851 --vi; |
856 | 852 |
857 paint.save(); | 853 paint.save(); |
858 | 854 |
859 paint.setPen(Qt::black); | 855 paint.setPen(getForeground()); |
860 paint.setBrush(Qt::white); | 856 paint.setBrush(getBackground()); |
861 paint.drawRect(xorigin, -1, m_scaleWidth, height()+1); | 857 paint.drawRect(xorigin, -1, m_scaleWidth, height()+1); |
862 | 858 |
863 paint.setBrush(Qt::NoBrush); | 859 paint.setBrush(Qt::NoBrush); |
864 (*vi)->paintVerticalScale | 860 (*vi)->paintVerticalScale |
865 (this, paint, QRect(xorigin, 0, m_scaleWidth, height())); | 861 (this, paint, QRect(xorigin, 0, m_scaleWidth, height())); |