Moved RulerHeight out of View into Ruler
[pulseview.git] / pv / view / decodetrace.cpp
index 1d5a62684fddea143db3a8c2ee23d82793ac320c..2d641827f13bbd8416f09baa62f74c18cdce5a47 100644 (file)
@@ -27,6 +27,7 @@ extern "C" {
 #include <boost/foreach.hpp>
 
 #include <QAction>
+#include <QApplication>
 #include <QComboBox>
 #include <QFormLayout>
 #include <QLabel>
@@ -107,7 +108,7 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right)
        const double scale = _view->scale();
        assert(scale > 0);
 
-       double samplerate = _decoder_stack->get_samplerate();
+       double samplerate = _decoder_stack->samplerate();
 
        // Show sample rate as 1Hz when it is unknown
        if (samplerate == 0.0)
@@ -117,7 +118,8 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right)
                _decoder_stack->get_start_time()) / scale;
        const double samples_per_pixel = samplerate * scale;
 
-       const int h = (_text_size.height() * 5) / 4;
+       QFontMetrics m(QApplication::font());
+       const int h = (m.boundingRect(QRect(), 0, "Tg").height() * 5) / 4;
 
        assert(_decoder_stack);
        const QString err = _decoder_stack->error_message();