mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher/pointer_text_view] Clean minimalSizeForOptimalDisplay
It was unneedingly overriden + added escape case on nullptr text
This commit is contained in:
@@ -10,7 +10,6 @@ public:
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
const char * text() const override { return m_text; }
|
||||
void setText(const char * text) override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
private:
|
||||
const char * m_text;
|
||||
};
|
||||
|
||||
@@ -14,7 +14,3 @@ void PointerTextView::setText(const char * text) {
|
||||
markRectAsDirty(bounds());
|
||||
}
|
||||
}
|
||||
|
||||
KDSize PointerTextView::minimalSizeForOptimalDisplay() const {
|
||||
return m_font->stringSize(text());
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ void TextView::setFont(const KDFont * font) {
|
||||
}
|
||||
|
||||
KDSize TextView::minimalSizeForOptimalDisplay() const {
|
||||
if (text() == nullptr) {
|
||||
return KDSize(0,0);
|
||||
}
|
||||
return m_font->stringSize(text());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user