mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-26 08:37:08 +00:00
IntEntry: select all text when the value is changed with the slider
This commit is contained in:
parent
721734d26c
commit
7eb41c73e9
@ -144,6 +144,11 @@ void Entry::selectText(int from, int to)
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Entry::selectAllText()
|
||||
{
|
||||
selectText(0, -1);
|
||||
}
|
||||
|
||||
void Entry::deselectText()
|
||||
{
|
||||
m_select = -1;
|
||||
|
@ -32,6 +32,7 @@ namespace ui {
|
||||
|
||||
void setCaretPos(int pos);
|
||||
void selectText(int from, int to);
|
||||
void selectAllText();
|
||||
void deselectText();
|
||||
|
||||
void setSuffix(const std::string& suffix);
|
||||
|
@ -80,8 +80,10 @@ bool IntEntry::onProcessMessage(Message* msg)
|
||||
int oldValue = getValue();
|
||||
int newValue = oldValue + jmouse_z(0) - jmouse_z(1);
|
||||
newValue = MID(m_min, newValue, m_max);
|
||||
if (newValue != oldValue)
|
||||
if (newValue != oldValue) {
|
||||
setValue(newValue);
|
||||
selectAllText();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@ -139,6 +141,7 @@ void IntEntry::closePopup()
|
||||
void IntEntry::onChangeSlider()
|
||||
{
|
||||
setValue(m_slider->getValue());
|
||||
selectAllText();
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
Loading…
x
Reference in New Issue
Block a user