Make the i18n T function use std::string_view

Buildfixes, crashfixes

One more

Android buildfix

Buildfix Qt
This commit is contained in:
Henrik Rydgård committed 2024-02-12 18:44:39 +01:00
1 parent 9322b4c6dc
commit c5791764d8
135 files changed
+436 -486

No files matched your search

+4 -4
View File
@@ -546,7 +546,7 @@ std::string Choice::DescribeText() const {
return ApplySafeSubstitutions(u->T("%1 choice"), text_);
}
InfoItem::InfoItem(const std::string &text, const std::string &rightText, LayoutParams *layoutParams)
InfoItem::InfoItem(std::string_view text, std::string_view rightText, LayoutParams *layoutParams)
: Item(layoutParams), text_(text), rightText_(rightText) {
// We set the colors later once we have a UIContext.
bgColor_ = AddTween(new CallbackColorTween(0.1f));
@@ -594,7 +594,7 @@ std::string InfoItem::DescribeText() const {
return ApplySafeSubstitutions(u->T("%1: %2"), text_, rightText_);
}
ItemHeader::ItemHeader(const std::string &text, LayoutParams *layoutParams)
ItemHeader::ItemHeader(std::string_view text, LayoutParams *layoutParams)
: Item(layoutParams), text_(text) {
layoutParams_->width = FILL_PARENT;
layoutParams_->height = 40;
@@ -624,7 +624,7 @@ std::string ItemHeader::DescribeText() const {
return ApplySafeSubstitutions(u->T("%1 heading"), text_);
}
CollapsibleHeader::CollapsibleHeader(bool *toggle, const std::string &text, LayoutParams *layoutParams)
CollapsibleHeader::CollapsibleHeader(bool *toggle, std::string_view text, LayoutParams *layoutParams)
: CheckBox(toggle, text, "", layoutParams) {
layoutParams_->width = FILL_PARENT;
layoutParams_->height = 40;
@@ -1098,7 +1098,7 @@ void TextView::Draw(UIContext &dc) {
}
}
TextEdit::TextEdit(const std::string &text, const std::string &title, const std::string &placeholderText, LayoutParams *layoutParams)
TextEdit::TextEdit(std::string_view text, std::string_view title, std::string_view placeholderText, LayoutParams *layoutParams)
: View(layoutParams), text_(text), title_(title), undo_(text), placeholderText_(placeholderText),
textColor_(0xFFFFFFFF), maxLen_(255) {
caret_ = (int)text_.size();