TAS History treeview bug fixes for Qt GUI
This commit is contained in:
parent
d2193d3e83
commit
c0d0d559be
|
@ -1269,10 +1269,12 @@ void TasEditorWindow::updateCheckedItems(void)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void TasEditorWindow::updateHistoryItems(void)
|
void TasEditorWindow::updateHistoryItems(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i, cursorPos;
|
||||||
QTreeWidgetItem *item;
|
QTreeWidgetItem *item;
|
||||||
const char *txt;
|
const char *txt;
|
||||||
|
|
||||||
|
cursorPos = history.getCursorPos();
|
||||||
|
|
||||||
for (i=0; i<history.getNumItems(); i++)
|
for (i=0; i<history.getNumItems(); i++)
|
||||||
{
|
{
|
||||||
txt = history.getItemDesc(i);
|
txt = history.getItemDesc(i);
|
||||||
|
@ -1285,7 +1287,7 @@ void TasEditorWindow::updateHistoryItems(void)
|
||||||
|
|
||||||
histTree->addTopLevelItem(item);
|
histTree->addTopLevelItem(item);
|
||||||
|
|
||||||
histTree->setCurrentItem(item);
|
//histTree->setCurrentItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( txt )
|
if ( txt )
|
||||||
|
@ -1294,9 +1296,13 @@ void TasEditorWindow::updateHistoryItems(void)
|
||||||
{
|
{
|
||||||
item->setText(0, tr(txt));
|
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()) )
|
while ( (histTree->topLevelItemCount() > 0) && (history.getNumItems() < histTree->topLevelItemCount()) )
|
||||||
|
@ -3086,6 +3092,7 @@ void QPianoRoll::finishDrag(void)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void QPianoRoll::paintEvent(QPaintEvent *event)
|
void QPianoRoll::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
|
fceuCriticalSection emuLock;
|
||||||
int x, y, row, nrow, lineNum;
|
int x, y, row, nrow, lineNum;
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
QColor white(255,255,255), black(0,0,0), blkColor;
|
QColor white(255,255,255), black(0,0,0), blkColor;
|
||||||
|
|
|
@ -128,8 +128,6 @@ public:
|
||||||
int getUndoHint();
|
int getUndoHint();
|
||||||
char* getItemDesc(int pos);
|
char* getItemDesc(int pos);
|
||||||
|
|
||||||
//void getDispInfo(NMLVDISPINFO* nmlvDispInfo);
|
|
||||||
//LONG handleCustomDraw(NMLVCUSTOMDRAW* msg);
|
|
||||||
void handleSingleClick(int rowIndex);
|
void handleSingleClick(int rowIndex);
|
||||||
|
|
||||||
void redrawList();
|
void redrawList();
|
||||||
|
@ -138,8 +136,7 @@ public:
|
||||||
bool isCursorOverHistoryList();
|
bool isCursorOverHistoryList();
|
||||||
|
|
||||||
int getNumItems(void){ return historyTotalItems; };
|
int getNumItems(void){ return historyTotalItems; };
|
||||||
|
int getCursorPos(void){ return historyCursorPos; };
|
||||||
//HWND hwndHistoryList;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int jumpInTime(int newPos);
|
int jumpInTime(int newPos);
|
||||||
|
|
Loading…
Reference in New Issue