// // 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 "mainwindowlayout.h" QT_BEGIN_NAMESPACE namespace Ui { class NavBar; } QT_END_NAMESPACE class NavBar : public QWidget { Q_OBJECT signals: void firstUrl(QString url); public: NavBar(ConfigResponse *configResponse,MainScreen *mainScreen,QWidget *parent = nullptr); ~NavBar() override; protected: void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent *event) override; private: Ui::NavBar *ui; QColor qColor; QColor text_color; QColor text_cover_color; QList buttons; QList buttonStructs; QByteArray *buffer; int width2; int height2; QNetworkAccessManager *manager; QNetworkReply *reply; QEventLoop eventLoop; QImage *logo; bool downloadSuccess=true; void getLogoFromInternet(ConfigResponse *configResponse); void getLogoFromLocal(); MainScreen *mainScreen; private slots: void storeToBuffer(); void cancelDownload(); }; #endif //OFFICEASSISTANT_NAVBAR_H