MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / InfiniteLoading

Method InfiniteLoading

src/render_panel/devices/infinite_loading.cpp:22–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21
22 InfiniteLoading::InfiniteLoading(const std::shared_ptr<GrContext>& ctx, const QString& msg)
23 : QDialog(nullptr) {
24
25 setWindowFlags(Qt::FramelessWindowHint|Qt::Dialog);
26 setAttribute(Qt::WA_TranslucentBackground);
27 //this->setStyleSheet("background:#00000000;");
28 setFixedSize(320, 240);
29 auto root_layout = new NoMarginVLayout;
30
31 {
32 int size = 70;
33 auto lbl = new QLabel(this);
34 lbl->setStyleSheet("font-weight: bold; font-size: 15px; color: #555555;");
35 lbl->setText(msg);
36 root_layout->addSpacing(70);
37
38 auto layout = new NoMarginHLayout();
39 layout->addStretch();
40 layout->addWidget(lbl);
41 layout->addStretch();
42
43 root_layout->addLayout(layout);
44 }
45
46 {
47 auto layout = new NoMarginHLayout;
48 h_loading_widget_ = new Win10CircleLoadingWidget(this);
49 h_loading_widget_->setFixedSize(50, 50);
50 h_loading_widget_->show();
51 h_loading_widget_->setBackgroundColor(QColor("#ffffff"));
52 h_loading_widget_->setItemLength(8);
53 h_loading_widget_->setExtendDuration(240);
54 h_loading_widget_->setItemCount(6);
55 h_loading_widget_->setDuration(1000);
56 QList<QColor> colors;
57 colors << QColor("#2962FF") << QColor("#2979FF")
58 << QColor("#448AFF") << QColor("#82B1FF")
59 << QColor("#90CAF9") << QColor("#A0DAF9");
60 h_loading_widget_->setItemColors(colors);
61 h_loading_widget_->updateFrameData();
62 h_loading_widget_->start();
63
64 layout->addStretch();
65 layout->addWidget(h_loading_widget_);
66 layout->addStretch();
67
68 root_layout->addSpacing(30);
69 root_layout->addLayout(layout);
70 root_layout->addStretch();
71 }
72
73 setLayout(root_layout);
74
75 //
76 WidgetHelper::AddShadow(this, 0x666666, 30);
77 }
78
79 void InfiniteLoading::resizeEvent(QResizeEvent *event) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected