markers: no tooltips for metric markers

This commit is contained in:
Paul Davis 2023-07-25 22:31:00 -06:00
parent 16dfb95617
commit 1f5db4234c
2 changed files with 16 additions and 12 deletions

View file

@ -82,7 +82,7 @@ ArdourMarker::color (std::string const& color_name)
ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::string const& color_name, string const& annotation,
Type type, timepos_t const & pos, bool handle_events, RegionView* rv)
Type type, timepos_t const & pos, bool handle_events, RegionView* rv, bool use_tooltip)
: editor (ed)
, _parent (&parent)
@ -92,6 +92,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::s
, _entered (false)
, _shown (false)
, _line_shown (false)
, _use_tooltip (use_tooltip)
, _color (color_name)
, _points_color (color_name)
, _left_label_limit (DBL_MAX)
@ -503,15 +504,17 @@ ArdourMarker::set_name (const string& new_name, const string& tooltip)
{
_name = new_name;
_pcue->set_tooltip (new_name);
_pmark->set_tooltip (new_name);
if (_name_flag) {
_name_flag->set_tooltip (new_name);
}
if (tooltip.empty()) {
_name_item->set_tooltip (new_name);
} else {
_name_item->set_tooltip (tooltip);
if (_use_tooltip) {
_pcue->set_tooltip (new_name);
_pmark->set_tooltip (new_name);
if (_name_flag) {
_name_flag->set_tooltip (new_name);
}
if (tooltip.empty()) {
_name_item->set_tooltip (new_name);
} else {
_name_item->set_tooltip (tooltip);
}
}
setup_name_display ();
@ -738,7 +741,7 @@ ArdourMarker::set_right_label_limit (double p)
MetricMarker::MetricMarker (PublicEditor& ed, ArdourCanvas::Item& parent, std::string const& color_name, const string& annotation,
Type type, timepos_t const & pos, bool handle_events)
: ArdourMarker (ed, parent, color_name, annotation, type, pos, false)
: ArdourMarker (ed, parent, color_name, annotation, type, pos, false, nullptr, false)
{
}

View file

@ -76,7 +76,7 @@ public:
ArdourMarker (PublicEditor& editor, ArdourCanvas::Item &, std::string const& color_name, std::string const& text, Type,
Temporal::timepos_t const & position, bool handle_events = true, RegionView* rv = 0);
Temporal::timepos_t const & position, bool handle_events = true, RegionView* rv = nullptr, bool use_tooltip = true);
virtual ~ArdourMarker ();
@ -151,6 +151,7 @@ protected:
bool _entered;
bool _shown;
bool _line_shown;
bool _use_tooltip;
std::string _color;
std::string _points_color;