Skip to content

Commit

Permalink
Add palette coloring to note tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlstromcj committed Aug 22, 2024
1 parent 5071ea0 commit 35b1887
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
11 changes: 10 additions & 1 deletion doc/latex/tex/pattern_editor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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$
%
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion seq_qt5/include/qseqroll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 16 additions & 3 deletions seq_qt5/src/qseqroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -34,13 +34,14 @@

#include <QApplication> /* QApplication keyboardModifiers() */
#include <QFrame> /* base class for seqedit frame(s) */
#include <QLabel> /* used as a tool-tip for notes */
#include <QMessageBox>
#include <QMouseEvent>
#include <QPainter>
#include <QPen>
#include <QTimer>

#include <QLabel> /* used as a tool-tip for notes */
#include <QPalette> /* for recoloring the tool-tip */

#include "cfg/settings.hpp" /* seq66::usr().key_height(), etc. */
#include "play/performer.hpp" /* seq66::performer class */
Expand All @@ -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.
Expand Down Expand Up @@ -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<QPalette &>(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
Expand Down

0 comments on commit 35b1887

Please sign in to comment.