mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-12 07:13:23 +00:00
ADd Entry::set/getSuffix() property
This commit is contained in:
parent
c5a0acf7c6
commit
c2664b6aac
@ -975,7 +975,9 @@ void SkinTheme::paintEntry(PaintEvent& ev)
|
||||
Entry* widget = static_cast<Entry*>(ev.getSource());
|
||||
bool password = widget->isPassword();
|
||||
int scroll, caret, state, selbeg, selend;
|
||||
const char *text = widget->getText();
|
||||
std::string textString = widget->getText() + widget->getSuffix();
|
||||
int suffixIndex = widget->getTextSize();
|
||||
const char* text = textString.c_str();
|
||||
int c, ch, x, y, w;
|
||||
int x1, y1, x2, y2;
|
||||
int caret_x;
|
||||
@ -1022,7 +1024,10 @@ void SkinTheme::paintEntry(PaintEvent& ev)
|
||||
}
|
||||
|
||||
// Disabled
|
||||
if (!widget->isEnabled()) {
|
||||
if (!widget->isEnabled() || (c >= suffixIndex)) {
|
||||
if (widget->hasFocus())
|
||||
break;
|
||||
|
||||
bg = ColorNone;
|
||||
fg = getColor(ThemeColor::Disabled);
|
||||
}
|
||||
|
@ -145,6 +145,12 @@ void Entry::deselectText()
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Entry::setSuffix(const std::string& suffix)
|
||||
{
|
||||
m_suffix = suffix;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void Entry::getEntryThemeInfo(int* scroll, int* caret, int* state,
|
||||
int* selbeg, int* selend)
|
||||
{
|
||||
@ -641,4 +647,3 @@ void Entry::backwardWord()
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
||||
|
@ -32,6 +32,9 @@ namespace ui {
|
||||
void selectText(int from, int to);
|
||||
void deselectText();
|
||||
|
||||
void setSuffix(const std::string& suffix);
|
||||
const std::string& getSuffix() { return m_suffix; }
|
||||
|
||||
// for themes
|
||||
void getEntryThemeInfo(int* scroll, int* caret, int* state,
|
||||
int* selbeg, int* selend);
|
||||
@ -82,6 +85,7 @@ namespace ui {
|
||||
bool m_readonly : 1;
|
||||
bool m_password : 1;
|
||||
bool m_recent_focused : 1;
|
||||
std::string m_suffix;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
Loading…
x
Reference in New Issue
Block a user