×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Timestamp and location indicators are trimmed.

  • Posts: 189
  • Thank you received: 28
Part of the local time in the upper left corner and part of the location indicator in the lower left corner are cropped.
I want it to be displayed without being croped.


KStars for Windows Version 3.6.6
OS: Windows 11
Last edit: 8 months 4 weeks ago by tkakura.
8 months 4 weeks ago #94519
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 189
  • Thank you received: 28
Hi Jasem
I investigated the issue.

I believe the "current code" below is incorrectly written to increase the height by 1 pixel per line if m_shaded is true.
I believe the correct code is as in "my suggested code".

Current code
int h = fm.height() * (m_shaded ? 1 : m_strings.size());

My proposed code
int h = (fm.height() + (m_shaded ? 1 : 0 )) * m_strings.size();
void InfoBoxWidget::updateSize()
{
    QFontMetrics fm(font());
    int w = 0;
    foreach (const QString &str, m_strings)
    {
        w = qMax(w, fm.horizontalAdvance(str));
    }
 
    int h = fm.height() * (m_shaded ? 1 : m_strings.size());
    // Add padding
    resize(w + 2 * padX, h + 2 * padY + 2);
    adjust();
}

Modified image as shown in "My proposed code"
Last edit: 8 months 2 weeks ago by tkakura.
8 months 2 weeks ago #94806
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 189
  • Thank you received: 28
I have attached the "git diff" file to this post.
8 months 2 weeks ago #94807
Attachments:

Please Log in or Create an account to join the conversation.

If you double click it, it's supposed to show only first line. This is how it works for the last 20+ years.
The following user(s) said Thank You: tkakura
8 months 2 weeks ago #94808

Please Log in or Create an account to join the conversation.

  • Posts: 189
  • Thank you received: 28
Ummm. I did not understand the specifications.
I didn't notice the double click, and the position was also changed by dragging!
8 months 2 weeks ago #94813

Please Log in or Create an account to join the conversation.

Time to create page: 1.048 seconds