From cf726e676a9f732b6d312093cbdbc9b5d1219192 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Feb 2020 22:17:59 +0100 Subject: [PATCH] hintbox: supplement to fix getMaxWidth, hintbox have shadow default ON and shadow is added to width in cc_item (dx+sw). This break RestoreScreen Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e6ae6124b153576610317e061a72b4c719c7134f Author: Jacek Jendrzej Date: 2020-02-04 (Tue, 04 Feb 2020) --- src/gui/widget/hintbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index f1547806b..83cc5231a 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -441,11 +441,11 @@ void CHintBox::scroll_down(const uint& hint_id) int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, const int& minWidth) { - int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth()))); + int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth() - shadow_w))); if (ccw_show_header){ initHeader(); int max_title_width = max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation); - return min(max_title_width, (int)frameBuffer->getScreenWidth()); + return min(max_title_width, (int)frameBuffer->getScreenWidth() - shadow_w); } return res;