From: Joel Holdsworth Date: Sun, 6 Sep 2015 23:57:54 +0000 (-0600) Subject: LogicSignal: Replaced SignalMargin with half font-height X-Git-Tag: pulseview-0.3.0~73 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ab6d2eabbab741cd9233cf731f22faaae621fc8a;p=pulseview.git LogicSignal: Replaced SignalMargin with half font-height --- diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 573d1b78..2967147f 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -25,6 +25,7 @@ #include +#include #include #include @@ -60,7 +61,6 @@ namespace pv { namespace view { const int LogicSignal::SignalHeight = 30; -const int LogicSignal::SignalMargin = 10; const float LogicSignal::Oversampling = 2.0f; @@ -147,7 +147,9 @@ void LogicSignal::set_logic_data(std::shared_ptr data) std::pair LogicSignal::v_extents() const { - return make_pair(-SignalHeight - SignalMargin, SignalMargin); + const int signal_margin = + QFontMetrics(QApplication::font()).height() / 2; + return make_pair(-SignalHeight - signal_margin, signal_margin); } int LogicSignal::scale_handle_offset() const diff --git a/pv/view/logicsignal.hpp b/pv/view/logicsignal.hpp index 71dcc036..63d2ec4a 100644 --- a/pv/view/logicsignal.hpp +++ b/pv/view/logicsignal.hpp @@ -52,7 +52,6 @@ class LogicSignal : public Signal private: static const int SignalHeight; - static const int SignalMargin; static const float Oversampling;