123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QMainWindow>
- #include <QPropertyAnimation>
- #include <QTimer>
- #include <QPixmap>
- #include <QBitmap>
- #include "statuswidget.h"
- #include "rusificationwidget.h"
- #include "settingswidget.h"
- #include "helpwidget.h"
- namespace Ui {
- class MainWindow;
- }
- class MenuEntry;
- class LotroDatManager;
- // class NetworkUpdater;
- class PatchDownloader;
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- public:
- explicit MainWindow(QWidget *parent = 0);
- void changeFontSizeRecursive(size_t percent, QWidget* widget);
- ~MainWindow();
- protected:
- void mouseMoveEvent(QMouseEvent *event) override;
- void mousePressEvent(QMouseEvent *event) override;
- void resizeEvent(QResizeEvent *event) override;
- bool eventFilter(QObject *watched, QEvent *event) override;
- private slots:
- void randomChangeBackground();
- void on_menuentry_1_clicked();
- void on_menuentry_2_clicked();
- void on_menuentry_3_clicked();
- void on_menuentry_4_clicked();
- void onHoverMenuentry();
- void on_closeButton_clicked();
- void on_minimizeButton_clicked();
- void setupWindowBackgroundAndMask(QPixmap background);
- private:
- void makeConnections();
- void setupMenuHoverWidget();
- void moveMenuHoverWidget(MenuEntry* target);
- void checkMenuIsHovered();
- void hideAllContentWidgets();
- bool buttonsMouseMoveEventFilter(QObject *obj, QEvent *event);
- void setEventFilterRecursive(QObject* widget);
- private:
- PatchDownloader *patch_updater;
- LotroDatManager *lotro_manager;
- QThread *lotro_functions_thread;
- Ui::MainWindow *ui;
- StatusWidget *status_widget;
- RusificationWidget *rusification_widget;
- SettingsWidget *settings_widget;
- HelpWidget *help_widget;
- QWidget* menuHoverWidget;
- QPropertyAnimation* menuHoverWidgetAnimation;
- QPropertyAnimation* menuHoverWidgetScaleAnimation;
- QTimer menu_hover_checker_timer;
- QPoint dragPosition;
- int current_bg_id;
- QPixmap current_bg;
- QBitmap current_mask;
- QTimer background_update_timer;
- const int MAX_PIXMAP_ID = 14;
- const size_t small_font_size = 13;
- const size_t common_font_size = 14;
- const size_t menuentry_font_size = 16;
- const size_t title_font_size = 17;
- const size_t supertitle_font_size = 32;
- const size_t bigbutton_font_size = 22;
- };
- #endif // MAINWINDOW_H
|