From bd964ab0be5070c47a2c65813760413596b028e1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 14 Apr 2015 17:00:51 +0200 Subject: [PATCH] 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 --- src/libs/timeline/qml/MainView.qml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/libs/timeline/qml/MainView.qml b/src/libs/timeline/qml/MainView.qml index 6ec83fc652f..0dbf8f9580b 100644 --- a/src/libs/timeline/qml/MainView.qml +++ b/src/libs/timeline/qml/MainView.qml @@ -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 + } } }