diff --git a/gb.gtk/src/CContainer.cpp b/gb.gtk/src/CContainer.cpp index d6df3c1c9..4470139a9 100644 --- a/gb.gtk/src/CContainer.cpp +++ b/gb.gtk/src/CContainer.cpp @@ -159,9 +159,9 @@ END_PROPERTY BEGIN_PROPERTY(Container_Indent) if (READ_PROPERTY) - GB.ReturnInteger(WIDGET->indent()); + GB.ReturnBoolean(WIDGET->indent()); else - WIDGET->setMargin(VPROP(GB_INTEGER)); + WIDGET->setIndent(VPROP(GB_BOOLEAN)); END_PROPERTY @@ -536,10 +536,10 @@ END_PROPERTY BEGIN_PROPERTY(UserContainer_Indent) if (READ_PROPERTY) - GB.ReturnInteger(WIDGET_CONT->indent()); + GB.ReturnBoolean(WIDGET_CONT->indent()); else { - WIDGET_CONT->setIndent(VPROP(GB_INTEGER)); + WIDGET_CONT->setIndent(VPROP(GB_BOOLEAN)); THIS_UC->save = WIDGET_CONT->fullArrangement(); } diff --git a/gb.gtk/src/gcontainer.cpp b/gb.gtk/src/gcontainer.cpp index 6426b552b..eeb043c45 100644 --- a/gb.gtk/src/gcontainer.cpp +++ b/gb.gtk/src/gcontainer.cpp @@ -348,11 +348,9 @@ void gContainer::setMargin(bool vl) } } -void gContainer::setIndent(int vl) +void gContainer::setIndent(bool vl) { - if (vl < 0) - vl = 1; - if (vl >= 0 && vl <= 7 && vl != arrangement.indent) + if (vl != arrangement.indent) { arrangement.indent = vl; performArrange(); diff --git a/gb.gtk/src/gcontainer.h b/gb.gtk/src/gcontainer.h index aaf0fecd0..e669ee07c 100644 --- a/gb.gtk/src/gcontainer.h +++ b/gb.gtk/src/gcontainer.h @@ -34,11 +34,11 @@ struct gContainerArrangement unsigned margin : 1; unsigned spacing : 1; unsigned padding : 8; - unsigned indent : 4; + unsigned indent : 1; unsigned dirty : 1; unsigned autoresize : 1; unsigned invert : 1; - unsigned _reserved: 9; + unsigned _reserved: 12; }; class gContainer : public gControl @@ -54,7 +54,7 @@ public: int padding() const { return arrangement.padding; } bool spacing() const { return arrangement.spacing; } bool margin() const { return arrangement.margin; } - int indent() const { return arrangement.indent; } + bool indent() const { return arrangement.indent; } bool invert() const { return arrangement.invert; } virtual int clientWidth(); @@ -72,7 +72,7 @@ public: void setPadding(int vl); void setSpacing(bool vl); void setMargin(bool vl); - void setIndent(int vl); + void setIndent(bool vl); void setInvert(bool vl); virtual int childCount() const; diff --git a/gb.qt4/src/CContainer.cpp b/gb.qt4/src/CContainer.cpp index 7f23c1eac..fff645c9b 100755 --- a/gb.qt4/src/CContainer.cpp +++ b/gb.qt4/src/CContainer.cpp @@ -1074,12 +1074,11 @@ END_PROPERTY BEGIN_PROPERTY(Container_Indent) if (READ_PROPERTY) - GB.ReturnInteger(THIS_ARRANGEMENT->indent); + GB.ReturnBoolean(THIS_ARRANGEMENT->indent); else { - int val = VPROP(GB_INTEGER); - if (val < 0) val = 1; - if (val != THIS_ARRANGEMENT->indent && val >= 0 && val <= 7) + bool val = VPROP(GB_BOOLEAN); + if (val != THIS_ARRANGEMENT->indent) { THIS_ARRANGEMENT->indent = val; arrange_now(CONTAINER); diff --git a/gb.qt4/src/CContainer.h b/gb.qt4/src/CContainer.h index bbea8d801..cde3abadc 100644 --- a/gb.qt4/src/CContainer.h +++ b/gb.qt4/src/CContainer.h @@ -44,11 +44,11 @@ typedef unsigned margin : 1; unsigned spacing : 1; unsigned padding : 8; - unsigned indent : 4; + unsigned indent : 1; unsigned dirty : 1; unsigned autoresize : 1; unsigned invert : 1; - unsigned _reserved: 8; + unsigned _reserved: 12; } CARRANGEMENT;