forked from qt-creator/qt-creator
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:
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 1.0
|
import QtQuick.Controls 1.0
|
||||||
|
import QtQuick.Controls.Styles 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
@@ -401,10 +402,25 @@ Rectangle {
|
|||||||
anchors.right: filterMenu.right
|
anchors.right: filterMenu.right
|
||||||
height: buttonsBar.height
|
height: buttonsBar.height
|
||||||
y: index * height
|
y: index * height
|
||||||
text: modelData.displayName
|
|
||||||
enabled: !modelData.empty
|
enabled: !modelData.empty
|
||||||
checked: enabled && !modelData.hidden
|
checked: true
|
||||||
onCheckedChanged: modelData.hidden = !checked
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user