mainwindow.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QPropertyAnimation>
  5. #include <QTimer>
  6. #include "statuswidget.h"
  7. #include "rusificationwidget.h"
  8. #include "settingswidget.h"
  9. #include "newswidget.h"
  10. #include "helpwidget.h"
  11. namespace Ui {
  12. class MainWindow;
  13. }
  14. class MenuEntry;
  15. class LegacyApp;
  16. class MainWindow : public QMainWindow
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit MainWindow(LegacyApp *app = 0, QWidget *parent = 0);
  21. void Init();
  22. ~MainWindow();
  23. protected:
  24. void mouseMoveEvent(QMouseEvent *event) override;
  25. void mousePressEvent(QMouseEvent *event) override;
  26. void resizeEvent(QResizeEvent *event) override;
  27. private slots:
  28. void on_menuentry_1_clicked();
  29. void on_menuentry_2_clicked();
  30. void on_menuentry_3_clicked();
  31. void on_menuentry_4_clicked();
  32. void on_menuentry_5_clicked();
  33. void onHoverMenuentry();
  34. void on_closeButton_clicked();
  35. void on_minimizeButton_clicked();
  36. private:
  37. void setupWindowBackgroundAndMask(int bg_id);
  38. void setupMenuHoverWidget();
  39. void moveMenuHoverWidget(MenuEntry* target);
  40. void checkMenuIsHovered();
  41. void hideAllContentWidgets();
  42. private:
  43. LegacyApp *app;
  44. Ui::MainWindow *ui;
  45. QWidget* menuHoverWidget;
  46. QPropertyAnimation* menuHoverWidgetAnimation;
  47. QPropertyAnimation* menuHoverWidgetScaleAnimation;
  48. QTimer menu_hover_checker_timer;
  49. QPoint dragPosition;
  50. StatusWidget *status_frame;
  51. RusificationWidget *rusification_frame;
  52. SettingsWidget *settings_frame;
  53. NewsWidget *news_frame;
  54. HelpWidget *help_frame;
  55. };
  56. #endif // MAINWINDOW_H