ui/qt/container.h

changeset 802
cc73993a3ff9
parent 672
1b08ba076b65
child 822
54e43e4efac2
--- a/ui/qt/container.h	Sun Oct 05 18:13:15 2025 +0200
+++ b/ui/qt/container.h	Sun Oct 05 19:06:34 2025 +0200
@@ -40,48 +40,13 @@
 #include <QStackedWidget>
 #include <QSplitter>
 
-#define UI_APPLY_LAYOUT(layout, args) \
-    layout.fill = args->fill; \
-    layout.hexpand = args->hexpand; \
-    layout.vexpand = args->vexpand; \
-    layout.hfill = args->hfill; \
-    layout.vfill = args->vfill; \
-    layout.override_defaults = args->override_defaults; \
-    layout.colspan = args->colspan; \
-    layout.rowspan = args->rowspan
-
-#define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout))
-#define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE)
-#define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE)
-
 #define ui_obj_container(obj) (UiContainerPrivate*)((UiContainerX*)obj->container_end)->container
 
-typedef enum UiLayoutBool {
-    UI_LAYOUT_UNDEFINED = 0,
-    UI_LAYOUT_TRUE,
-    UI_LAYOUT_FALSE,
-} UiLayoutBool;
+struct UiContainerPrivate {
+    UIWIDGET current;
+    UiContainerX *container;
 
-typedef struct UiLayout UiLayout;
-struct UiLayout {
-    UiBool       fill;
-    UiBool       newline;
-    char         *label;
-    UiBool       hexpand;
-    UiBool       vexpand;
-    UiBool       hfill;
-    UiBool       vfill;
-    UiBool       override_defaults;
-    int          width;
-    int          colspan;
-    int          rowspan;
-};
-
-struct UiContainerPrivate {
-    UiLayout layout; 
-    UIWIDGET current;
-
-    virtual void add(QWidget *widget) = 0;
+    virtual void add(QWidget *widget, UiLayout& layout) = 0;
     virtual void end() {}
 };
 
@@ -93,7 +58,7 @@
     
     UiBoxContainer(QBoxLayout *box);
     
-    virtual void add(QWidget *widget);
+    virtual void add(QWidget *widget, UiLayout& layout);
 };
 
 class UiGridContainer : public UiContainerPrivate {
@@ -120,7 +85,7 @@
             bool def_hfill,
             bool def_vfill);
     
-    virtual void add(QWidget *widget);
+    virtual void add(QWidget *widget, UiLayout& layout);
     virtual void end();
 };
 

mercurial