mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-07-14 17:13:35 -07:00
Add transform/scaling modes to GUI
Added zoom and stretch modes to GUI to mirror the transform modes available on Android. They are reachable through a context menu or shortcuts (Ctrl+S/Ctrl+Z). CLI options --stretch and --zoom have been added as well. Co-authored-by: Florian Märkl <info@florianmaerkl.de>
This commit is contained in:
parent
74d39e6314
commit
801f902bea
9 changed files with 207 additions and 28 deletions
|
@ -3,6 +3,8 @@
|
|||
#ifndef CHIAKI_AVOPENGLWIDGET_H
|
||||
#define CHIAKI_AVOPENGLWIDGET_H
|
||||
|
||||
#include "transformmode.h"
|
||||
|
||||
#include <chiaki/log.h>
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
|
@ -74,21 +76,24 @@ class AVOpenGLWidget: public QOpenGLWidget
|
|||
public:
|
||||
static QSurfaceFormat CreateSurfaceFormat();
|
||||
|
||||
explicit AVOpenGLWidget(StreamSession *session, QWidget *parent = nullptr);
|
||||
explicit AVOpenGLWidget(StreamSession *session, QWidget *parent = nullptr, TransformMode transform_mode = TransformMode::Fit);
|
||||
~AVOpenGLWidget() override;
|
||||
|
||||
void SwapFrames();
|
||||
AVOpenGLFrame *GetBackgroundFrame() { return &frames[1 - frame_fg]; }
|
||||
|
||||
void SetTransformMode(TransformMode mode) { transform_mode = mode; }
|
||||
TransformMode GetTransformMode() const { return transform_mode; }
|
||||
|
||||
protected:
|
||||
TransformMode transform_mode;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
void initializeGL() override;
|
||||
void paintGL() override;
|
||||
|
||||
private slots:
|
||||
void ResetMouseTimeout();
|
||||
public slots:
|
||||
void ResetMouseTimeout();
|
||||
void HideMouse();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue