disable tooltip when displayed value changes/is edited

This commit is contained in:
thrust26 2020-11-18 23:54:43 +01:00
parent 6185d9ef06
commit 9ab2a5c417
4 changed files with 14 additions and 3 deletions

View File

@ -17,6 +17,7 @@
#include "Widget.hxx" #include "Widget.hxx"
#include "Dialog.hxx" #include "Dialog.hxx"
#include "ToolTip.hxx"
#include "Font.hxx" #include "Font.hxx"
#include "OSystem.hxx" #include "OSystem.hxx"
#include "Debugger.hxx" #include "Debugger.hxx"
@ -294,6 +295,7 @@ void DataGridWidget::handleMouseWheel(int x, int y, int direction)
else if(direction < 0) else if(direction < 0)
incrementCell(); incrementCell();
} }
dialog().tooltip().hide();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -491,6 +493,7 @@ bool DataGridWidget::handleKeyDown(StellaKey key, StellaMod mod)
sendCommand(DataGridWidget::kSelectionChangedCmd, _selectedItem, _id); sendCommand(DataGridWidget::kSelectionChangedCmd, _selectedItem, _id);
setDirty(); setDirty();
dialog().tooltip().hide();
} }
_currentKeyDown = key; _currentKeyDown = key;
@ -582,7 +585,8 @@ int DataGridWidget::getToolTipIndex(const Common::Point& pos) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string DataGridWidget::getToolTip(const Common::Point& pos) const string DataGridWidget::getToolTip(const Common::Point& pos) const
{ {
const Int32 val = _valueList[getToolTipIndex(pos)]; const int idx = getToolTipIndex(pos);
const Int32 val = _valueList[idx];
ostringstream buf; ostringstream buf;
buf << _toolTipText buf << _toolTipText

View File

@ -20,6 +20,8 @@
#include "Debugger.hxx" #include "Debugger.hxx"
#include "DiStella.hxx" #include "DiStella.hxx"
#include "Widget.hxx" #include "Widget.hxx"
#include "Dialog.hxx"
#include "ToolTip.hxx"
#include "StellaKeys.hxx" #include "StellaKeys.hxx"
#include "FBSurface.hxx" #include "FBSurface.hxx"
#include "Font.hxx" #include "Font.hxx"
@ -646,6 +648,7 @@ void RomListWidget::startEditMode()
return; return;
_editMode = true; _editMode = true;
dialog().tooltip().hide();
switch(myDisasm->list[_selectedItem].type) switch(myDisasm->list[_selectedItem].type)
{ {
case Device::GFX: case Device::GFX:

View File

@ -19,6 +19,8 @@
#include "Base.hxx" #include "Base.hxx"
#include "StellaKeys.hxx" #include "StellaKeys.hxx"
#include "Widget.hxx" #include "Widget.hxx"
#include "Dialog.hxx"
#include "ToolTip.hxx"
#include "ToggleWidget.hxx" #include "ToggleWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,6 +53,7 @@ void ToggleWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount)
_selectedItem = newSelectedItem; _selectedItem = newSelectedItem;
_currentRow = _selectedItem / _cols; _currentRow = _selectedItem / _cols;
_currentCol = _selectedItem - (_currentRow * _cols); _currentCol = _selectedItem - (_currentRow * _cols);
dialog().tooltip().hide();
setDirty(); setDirty();
} }
} }
@ -182,6 +185,7 @@ bool ToggleWidget::handleKeyDown(StellaKey key, StellaMod mod)
_stateList[_selectedItem] = !_stateList[_selectedItem]; _stateList[_selectedItem] = !_stateList[_selectedItem];
_changedList[_selectedItem] = !_changedList[_selectedItem]; _changedList[_selectedItem] = !_changedList[_selectedItem];
sendCommand(ToggleWidget::kItemDataChangedCmd, _selectedItem, _id); sendCommand(ToggleWidget::kItemDataChangedCmd, _selectedItem, _id);
dialog().tooltip().hide();
} }
setDirty(); setDirty();

View File

@ -56,9 +56,9 @@ int StringListWidget::getToolTipIndex(const Common::Point& pos) const
int idx = (pos.y - getAbsY()) / _lineHeight + _currentPos; int idx = (pos.y - getAbsY()) / _lineHeight + _currentPos;
if(idx >= int(_list.size())) if(idx >= int(_list.size()))
return -1; return -1;
else else
return idx; return idx;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -