From 8fb73a7c77cbcdba6b0fa5c8b9e2231f1681b15e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 14 May 2022 12:35:25 +0200 Subject: [PATCH] channellist: try to fix description length; pt. 2 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/398a3324357e6afb3da8ab99cb16f499fe958424 Author: vanhofen Date: 2022-05-14 (Sat, 14 May 2022) Origin message was: ------------------ - channellist: try to fix description length; pt. 2 --- src/gui/channellist.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 89e8a2361..1a28e4f9c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2190,6 +2190,8 @@ void CChannelList::paintItem(int pos, const bool firstpaint) unsigned int chan_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(chan_desc); int max_desc_len = max_name_len - chan_name_len; + if ((g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_RIGHT_MIDDLE) || (g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_RIGHT_BOTTOM)) + max_desc_len -= OFFSET_INNER_MID; if (max_desc_len < 0) max_desc_len = 0; if ((int) chan_desc_len > max_desc_len) @@ -2222,15 +2224,10 @@ void CChannelList::paintItem(int pos, const bool firstpaint) g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID, ypos + fheight, chan_name_len, chan_name, color); int chan_desc_x; - if ((g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_LEFT_MIDDLE) || (g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_LEFT_BOTTOM)) - { - chan_desc_x = x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID + chan_name_len; - } - else - { - chan_desc_len -= OFFSET_INNER_MID; + if ((g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_RIGHT_MIDDLE) || (g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_RIGHT_BOTTOM)) chan_desc_x = x + width - SCROLLBAR_WIDTH - offset_right - chan_desc_len; - } + else + chan_desc_x = x + OFFSET_INNER_MID + numwidth + OFFSET_INNER_MID + prg_offset + OFFSET_INNER_MID + chan_name_len; int chan_desc_y_off; if ((g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_LEFT_MIDDLE) || (g_settings.channellist_epgtext_alignment == EPGTEXT_ALIGN_RIGHT_MIDDLE))