jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

Buffer delay text cut off

Open djfun opened this issue 4 years ago • 14 comments

Describe the bug When choosing a buffer delay that is different from the predefined 64, 128 or 256, the text is cut off.

To Reproduce On linux: start Jack with buffer size 1024 jackd -d dummy -p 1024 Start jamulus and open the settings window Observe the cut off closing parenthesis.

Expected behavior Text should not get cut off

Screenshots Bildschirmfoto von 2021-04-02 18-00-30 Bildschirmfoto von 2021-04-02 18-00-52

Operating system Ubuntu 20.10

Version of Jamulus both 3.7.0 and latest master

Additional context Seems to happen independent from the selected UI language.

djfun avatar Apr 02 '21 16:04 djfun

I agree that it would be nice if it didn't cut off, but why would you want to work with such a big buffer? The latency will make it pretty useless.

dcorson-ticino-com avatar Apr 02 '21 18:04 dcorson-ticino-com

The problem is not the longer number, it also gets cut off with just 3 digits: Bildschirmfoto von 2021-04-02 21-49-51

There are some sound cards which might require a non-standard buffer size. And: if you are just a listener, you might want to work with a larger buffer size for stability reasons.

djfun avatar Apr 02 '21 19:04 djfun

if I simply add 2 spaces after the text, it works for some reason. But I'm not sure if that is a good workaround:

diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp
index 87638faa..0ac032d0 100755
--- a/src/clientsettingsdlg.cpp
+++ b/src/clientsettingsdlg.cpp
@@ -550,7 +550,7 @@ void CClientSettingsDlg::UpdateSoundCardFrame()
     {
         // special title text with buffer size information added
         grbSoundCrdBufDelay->setTitle ( tr ( "Buffer Delay: " ) +
-            GenSndCrdBufferDelayString ( iCurActualBufSize ) );
+            GenSndCrdBufferDelayString ( iCurActualBufSize ) + "  " );
     }
 }

djfun avatar Apr 03 '21 12:04 djfun

@djfun Couldd you please open a Pull Request if this issue wasn't resolved?

ann0see avatar Jan 26 '22 20:01 ann0see

Problem seems to still exist on current master, I opened a pull request.

djfun avatar Jan 26 '22 22:01 djfun

I don't like the idea of the fix. It sounds like the styling in the form is wrong: the field should accurately resize to the content.

pljones avatar Jan 27 '22 07:01 pljones

It sounds like the styling in the form is wrong: the field should accurately resize to the content.

I had another quick look but don't see anything wrong in our Qt widget/styling usage around grbSoundCrdBufDelay and its title (which is where this information is placed). I've found the following Qt bug which sounds relevant, but is still unresolved. I'd say it is unlikely to be solved in Qt5 (and therefore: on Ubuntu 20.10) at all: https://bugreports.qt.io/browse/QTBUG-31307

@djfun Can you confirm if you're still running Ubuntu 20.10 as noted in the initial report? 20.10 is no longer supported (by Ubuntu upstream), so if this is not any known issue on a supported platform I'd say we should not introduce workarounds which -- to me -- "only" sounds like a small UI glitch.

hoffie avatar Feb 26 '22 21:02 hoffie

I am now using Ubuntu 21.10 (the newest version). Like I wrote in the pull request: maybe the problem only exists with the default font (Ubuntu Regular)..

djfun avatar Feb 26 '22 22:02 djfun

maybe the problem only exists with the default font (Ubuntu Regular)..

You can change that probably?

ann0see avatar Feb 28 '22 21:02 ann0see

maybe the problem only exists with the default font (Ubuntu Regular)..

You can change that probably?

I can change the font for testing, yes. But I don't want to check 100+ fonts to see if there is another one with the same issue.

djfun avatar Feb 28 '22 21:02 djfun

Certainly not. It’s just to ensure that you’re right on the thought that it’s the font misbehaving.

ann0see avatar Feb 28 '22 22:02 ann0see

I spent some more time debugging this and was able to reproduce this issue on Ubuntu 21.10. Using GammaRay I was able to pin-point the exact circumstances:

  • It happens when using the Ubuntu font (which is obviously the default on Ubuntu), even on non-Ubuntu systems.
  • Smaller font sizes (<11) make this problem less severe.
  • It happens on any QGroupBox label which uses at least 7 digits. It becomes more visible as more digits are used.
  • Applying a custom stylesheet to QGroupBox::title fixes the issue (the stylesheet content does not matter)
  • Qt6 does not show this issue.

Therefore, I suspect that this is a character width mis-calculation between Qt and the Ubuntu font (maybe rather on the Qt side as Qt6 seems unaffected). Although this is not a Jamulus bug, it does affect Jamulus Linux users, so I guess it would make sense to add a workaround. I think we should do that on the style-level though and guard it with a Linux/Qt5 #ifdef. I'll try to submit a PR in the coming days.

hoffie avatar Apr 13 '22 08:04 hoffie

Hi,

There are three builds here https://github.com/jamulussoftware/jamulus/pull/2847#issuecomment-1251376746 Do any of them help?

Thanks,

-- Peter

pljones avatar Oct 05 '22 18:10 pljones