TAS History treeview bug fixes for Qt GUI

This commit is contained in:
mjbudd77 2021-11-10 21:25:04 -05:00
parent d2193d3e83
commit c0d0d559be
2 changed files with 11 additions and 7 deletions

View File

@ -1269,10 +1269,12 @@ void TasEditorWindow::updateCheckedItems(void)
//----------------------------------------------------------------------------
void TasEditorWindow::updateHistoryItems(void)
{
int i;
int i, cursorPos;
QTreeWidgetItem *item;
const char *txt;
cursorPos = history.getCursorPos();
for (i=0; i<history.getNumItems(); i++)
{
txt = history.getItemDesc(i);
@ -1285,7 +1287,7 @@ void TasEditorWindow::updateHistoryItems(void)
histTree->addTopLevelItem(item);
histTree->setCurrentItem(item);
//histTree->setCurrentItem(item);
}
if ( txt )
@ -1294,9 +1296,13 @@ void TasEditorWindow::updateHistoryItems(void)
{
item->setText(0, tr(txt));
histTree->setCurrentItem(item);
//histTree->setCurrentItem(item);
}
}
if ( cursorPos == i )
{
histTree->setCurrentItem(item);
}
}
while ( (histTree->topLevelItemCount() > 0) && (history.getNumItems() < histTree->topLevelItemCount()) )
@ -3086,6 +3092,7 @@ void QPianoRoll::finishDrag(void)
//----------------------------------------------------------------------------
void QPianoRoll::paintEvent(QPaintEvent *event)
{
fceuCriticalSection emuLock;
int x, y, row, nrow, lineNum;
QPainter painter(this);
QColor white(255,255,255), black(0,0,0), blkColor;

View File

@ -128,8 +128,6 @@ public:
int getUndoHint();
char* getItemDesc(int pos);
//void getDispInfo(NMLVDISPINFO* nmlvDispInfo);
//LONG handleCustomDraw(NMLVCUSTOMDRAW* msg);
void handleSingleClick(int rowIndex);
void redrawList();
@ -138,8 +136,7 @@ public:
bool isCursorOverHistoryList();
int getNumItems(void){ return historyTotalItems; };
//HWND hwndHistoryList;
int getCursorPos(void){ return historyCursorPos; };
private:
int jumpInTime(int newPos);