mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
[VDD] Fix minimum size by adding a compact mode to quickSettingsButtons (#6890)
* [VDD] Fix minimum size by adding a compact mode to quickSettingsButtons Took 17 minutes Took 5 seconds * Fix and use FlowWidget/FlowLayout Took 35 minutes Took 4 seconds * Set spacings. Took 12 minutes * Make VDE tools flow Took 1 hour 23 minutes Took 5 seconds * Squeeze and flow even more. Took 11 minutes * Make pushbutton compact. Took 54 minutes Took 7 seconds --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
762e742be0
commit
7153f7d4c1
21 changed files with 666 additions and 617 deletions
|
|
@ -1,22 +1,23 @@
|
|||
/**
|
||||
* @file flow_widget.h
|
||||
* @ingroup UI
|
||||
* @brief TODO: Document this.
|
||||
* @brief A QWidget that wraps a FlowLayout inside an optional QScrollArea.
|
||||
*/
|
||||
|
||||
#ifndef FLOW_WIDGET_H
|
||||
#define FLOW_WIDGET_H
|
||||
|
||||
#include "../../../layouts/flow_layout.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLoggingCategory>
|
||||
#include <QScrollArea>
|
||||
#include <QWidget>
|
||||
#include <qscrollarea.h>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(FlowWidgetLog, "flow_widget", QtInfoMsg);
|
||||
inline Q_LOGGING_CATEGORY(FlowWidgetSizeLog, "flow_widget.size", QtInfoMsg);
|
||||
|
||||
class FlowWidget final : public QWidget
|
||||
class FlowWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -25,17 +26,20 @@ public:
|
|||
Qt::Orientation orientation,
|
||||
Qt::ScrollBarPolicy horizontalPolicy,
|
||||
Qt::ScrollBarPolicy verticalPolicy);
|
||||
|
||||
void addWidget(QWidget *widget_to_add) const;
|
||||
void insertWidgetAtIndex(QWidget *toInsert, int index);
|
||||
void removeWidget(QWidget *widgetToRemove) const;
|
||||
void clearLayout();
|
||||
|
||||
[[nodiscard]] int count() const;
|
||||
[[nodiscard]] QLayoutItem *itemAt(int index) const;
|
||||
|
||||
QScrollArea *scrollArea;
|
||||
QScrollArea *scrollArea; ///< Null when both scroll policies are AlwaysOff.
|
||||
|
||||
public slots:
|
||||
void setMinimumSizeToMaxSizeHint();
|
||||
void setSpacing(int hSpacing, int vSpacing);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
|
@ -47,4 +51,4 @@ private:
|
|||
QWidget *container;
|
||||
};
|
||||
|
||||
#endif // FLOW_WIDGET_H
|
||||
#endif // FLOW_WIDGET_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue