mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 08:43:38 +01:00
Fix jumpy resolve while typing
This commit is contained in:
1 parent
433daf1ee8
commit
adf7c3f20b
2 files changed
+9
-11
No files matched your search
@@ -1858,12 +1858,8 @@ void HostnameSelectScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
parent->Add(ipRows_);
|
||||
listIP.clear(); listIP.shrink_to_fit();
|
||||
|
||||
errorView_ = parent->Add(new TextView(n->T("Invalid IP or hostname"), ALIGN_HCENTER, false, new LinearLayoutParams(Margins(0, 10, 0, 0))));
|
||||
errorView_->SetTextColor(0xFF3030FF);
|
||||
errorView_->SetVisibility(V_GONE);
|
||||
|
||||
progressView_ = parent->Add(new TextView(n->T("Validating address..."), ALIGN_HCENTER, false, new LinearLayoutParams(Margins(0, 10, 0, 0))));
|
||||
progressView_->SetVisibility(V_GONE);
|
||||
progressView_->SetVisibility(V_INVISIBLE);
|
||||
}
|
||||
|
||||
void HostnameSelectScreen::SendEditKey(int keyCode, int flags) {
|
||||
@@ -1950,6 +1946,8 @@ void HostnameSelectScreen::ResolverThread() {
|
||||
}
|
||||
|
||||
bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
|
||||
if (result != DR_OK)
|
||||
return true;
|
||||
|
||||
@@ -1981,12 +1979,12 @@ bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
||||
lastResolvedResult_ = toResolveResult_;
|
||||
|
||||
if (lastResolvedResult_) {
|
||||
errorView_->SetVisibility(UI::V_GONE);
|
||||
progressView_->SetVisibility(UI::V_INVISIBLE);
|
||||
} else {
|
||||
errorView_->SetVisibility(UI::V_VISIBLE);
|
||||
progressView_->SetText(n->T("Invalid IP or hostname"));
|
||||
progressView_->SetTextColor(0xFF3030FF);
|
||||
progressView_->SetVisibility(UI::V_VISIBLE);
|
||||
}
|
||||
progressView_->SetVisibility(UI::V_GONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1998,8 +1996,9 @@ bool HostnameSelectScreen::CanComplete(DialogResult result) {
|
||||
toResolve_ = value;
|
||||
resolverCond_.notify_one();
|
||||
|
||||
progressView_->SetText(n->T("Validating address..."));
|
||||
progressView_->SetTextColor(0xFFFFFFFF);
|
||||
progressView_->SetVisibility(UI::V_VISIBLE);
|
||||
errorView_->SetVisibility(UI::V_GONE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,6 @@ private:
|
||||
|
||||
std::string *value_;
|
||||
UI::TextEdit *addrView_ = nullptr;
|
||||
UI::TextView *errorView_ = nullptr;
|
||||
UI::TextView *progressView_ = nullptr;
|
||||
UI::LinearLayout *ipRows_ = nullptr;
|
||||
|
||||
|
||||
Reference in new issue
Block a user