mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +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();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Entry::selectAllText()
|
||||||
|
{
|
||||||
|
selectText(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
void Entry::deselectText()
|
void Entry::deselectText()
|
||||||
{
|
{
|
||||||
m_select = -1;
|
m_select = -1;
|
||||||
|
@ -32,6 +32,7 @@ namespace ui {
|
|||||||
|
|
||||||
void setCaretPos(int pos);
|
void setCaretPos(int pos);
|
||||||
void selectText(int from, int to);
|
void selectText(int from, int to);
|
||||||
|
void selectAllText();
|
||||||
void deselectText();
|
void deselectText();
|
||||||
|
|
||||||
void setSuffix(const std::string& suffix);
|
void setSuffix(const std::string& suffix);
|
||||||
|
@ -80,8 +80,10 @@ bool IntEntry::onProcessMessage(Message* msg)
|
|||||||
int oldValue = getValue();
|
int oldValue = getValue();
|
||||||
int newValue = oldValue + jmouse_z(0) - jmouse_z(1);
|
int newValue = oldValue + jmouse_z(0) - jmouse_z(1);
|
||||||
newValue = MID(m_min, newValue, m_max);
|
newValue = MID(m_min, newValue, m_max);
|
||||||
if (newValue != oldValue)
|
if (newValue != oldValue) {
|
||||||
setValue(newValue);
|
setValue(newValue);
|
||||||
|
selectAllText();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -139,6 +141,7 @@ void IntEntry::closePopup()
|
|||||||
void IntEntry::onChangeSlider()
|
void IntEntry::onChangeSlider()
|
||||||
{
|
{
|
||||||
setValue(m_slider->getValue());
|
setValue(m_slider->getValue());
|
||||||
|
selectAllText();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
Loading…
x
Reference in New Issue
Block a user