Align shader tooltips to account for negative 9-digit ints. Closes #964

This commit is contained in:
baldurk
2018-04-23 14:04:56 +01:00
parent 1096025963
commit 4f32e62886
+15 -15
View File
@@ -2088,25 +2088,25 @@ void ShaderViewer::updateVariableTooltip()
QString text = QFormatStr("<pre>%1\n").arg(var.name);
text +=
lit(" X Y Z W \n"
"----------------------------------------------------\n");
lit(" X Y Z W \n"
"--------------------------------------------------------\n");
text += QFormatStr("float | %1 %2 %3 %4\n")
.arg(Formatter::Format(var.value.fv[0]), 10)
.arg(Formatter::Format(var.value.fv[1]), 10)
.arg(Formatter::Format(var.value.fv[2]), 10)
.arg(Formatter::Format(var.value.fv[3]), 10);
.arg(Formatter::Format(var.value.fv[0]), 11)
.arg(Formatter::Format(var.value.fv[1]), 11)
.arg(Formatter::Format(var.value.fv[2]), 11)
.arg(Formatter::Format(var.value.fv[3]), 11);
text += QFormatStr("uint | %1 %2 %3 %4\n")
.arg(var.value.uv[0], 10, 10, QLatin1Char(' '))
.arg(var.value.uv[1], 10, 10, QLatin1Char(' '))
.arg(var.value.uv[2], 10, 10, QLatin1Char(' '))
.arg(var.value.uv[3], 10, 10, QLatin1Char(' '));
.arg(var.value.uv[0], 11, 10, QLatin1Char(' '))
.arg(var.value.uv[1], 11, 10, QLatin1Char(' '))
.arg(var.value.uv[2], 11, 10, QLatin1Char(' '))
.arg(var.value.uv[3], 11, 10, QLatin1Char(' '));
text += QFormatStr("int | %1 %2 %3 %4\n")
.arg(var.value.iv[0], 10, 10, QLatin1Char(' '))
.arg(var.value.iv[1], 10, 10, QLatin1Char(' '))
.arg(var.value.iv[2], 10, 10, QLatin1Char(' '))
.arg(var.value.iv[3], 10, 10, QLatin1Char(' '));
text += QFormatStr("hex | %1 %2 %3 %4")
.arg(var.value.iv[0], 11, 10, QLatin1Char(' '))
.arg(var.value.iv[1], 11, 10, QLatin1Char(' '))
.arg(var.value.iv[2], 11, 10, QLatin1Char(' '))
.arg(var.value.iv[3], 11, 10, QLatin1Char(' '));
text += QFormatStr("hex | %1 %2 %3 %4")
.arg(Formatter::HexFormat(var.value.uv[0], 4))
.arg(Formatter::HexFormat(var.value.uv[1], 4))
.arg(Formatter::HexFormat(var.value.uv[2], 4))