summaryrefslogtreecommitdiffstats
path: root/qml
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-10-29 10:14:24 +0100
committerNiels Weber <niels.weber@digia.com>2014-10-29 10:27:26 +0100
commit5ce6fd06ba40f38acd36aa2ee06db777cdbffcbe (patch)
tree1299b07ab1346dc440d02cbc434d3829b7ce233b /qml
parentb8590127305fdcbdd1cc8f86a31f832b3e3f2984 (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.qml18
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)