From 95a02b769f5be8aba73bdf558023a6e9a73264f2 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen <richard.gustavsen@digia.com> Date: Fri, 3 May 2013 18:48:35 +0200 Subject: [PATCH] SplitView: update code to use 'clampedMinMax' function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function was added in a previous patch, so reuse it for already existing code. Change-Id: Icd5daf195af7e249d4273bbc32a290bed5f0eaa5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> --- src/controls/SplitView.qml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml index 40d166d89..7d013bddc 100644 --- a/src/controls/SplitView.qml +++ b/src/controls/SplitView.qml @@ -275,14 +275,7 @@ Item { for (var i=0; i<__items.length; ++i) { if (i !== d.expandingIndex) { var item = __items[i]; - if (item.Layout[maximum] !== undefined) { - if (item.Layout[maximum] >= 0 && item[d.size] > item.Layout[maximum]) - item[d.size] = item.Layout[maximum] - } - if (item.Layout[minimum] !== undefined) { - if (item[d.size] < item.Layout[minimum]) - item[d.size] = item.Layout[minimum] - } + item[d.size] = clampedMinMax(item[d.size], item.Layout[d.minimum], item.Layout[d.maximum]) } } -- GitLab