diff options
author | Caroline Chao <caroline.chao@digia.com> | 2014-10-29 10:14:24 +0100 |
---|---|---|
committer | Niels Weber <niels.weber@digia.com> | 2014-10-29 10:27:26 +0100 |
commit | 5ce6fd06ba40f38acd36aa2ee06db777cdbffcbe (patch) | |
tree | 1299b07ab1346dc440d02cbc434d3829b7ce233b /qml | |
parent | b8590127305fdcbdd1cc8f86a31f832b3e3f2984 (diff) |
Improve Breaks handling
If the time does not fit, do not display it.
Change-Id: I2381aeb548444117c276db20a2adbb07153f2b10
Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'qml')
-rw-r--r-- | qml/components/TrackSwitcher.qml | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/qml/components/TrackSwitcher.qml b/qml/components/TrackSwitcher.qml index 411ab40..47ebe20 100644 --- a/qml/components/TrackSwitcher.qml +++ b/qml/components/TrackSwitcher.qml @@ -312,9 +312,25 @@ Rectangle { width: Functions.countTrackWidth(start, end) - Theme.margins.ten height: Math.min(breakColumn.height, listView.contentHeight - Theme.margins.ten) Text { + id: testWidth + visible: false + text: Qt.formatTime(start, "h:mm") + " - " + Qt.formatTime(end, "h:mm") + width: parent.width + verticalAlignment: Text.AlignVCenter + height: parent.height + horizontalAlignment: Text.AlignHCenter + font.pointSize: Theme.fonts.seven_pt + function isTooWide() { + return testWidth.implicitWidth > testWidth.width + } + } + + Text { function info() { - var info = name + "\n" + Qt.formatTime(start, "h:mm") + " - " + Qt.formatTime(end, "h:mm") + var info = name + if (!testWidth.isTooWide()) + info = info + "\n" + Qt.formatTime(start, "h:mm") + " - " + Qt.formatTime(end, "h:mm") if (!!performer) info = info + "\n" + Theme.text.by.arg(performer) if (!!room) |