Timeline: Fix visual appearance of filter menu

The text next to the checkboxes needs to be elided to fit into the
menu. The filter gets reset every time we clear and reload. The
checkboxes reflect this now.

Change-Id: If34188a4abb0c087a8f585653abcf0a787fc3232
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-04-14 17:00:51 +02:00
parent d3c06c9e4a
commit bd964ab0be

View File

@@ -30,6 +30,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0
Rectangle {
id: root
@@ -401,10 +402,25 @@ Rectangle {
anchors.right: filterMenu.right
height: buttonsBar.height
y: index * height
text: modelData.displayName
enabled: !modelData.empty
checked: enabled && !modelData.hidden
checked: true
onCheckedChanged: modelData.hidden = !checked
style: CheckBoxStyle {
label: Text {
width: filterMenu.width - implicitHeight * 1.5
color: control.enabled ? "black" : "#808080"
text: modelData.displayName
textFormat: Text.PlainText
elide: Text.ElideRight
renderType: Text.NativeRendering
}
}
Connections {
target: modelData
onEmptyChanged: checked = true
}
}
}