2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Handle channel event log mouse events.

This commit is contained in:
John Preston
2017-06-22 00:38:31 +03:00
parent 1791b251ad
commit e39b95175b
50 changed files with 1298 additions and 668 deletions

View File

@@ -21,11 +21,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#pragma once
#include "window/window_title.h"
#include "base/timer.h"
class MediaView;
namespace Window {
class Controller;
class TitleWidget;
QImage LoadLogo();
@@ -38,6 +40,14 @@ class MainWindow : public QWidget, protected base::Subscriber {
public:
MainWindow();
Window::Controller *controller() const {
return _controller.get();
}
void setInactivePress(bool inactive);
bool wasInactivePress() const {
return _wasInactivePress;
}
bool hideNoQuit();
void hideMediaview();
@@ -90,6 +100,14 @@ public:
}
virtual PeerData *ui_getPeerForMouseAction();
void launchDrag(std::unique_ptr<QMimeData> data);
base::Observable<void> &dragFinished() {
return _dragFinished;
}
base::Observable<void> &widgetGrabbed() {
return _widgetGrabbed;
}
public slots:
bool minimizeToTray();
void updateGlobalMenu() {
@@ -154,11 +172,9 @@ private slots:
savePosition();
}
void onReActivate();
void updateIsActiveByTimer() {
updateIsActive(0);
}
private:
void checkAuthSession();
void updatePalette();
void updateUnreadCounter();
void initSize();
@@ -168,6 +184,7 @@ private:
object_ptr<QTimer> _positionUpdatedTimer;
bool _positionInited = false;
std::unique_ptr<Window::Controller> _controller;
object_ptr<TitleWidget> _title = { nullptr };
object_ptr<TWidget> _body;
object_ptr<TWidget> _rightColumn = { nullptr };
@@ -175,11 +192,16 @@ private:
QIcon _icon;
QString _titleText;
object_ptr<QTimer> _isActiveTimer;
bool _isActive = false;
base::Timer _isActiveTimer;
bool _wasInactivePress = false;
base::Timer _inactivePressTimer;
object_ptr<MediaView> _mediaView = { nullptr };
base::Observable<void> _dragFinished;
base::Observable<void> _widgetGrabbed;
};
} // namespace Window