Extract cloud browser loading placeholder helper

This commit is contained in:
2026-06-15 20:37:28 +02:00
parent 217702b6be
commit e9db32f274
5 changed files with 64 additions and 9 deletions

View File

@@ -46,6 +46,19 @@ void NodeDialogCloud::removed(Node* parent)
closed = true;
}
NodeText* NodeDialogCloud::create_loading_status_text()
{
auto* align = container->add_child<Node>();
align->SetWidthP(100.f);
align->SetHeightP(100.f);
align->SetAlign(YGAlignCenter);
align->SetJustify(YGJustifyCenter);
auto* text = align->add_child<NodeText>();
text->set_font_size(30);
text->set_text("Connecting to the server...");
return text;
}
void NodeDialogCloud::load_thumbs_thread()
{
#if WITH_CURL
@@ -54,14 +67,8 @@ void NodeDialogCloud::load_thumbs_thread()
std::string res;
if (curl)
{
auto* align = container->add_child<Node>();
align->SetWidthP(100.f);
align->SetHeightP(100.f);
align->SetAlign(YGAlignCenter);
align->SetJustify(YGJustifyCenter);
auto* text = align->add_child<NodeText>();
text->set_font_size(30);
text->set_text("Connecting to the server...");
auto* text = create_loading_status_text();
auto* align = text->m_parent;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &res);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);

View File

@@ -45,4 +45,5 @@ public:
virtual void loaded() override;
virtual void removed(Node* parent) override;
void load_thumbs_thread();
NodeText* create_loading_status_text();
};