summaryrefslogtreecommitdiff
path: root/src/controls/SplitView.qml
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-05-10 10:28:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-10 13:19:56 +0200
commit015acded4a6be165c30d088747f740933fa79483 (patch)
treeb8688828c3b6e5eac7b355ee9f8b2d9f2581842d /src/controls/SplitView.qml
parent9402917fac71d71a96154c11cb401534fa3b7ea3 (diff)
downloadqtquickcontrols-015acded4a6be165c30d088747f740933fa79483.tar.gz
Remove unneeded checks for -1 (infinity) in SplitView
With commit 16558ac71509fe51a4cf18f238e4f61b37323fe4 Layout.maximumWidth and Layout.maximumHeight now returns Number.POSITIVE_INFINITY instead of -1. As described in that commit, comparisons against those properties does not need any special handling for -1 anymore. Change-Id: I8d4bba0fa87f9c67ac30dd40a8be8cb99abba283 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/controls/SplitView.qml')
-rw-r--r--src/controls/SplitView.qml7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml
index 0c50bc3b..fc43874e 100644
--- a/src/controls/SplitView.qml
+++ b/src/controls/SplitView.qml
@@ -231,9 +231,9 @@ Item {
function clampedMinMax(value, minimum, maximum)
{
- if (minimum !== -1 && value < minimum)
+ if (value < minimum)
value = minimum
- if (maximum !== -1 && value > maximum)
+ if (value > maximum)
value = maximum
return value
}
@@ -286,8 +286,7 @@ Item {
var fillItem = __items[fillIndex]
var superfluous = root[d.size] - d.accumulatedSize(0, __items.length, false)
var s = Math.max(superfluous, fillItem.Layout[minimum])
- if (fillItem.Layout[maximum] !== -1)
- s = Math.min(s, fillItem.Layout[maximum])
+ s = Math.min(s, fillItem.Layout[maximum])
fillItem[d.size] = s
}