Fix some QML warnings

This commit is contained in:
David Rowe 2016-03-17 09:51:32 +13:00
parent 48d4316714
commit bef8c5a807
2 changed files with 5 additions and 2 deletions

View file

@ -88,7 +88,7 @@ ModalWindow {
RalewaySemiBold { RalewaySemiBold {
id: mainTextContainer id: mainTextContainer
onTextChanged: d.resize(); onTextChanged: d.resize();
wrapMode: Text.contains("\n") ? Text.NoWrap : Text.WordWrap wrapMode: Text.WordWrap
size: hifi.fontSizes.menuItem size: hifi.fontSizes.menuItem
color: hifi.colors.baseGrayHighlight color: hifi.colors.baseGrayHighlight
anchors { anchors {

View file

@ -42,6 +42,9 @@ ModalWindow {
// For combo boxes // For combo boxes
property bool editable: true; property bool editable: true;
property int titleWidth: 0
onTitleWidthChanged: d.resize();
function updateIcon() { function updateIcon() {
if (!root) { if (!root) {
return; return;
@ -63,7 +66,7 @@ ModalWindow {
readonly property int maxHeight: 720 readonly property int maxHeight: 720
function resize() { function resize() {
var targetWidth = pane.width var targetWidth = Math.max(titleWidth, pane.width)
var targetHeight = (items ? comboBox.controlHeight : textResult.controlHeight) + 5 * hifi.dimensions.contentSpacing.y + buttons.height var targetHeight = (items ? comboBox.controlHeight : textResult.controlHeight) + 5 * hifi.dimensions.contentSpacing.y + buttons.height
root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWdith) ? d.maxWidth : targetWidth) root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWdith) ? d.maxWidth : targetWidth)
root.height = (targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight) root.height = (targetHeight < d.minHeight) ? d.minHeight: ((targetHeight > d.maxHeight) ? d.maxHeight : targetHeight)