Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 234:b4809e942e7d
* Russian update from Alexandre, and a couple of i18n fixes
author | Chris Cannam |
---|---|
date | Mon, 02 Apr 2007 12:12:36 +0000 |
parents | 9465b5375235 |
children | 28c8e8e3c537 |
comparison
equal
deleted
inserted
replaced
233:8c00a4d4fc69 | 234:b4809e942e7d |
---|---|
2657 int tw = paint.fontMetrics().width(QString("%1") | 2657 int tw = paint.fontMetrics().width(QString("%1") |
2658 .arg(m_maxFrequency > 0 ? | 2658 .arg(m_maxFrequency > 0 ? |
2659 m_maxFrequency - 1 : | 2659 m_maxFrequency - 1 : |
2660 m_model->getSampleRate() / 2)); | 2660 m_model->getSampleRate() / 2)); |
2661 | 2661 |
2662 int fw = paint.fontMetrics().width(QString("43Hz")); | 2662 int fw = paint.fontMetrics().width(tr("43Hz")); |
2663 if (tw < fw) tw = fw; | 2663 if (tw < fw) tw = fw; |
2664 | 2664 |
2665 int tickw = (m_frequencyScale == LogFrequencyScale ? 10 : 4); | 2665 int tickw = (m_frequencyScale == LogFrequencyScale ? 10 : 4); |
2666 | 2666 |
2667 return cw + tickw + tw + 13; | 2667 return cw + tickw + tw + 13; |
2802 } | 2802 } |
2803 continue; | 2803 continue; |
2804 } | 2804 } |
2805 | 2805 |
2806 QString text = QString("%1").arg(freq); | 2806 QString text = QString("%1").arg(freq); |
2807 if (bin == 1) text = QString("%1Hz").arg(freq); // bin 0 is DC | 2807 if (bin == 1) text = tr("%1Hz").arg(freq); // bin 0 is DC |
2808 paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); | 2808 paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); |
2809 | 2809 |
2810 if (h - vy - textHeight >= -2) { | 2810 if (h - vy - textHeight >= -2) { |
2811 int tx = w - 3 - paint.fontMetrics().width(text) - std::max(tickw, pkw); | 2811 int tx = w - 3 - paint.fontMetrics().width(text) - std::max(tickw, pkw); |
2812 paint.drawText(tx, h - vy + toff, text); | 2812 paint.drawText(tx, h - vy + toff, text); |