// // Created by HW on 2023/07/26. // #ifndef OFFICEASSISTANT_NAVBAR_H #define OFFICEASSISTANT_NAVBAR_H #include #include #include #include "netio.h" #include "MyButton.h" #include #include #include #include "buttonstruct.h" #include #include "mainscreen.h" #include #include "mainwindowlayout.h" QT_BEGIN_NAMESPACE namespace Ui { class NavBar; } QT_END_NAMESPACE class NavBar : public QWidget { Q_OBJECT signals: void firstUrl(QString url); public slots: void refresh(int state); public: NavBar(MainScreen *mainScreen,QWidget *parent = nullptr); ~NavBar() override; protected: void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent *event) override; void getLogoFromInternet(ConfigResponse* configResponse); private: Ui::NavBar *ui; QColor qColor; QList buttons; QList buttonStructs; QByteArray *buffer; int width2; int height2; QWidget* parent; QNetworkAccessManager *manager; QNetworkReply *reply; QEventLoop eventLoop; QPixmap *logo; QLabel *logo_label; bool downloadSuccess=true; //void getLogoFromLocal(); MainScreen *mainScreen; QHBoxLayout *layout_left; QHBoxLayout *layout_right; QHBoxLayout *layout2; private slots: void storeToBuffer(); void cancelDownload(); }; #endif //OFFICEASSISTANT_NAVBAR_H