mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
Properly calculate a lot of things related to these layouts. (#5817)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
6661a5d946
commit
80b6d6a31f
5 changed files with 118 additions and 99 deletions
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
#include <QLayout>
|
||||
#include <QList>
|
||||
#include <QLoggingCategory>
|
||||
#include <QWidget>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(OverlapLayoutLog, "overlap_layout");
|
||||
|
||||
class OverlapLayout : public QLayout
|
||||
{
|
||||
public:
|
||||
|
|
@ -12,7 +15,8 @@ public:
|
|||
int overlapPercentage = 10,
|
||||
int maxColumns = 2,
|
||||
int maxRows = 2,
|
||||
Qt::Orientation direction = Qt::Horizontal);
|
||||
Qt::Orientation overlapDirection = Qt::Vertical,
|
||||
Qt::Orientation flowDirection = Qt::Horizontal);
|
||||
~OverlapLayout();
|
||||
|
||||
void addItem(QLayoutItem *item) override;
|
||||
|
|
@ -35,7 +39,8 @@ private:
|
|||
int overlapPercentage;
|
||||
int maxColumns;
|
||||
int maxRows;
|
||||
Qt::Orientation direction;
|
||||
Qt::Orientation overlapDirection;
|
||||
Qt::Orientation flowDirection;
|
||||
|
||||
// Calculate the preferred size of the layout
|
||||
QSize calculatePreferredSize() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue