From: Joel Holdsworth Date: Sun, 6 Sep 2015 23:57:54 +0000 (-0600) Subject: LogicSignal: Replaced SignalMargin with half font-height X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;ds=inline;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 573d1b7..2967147 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 71dcc03..63d2ec4 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;