Updated with native ui (imgui + qt)

This commit is contained in:
Martino Ferrari
2026-05-27 15:46:50 +02:00
parent 3dd0d863fa
commit cf174edde8
205 changed files with 157039 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <QToolButton>
#include <functional>
/**
* A toolbar button that opens a small popup grid of layout preview buttons.
* Each cell draws a schematic of the grid it represents.
*
* The user clicks a cell → the popup closes → callback fires with the layout index.
*/
class LayoutPicker : public QToolButton {
Q_OBJECT
public:
explicit LayoutPicker(QWidget* parent = nullptr);
/** 0-based index matching the Layout enum order:
* 0=1×1 1=1×2 2=1×3 3=1×4 4=2×1 5=2×2 6=3×1 7=4×1 */
void setCurrentLayout(int idx);
int currentLayout() const { return current_; }
signals:
void layoutSelected(int idx);
private:
void openPopup();
int current_ = 0;
struct LayoutDef {
const char* label; // e.g. "1×2"
int rows, cols;
};
static const LayoutDef kLayouts[8];
};