From 35b188705087dfa2da324e93accda62955ed776a Mon Sep 17 00:00:00 2001 From: ahlstrom Date: Thu, 22 Aug 2024 10:00:36 -0400 Subject: [PATCH] Add palette coloring to note tooltips. --- doc/latex/tex/pattern_editor.tex | 11 ++++++++++- seq_qt5/include/qseqroll.hpp | 2 +- seq_qt5/src/qseqroll.cpp | 19 ++++++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/latex/tex/pattern_editor.tex b/doc/latex/tex/pattern_editor.tex index 2391f9c5..e6934200 100644 --- a/doc/latex/tex/pattern_editor.tex +++ b/doc/latex/tex/pattern_editor.tex @@ -6,7 +6,7 @@ % \library Documents % \author Chris Ahlstrom % \date 2015-08-31 -% \update 2024-08-17 +% \update 2024-08-22 % \version $Revision$ % \license $XPC_GPL_LICENSE$ % @@ -913,6 +913,15 @@ \subsubsection{Pattern Editor / Note Editing} Once notes are in place, whether by recording or using "paint" mode, the piano roll provides a sophisticated set of note-editing actions. + But, before editing, one can turn on + \index{note!tooltips} + "note tooltips", if desired. + The thin unlabelled button next to the horizontal scroll bar toggles + this mode. + When enable, moving the mouse over a note will show its value, time range + in units of B:B:T, and its velocity. + This view is quicker than opening up the \textbf{Event Editor}. + Onward! \setcounter{ItemCounter}{0} % Reset the ItemCounter for this list. diff --git a/seq_qt5/include/qseqroll.hpp b/seq_qt5/include/qseqroll.hpp index 4a682c4e..9cda6add 100644 --- a/seq_qt5/include/qseqroll.hpp +++ b/seq_qt5/include/qseqroll.hpp @@ -28,7 +28,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2018-01-01 - * \updates 2024-08-21 + * \updates 2024-08-22 * \license GNU GPLv2 or above * * We are currently moving toward making this class a base class. diff --git a/seq_qt5/src/qseqroll.cpp b/seq_qt5/src/qseqroll.cpp index 7c69bbed..94435799 100644 --- a/seq_qt5/src/qseqroll.cpp +++ b/seq_qt5/src/qseqroll.cpp @@ -25,7 +25,7 @@ * \library seq66 application * \author Chris Ahlstrom * \date 2018-01-01 - * \updates 2024-08-21 + * \updates 2024-08-22 * \license GNU GPLv2 or above * * Please see the additional notes for the Gtkmm-2.4 version of this panel, @@ -34,13 +34,14 @@ #include /* QApplication keyboardModifiers() */ #include /* base class for seqedit frame(s) */ -#include /* used as a tool-tip for notes */ #include #include #include #include #include +#include /* used as a tool-tip for notes */ +#include /* for recoloring the tool-tip */ #include "cfg/settings.hpp" /* seq66::usr().key_height(), etc. */ #include "play/performer.hpp" /* seq66::performer class */ @@ -49,6 +50,7 @@ #include "qseqroll.hpp" /* seq66::qseqroll class */ #include "qt5_helpers.hpp" /* seq66::qt() string conversion */ + /** * We've had an issue where adding wrapped-but-truncated notes would * alter the look of some other notes until the play/record was stopped. @@ -2012,8 +2014,19 @@ qseqroll::show_note_tooltip (int mx, int my) delete m_note_tooltip; m_note_tooltip = new QLabel(qt(temp), this); + + /* + * Using the existing style might render the text the same color + * as the background, so we need to set the colors as per our + * Seq66 palette. + */ + + QPalette & p = const_cast(m_note_tooltip->palette()); + p.setColor(m_note_tooltip->backgroundRole(), back_color()); + p.setColor(m_note_tooltip->foregroundRole(), fore_color()); + m_note_tooltip->setPalette(p); m_note_tooltip->show(); - m_note_tooltip->move(mx, my - note_height() - 3); + m_note_tooltip->move(mx + 3, my - note_height() - 3); #endif } else