fixed window resize delayed for one present

This commit is contained in:
Hane 2024-04-16 19:25:33 +02:00
commit bf01df610d
2 changed files with 63 additions and 30 deletions

View file

@ -85,7 +85,7 @@ Q_OBJECT
public:
SessionWidget(uint64_t idx, SessionHandler* sh, QWidget *parent /* = nullptr */);
~SessionWidget();
void setWidth(uint64_t width, double widthRatio);
void setSize(uint64_t width, uint64_t height);
public slots:
void updateMainVolume(int newValue);
void updateMute(int checked);
@ -106,6 +106,8 @@ Q_OBJECT
public:
ChannelWidget(uint32_t channelCount, EndpointHandler* eph, QWidget *parent = nullptr);
//QSize minimumSizeHint() const override;
//void setMinimum(QSize minimum);
void updateChannel(int channel);
private:
@ -115,7 +117,7 @@ private:
std::vector<QSlider*> channelSliders;
std::vector<QLabel*> channelLabels;
QGridLayout *widgetLayout;
QSize minimum;
};
class EndpointWidget : public QWidget {
@ -123,14 +125,16 @@ Q_OBJECT
public:
EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *parent = nullptr);
//QSize minimumSizeHint() const override;
//void setMinimum(uint64_t height, double heightRatio);
EndpointHandler* getEndpointHandler();
std::map<Roles, ExtendedCheckBox*> getDefaultRolesWidgets();
void setIndex(uint64_t idx);
uint64_t getIndex();
//void setVolume(int channel, float volume);
void setWidth(uint64_t width, double widthRatio);
void setSize(uint64_t width, uint64_t height);
~EndpointWidget();
//void updateMainVolume(float newValue);
@ -170,6 +174,7 @@ private:
uint64_t idx;
ChannelWidget* cw;
std::vector<SessionWidget*> sessionWidgets;
QSize minimum;
//std::vector<EndpointHandler*> *ephs;
//std::vector<QSlider> *sliders;
@ -231,17 +236,15 @@ private:
//TODO: Test
//TODO: Come back here and check all are parametrized
double widthRatio = 0.28;
double heightRatio = 0.05;
uint64_t width;
uint64_t height;
QScrollArea *scrollArea;
HeaderWidget* hw;
QToolBar *mainMenuBar;
QScreen *screen;
//todo: ratio
//Win10 1080p 120%
QSize mwSize;
QSpacerItem* lastRowSpacer;
//public slots:
// void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);