The regular scroll area can expand horizontally, but the problem with this is that sometimes there are controls within it that expand way too big. For example, the properties window for window capture can have a list of windows where the titles of the windows are really really long, and it causes the properties to extend way too far to the right, making the window look really unusual. Another example are the volume controls in the main window that can expand way to the right if the name of a source is really long, causing the volume control to stretch way too far to the right, making the volume controls difficult to use when that happens. So this just makes it so it sets the maximum width of a scroll area's internal widget to the actual width of the scroll area, preventing it from going off the side of the scroll area.
19 lines
268 B
C++
19 lines
268 B
C++
#pragma once
|
|
|
|
#include <QScrollArea>
|
|
|
|
class QResizeEvent;
|
|
|
|
class VScrollArea : public QScrollArea {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
inline VScrollArea(QWidget *parent = nullptr)
|
|
: QScrollArea(parent)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual void resizeEvent(QResizeEvent *event) override;
|
|
};
|