Added branches tool tips and frame preview.

This commit is contained in:
mjbudd77 2021-11-26 10:58:50 -05:00
parent 82bd4b55a7
commit 8b1e42cf33
4 changed files with 40 additions and 1 deletions

View File

@ -2409,6 +2409,9 @@ void TasEditorWindow::updateToolTips(void)
turboSeekCbox->setToolTip( tr("Uncheck when you need to watch seeking in slow motion") ); turboSeekCbox->setToolTip( tr("Uncheck when you need to watch seeking in slow motion") );
autoRestoreCbox->setToolTip( tr("Whenever you change Input above Playback cursor, the cursor returns to where it was before the change") ); autoRestoreCbox->setToolTip( tr("Whenever you change Input above Playback cursor, the cursor returns to where it was before the change") );
selectionLbl->setToolTip( tr("Current size of Selection") );
clipboardLbl->setToolTip( tr("Current size of Input in the Clipboard") );
prevMkrBtn->setToolTip( tr("Send Selection to previous Marker (mouse: Ctrl+Wheel up) (hotkey: Ctrl+PageUp)") ); prevMkrBtn->setToolTip( tr("Send Selection to previous Marker (mouse: Ctrl+Wheel up) (hotkey: Ctrl+PageUp)") );
nextMkrBtn->setToolTip( tr("Send Selection to next Marker (mouse: Ctrl+Wheel up) (hotkey: Ctrl+PageDown)") ); nextMkrBtn->setToolTip( tr("Send Selection to next Marker (mouse: Ctrl+Wheel up) (hotkey: Ctrl+PageDown)") );
similarBtn->setToolTip( tr("Auto-search for Marker Note") ); similarBtn->setToolTip( tr("Auto-search for Marker Note") );
@ -2440,6 +2443,9 @@ void TasEditorWindow::updateToolTips(void)
turboSeekCbox->setToolTip( tr("") ); turboSeekCbox->setToolTip( tr("") );
autoRestoreCbox->setToolTip( tr("") ); autoRestoreCbox->setToolTip( tr("") );
selectionLbl->setToolTip( tr("") );
clipboardLbl->setToolTip( tr("") );
prevMkrBtn->setToolTip( tr("") ); prevMkrBtn->setToolTip( tr("") );
nextMkrBtn->setToolTip( tr("") ); nextMkrBtn->setToolTip( tr("") );
similarBtn->setToolTip( tr("") ); similarBtn->setToolTip( tr("") );

View File

@ -974,13 +974,17 @@ bool BOOKMARKS::event(QEvent *event)
item = (row_under_mouse + 1) % TOTAL_BOOKMARKS; item = (row_under_mouse + 1) % TOTAL_BOOKMARKS;
item_valid = (item >= 0) && (item < TOTAL_BOOKMARKS); item_valid = (item >= 0) && (item < TOTAL_BOOKMARKS);
if ( item_valid && bookmarks->bookmarksArray[item].notEmpty) if ( item_valid && (column == BOOKMARKSLIST_COLUMN_TIME) && bookmarks->bookmarksArray[item].notEmpty)
{ {
static_cast<bookmarkPreviewPopup*>(fceuCustomToolTipShow( helpEvent, new bookmarkPreviewPopup(item, this) )); static_cast<bookmarkPreviewPopup*>(fceuCustomToolTipShow( helpEvent, new bookmarkPreviewPopup(item, this) ));
//QToolTip::showText(helpEvent->globalPos(), tr(stmp), this ); //QToolTip::showText(helpEvent->globalPos(), tr(stmp), this );
QToolTip::hideText(); QToolTip::hideText();
event->ignore(); event->ignore();
} }
else if ( taseditorConfig && taseditorConfig->tooltipsEnabled )
{
QToolTip::showText(helpEvent->globalPos(), tr("Right click = set Bookmark, Left click = jump to Bookmark or load Branch"), this );
}
return true; return true;
} }

View File

@ -23,6 +23,7 @@ Branches - Manager of Branches
#include <math.h> #include <math.h>
#include <zlib.h> #include <zlib.h>
#include <QToolTip>
#include <QFontMetrics> #include <QFontMetrics>
#include "utils/xstring.h" #include "utils/xstring.h"
@ -635,6 +636,33 @@ void BRANCHES::mouseMoveEvent(QMouseEvent * event)
} }
bool BRANCHES::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip)
{
int item, item_valid;
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
item = findItemUnderMouse( helpEvent->pos().x(), helpEvent->pos().y() );
item_valid = (item >= 0) && (item < TOTAL_BOOKMARKS);
if ( item_valid && bookmarks->bookmarksArray[item].notEmpty)
{
static_cast<bookmarkPreviewPopup*>(fceuCustomToolTipShow( helpEvent, new bookmarkPreviewPopup(item, this) ));
//QToolTip::showText(helpEvent->globalPos(), tr(stmp), this );
QToolTip::hideText();
event->ignore();
}
else if ( taseditorConfig && taseditorConfig->tooltipsEnabled )
{
QToolTip::showText(helpEvent->globalPos(), tr("Right click = set Bookmark, single Left click = jump to Bookmark, double Left click = load Branch") );
}
return true;
}
return QWidget::event(event);
}
void BRANCHES::paintEvent(QPaintEvent *event) void BRANCHES::paintEvent(QPaintEvent *event)
{ {
int x,y; int x,y;

View File

@ -145,6 +145,7 @@ protected:
void mousePressEvent(QMouseEvent * event); void mousePressEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent * event);
void mouseMoveEvent(QMouseEvent * event); void mouseMoveEvent(QMouseEvent * event);
bool event(QEvent *event);
private: private:
void calcFontData(void); void calcFontData(void);