mainwindow.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QPropertyAnimation>
  5. #include <QTimer>
  6. #include <QPixmap>
  7. #include <QBitmap>
  8. #include <QGraphicsBlurEffect>
  9. #include <QFont>
  10. #include "statuswidget.h"
  11. #include "rusificationwidget.h"
  12. #include "settingswidget.h"
  13. #include "helpwidget.h"
  14. #include "chooseversiondialog.h"
  15. namespace Ui {
  16. class MainWindow;
  17. }
  18. class MenuEntry;
  19. class LotroDatManager;
  20. // class NetworkUpdater;
  21. class PatchDownloader;
  22. class MainWindow : public QMainWindow
  23. {
  24. Q_OBJECT
  25. public:
  26. explicit MainWindow(QWidget *parent = 0);
  27. ~MainWindow();
  28. public slots:
  29. void showChooseVersionDialog();
  30. void hideChooseVersionDialog();
  31. void updateFontSizes();
  32. protected:
  33. void mouseMoveEvent(QMouseEvent *event) override;
  34. void mousePressEvent(QMouseEvent *event) override;
  35. void resizeEvent(QResizeEvent *event) override;
  36. bool eventFilter(QObject *watched, QEvent *event) override;
  37. private slots:
  38. void randomChangeBackground();
  39. void on_menuentry_1_clicked();
  40. void on_menuentry_2_clicked();
  41. void on_menuentry_3_clicked();
  42. void on_menuentry_4_clicked();
  43. void onHoverMenuentry();
  44. void on_closeButton_clicked();
  45. void on_minimizeButton_clicked();
  46. void setupWindowBackgroundAndMask(QPixmap background);
  47. private:
  48. void makeConnections();
  49. void setupMenuHoverWidget();
  50. void moveMenuHoverWidget(MenuEntry* target);
  51. void checkMenuIsHovered();
  52. void hideAllContentWidgets();
  53. bool buttonsMouseMoveEventFilter(QObject *obj, QEvent *event);
  54. void setEventFilterRecursive(QObject* widget);
  55. private:
  56. PatchDownloader *patch_updater;
  57. LotroDatManager *lotro_manager;
  58. QThread *lotro_functions_thread;
  59. Ui::MainWindow *ui;
  60. StatusWidget *status_widget;
  61. RusificationWidget *rusification_widget;
  62. SettingsWidget *settings_widget;
  63. HelpWidget *help_widget;
  64. ChooseVersionDialog *choose_locale_dialog;
  65. QWidget* menuHoverWidget;
  66. QPropertyAnimation* menuHoverWidgetAnimation;
  67. QPropertyAnimation* menuHoverWidgetScaleAnimation;
  68. QTimer menu_hover_checker_timer;
  69. QPoint dragPosition;
  70. int current_bg_id;
  71. QPixmap current_bg;
  72. QBitmap current_mask;
  73. QTimer background_update_timer;
  74. const int MAX_PIXMAP_ID = 14;
  75. };
  76. #endif // MAINWINDOW_H