Refactor EventContent

Use proper layouts and get rid of multiple annoyances/bugs like
text-wrapping randomly happening in the middle of words, background
rectangles being too large, a certain binding loop, etc
This commit is contained in:
miruka
2019-09-19 15:49:29 -04:00
parent 4c4d747ecf
commit d20ab5a348
11 changed files with 183 additions and 139 deletions

View File

@@ -167,6 +167,16 @@ function thumbnailParametersFor(width, height) {
}
function fitSize(width, height, max) {
if (width >= height) {
let new_width = Math.min(width, max)
return Qt.size(new_width, height / (width / new_width))
}
let new_height = Math.min(height, max)
return Qt.size(width / (height / new_height), new_height)
}
function minutesBetween(date1, date2) {
return ((date2 - date1) / 1000) / 60
}