mirror of https://github.com/buggins/dlangui.git
resizer controls: continue
This commit is contained in:
parent
2c57bf8e55
commit
f1b729ce44
|
@ -39,6 +39,7 @@ struct LayoutItem {
|
||||||
int _weight; // weight
|
int _weight; // weight
|
||||||
bool _fillParent;
|
bool _fillParent;
|
||||||
bool _isResizer;
|
bool _isResizer;
|
||||||
|
int _resizerDelta;
|
||||||
@property bool canExtend() { return !_isResizer; }
|
@property bool canExtend() { return !_isResizer; }
|
||||||
@property int measuredSize() { return _measuredSize; }
|
@property int measuredSize() { return _measuredSize; }
|
||||||
@property int minSize() { return _measuredSize; }
|
@property int minSize() { return _measuredSize; }
|
||||||
|
@ -55,8 +56,10 @@ struct LayoutItem {
|
||||||
void set(Widget widget, Orientation orientation) {
|
void set(Widget widget, Orientation orientation) {
|
||||||
_widget = widget;
|
_widget = widget;
|
||||||
_orientation = orientation;
|
_orientation = orientation;
|
||||||
if (cast(ResizerWidget)widget)
|
if (cast(ResizerWidget)widget) {
|
||||||
_isResizer = true;
|
_isResizer = true;
|
||||||
|
_resizerDelta = (cast(ResizerWidget)widget).delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// set item and measure it
|
/// set item and measure it
|
||||||
void measure(int parentWidth, int parentHeight) {
|
void measure(int parentWidth, int parentHeight) {
|
||||||
|
@ -203,10 +206,17 @@ class LayoutItems {
|
||||||
//Log.d("VerticalLayout delta=", delta, ", nonres=", nonresizableWeight, ", res=", resizableWeight, ", scale=", scaleFactor);
|
//Log.d("VerticalLayout delta=", delta, ", nonres=", nonresizableWeight, ", res=", resizableWeight, ", scale=", scaleFactor);
|
||||||
// find last resized - to allow fill space 1 pixel accurate
|
// find last resized - to allow fill space 1 pixel accurate
|
||||||
int lastResized = -1;
|
int lastResized = -1;
|
||||||
|
ResizerWidget resizer = null;
|
||||||
|
int resizerIndex = -1;
|
||||||
|
int resizerDelta = 0;
|
||||||
for (int i = 0; i < _count; i++) {
|
for (int i = 0; i < _count; i++) {
|
||||||
LayoutItem * item = &_list[i];
|
LayoutItem * item = &_list[i];
|
||||||
if ((item.fillParent || needForceResize) && (delta < 0 || item.canExtend)) {
|
if ((item.fillParent || needForceResize) && (delta < 0 || item.canExtend)) {
|
||||||
lastResized = i;
|
lastResized = i;
|
||||||
|
}
|
||||||
|
if (item._isResizer) {
|
||||||
|
resizerIndex = i;
|
||||||
|
resizerDelta = item._resizerDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// final resize and layout of children
|
// final resize and layout of children
|
||||||
|
|
Loading…
Reference in New Issue