Переглянути джерело

Make more space on the debug overlay

We frequently have the problem that the debug overlay is cut off on the
bottom. QML doesn't appear to provide anything to auto-fit the text on
the debug overlay (well, maybe it shouldn't anyway). So try other means
of making more space.

Cut off long fields on the right panel (playback status). This
specifically cuts off the transcode URL at 400 characters. 400
characters should be enough to know some of the more basic info, like
source host/API and endpoint. You'll have to get the playback log to get
the full URL.

Scale the font size by the window height, not width. It was scaled by
width for the sake of long strings like log path and playback URL, but
using height seems generally better. Also use Math.round, as the
pixelSize is an integer (and will round down by default).

We could probably use pointSize, but it might be rounded too, and I'm
scared of what that might mean if hidpi is active on various platforms.
Vincent Lang 8 роки тому
батько
коміт
9b0a5300a7
2 змінених файлів з 4 додано та 2 видалено
  1. 2 0
      src/player/PlayerComponent.cpp
  2. 2 2
      src/ui/webview.qml

+ 2 - 0
src/player/PlayerComponent.cpp

@@ -1317,6 +1317,8 @@ static QString get_mpv_osd(mpv_handle *ctx, const QString& property)
     return "-";
   QString r = QString::fromUtf8(s);
   mpv_free(s);
+  if (r.size() > 400)
+    r = r.mid(0, 400) + "...";
   Log::CensorAuthTokens(r);
   return r;
 }

+ 2 - 2
src/ui/webview.qml

@@ -284,7 +284,7 @@ KonvergoWindow
       anchors.topMargin: 54
       anchors.bottomMargin: 54
       color: "white"
-      font.pixelSize: width / 45
+      font.pixelSize: Math.round(height / 65)
       wrapMode: Text.WrapAnywhere
 
       function windowDebug()
@@ -314,7 +314,7 @@ KonvergoWindow
       anchors.topMargin: 54
       anchors.bottomMargin: 54
       color: "white"
-      font.pixelSize: width / 45
+      font.pixelSize: Math.round(height / 65)
       wrapMode: Text.WrapAnywhere
 
       text: mainWindow.videoInfo