Extract cloud browser loading placeholder helper
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -45,4 +45,5 @@ public:
|
||||
virtual void loaded() override;
|
||||
virtual void removed(Node* parent) override;
|
||||
void load_thumbs_thread();
|
||||
NodeText* create_loading_status_text();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user