From e22834216d596ac18da85fced64492b191a64893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 27 Oct 2016 15:34:42 +0200 Subject: [PATCH] [apps/calculation] Fit the layout of result view to the size of the float text Change-Id: Iad6b2021a23c491b166e518bba625dcf69c3757a --- apps/calculation/history_view_cell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index 29503fb4e..b1b6012fa 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -43,7 +43,8 @@ void HistoryViewCell::layoutSubviews() { } else { m_prettyPrint.setFrame(KDRect(k_digitHorizontalMargin, k_digitVerticalMargin, prettyPrintSize.width(), prettyPrintSize.height())); } - KDRect resultFrame(width - k_resultWidth - k_digitHorizontalMargin, prettyPrintSize.height() + 2*k_digitVerticalMargin, k_resultWidth, height - prettyPrintSize.height() - 2*k_digitVerticalMargin); + KDSize resultSize = m_result.minimalSizeForOptimalDisplay(); + KDRect resultFrame(width - resultSize.width() - k_digitHorizontalMargin, prettyPrintSize.height() + 2*k_digitVerticalMargin, resultSize.width(), height - prettyPrintSize.height() - 2*k_digitVerticalMargin); m_result.setFrame(resultFrame); }