From 0371b3005123a8e17a6dca2de02a61ed4281f8be Mon Sep 17 00:00:00 2001
From: xiaoming <2014500726@smail.xtu.edu.cn>
Date: Sat, 3 Feb 2024 23:44:43 +0800
Subject: [PATCH] Optimize menu bar width calculation
Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn>
---
docs/ar_SA.svg | 2 +-
docs/cs_CZ.svg | 2 +-
docs/de_DE.svg | 2 +-
docs/pt_BR.svg | 2 +-
lang/quardCRT_ar_SA.ts | 32 +++---
lang/quardCRT_cs_CZ.ts | 28 +++---
lang/quardCRT_de_DE.ts | 216 ++++++++++++++++++++---------------------
lang/quardCRT_pt_BR.ts | 30 +++---
src/mainwindow.h | 3 +-
9 files changed, 158 insertions(+), 159 deletions(-)
diff --git a/docs/ar_SA.svg b/docs/ar_SA.svg
index c2d7caa9..98360f56 100644
--- a/docs/ar_SA.svg
+++ b/docs/ar_SA.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/cs_CZ.svg b/docs/cs_CZ.svg
index 8c9f1a4c..98360f56 100644
--- a/docs/cs_CZ.svg
+++ b/docs/cs_CZ.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/de_DE.svg b/docs/de_DE.svg
index 99b6296b..f3bf80a8 100644
--- a/docs/de_DE.svg
+++ b/docs/de_DE.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/pt_BR.svg b/docs/pt_BR.svg
index 33cb0edd..98360f56 100644
--- a/docs/pt_BR.svg
+++ b/docs/pt_BR.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lang/quardCRT_ar_SA.ts b/lang/quardCRT_ar_SA.ts
index 901ffe13..59087690 100644
--- a/lang/quardCRT_ar_SA.ts
+++ b/lang/quardCRT_ar_SA.ts
@@ -1222,82 +1222,82 @@
PrintScreen saved to %1
-
+ تم حفظ PrintScreen في %1Save Screenshot
-
+ حفظ لقطة الشاشةImage Files (*.jpg)
-
+ ملفات الصور (*.jpg)Screenshot saved to %1
-
+ تم حفظ لقطة الشاشة في %1Save Session Export
-
+ حفظ تصدير الجلسةText Files (*.txt);;HTML Files (*.html)
-
+ ملفات النص (*.txt);;ملفات HTML (*.html)Text Files (*.txt)
-
+ ملفات النص (*.txt)HTML Files (*.html)
-
+ ملفات HTML (*.html)Session Export saved to %1
-
+ تم حفظ تصدير الجلسة في %1Session Export failed to save to %1
-
+ فشل حفظ تصدير الجلسة في %1Select a directory
-
+ حدد دليلًاSelect a bookmark
-
+ حدد إشارة مرجعيةAre you sure to clean all bookmark?
-
+ هل أنت متأكد من تنظيف كل الإشارات المرجعية؟Port
-
+ منفذVideo background is enabled, please enable animation in global options (more system resources) or change background image.
-
+ تم تمكين الخلفية المتحركة، يرجى تمكين الرسوم المتحركة في الخيارات العامة (مزيد من موارد النظام) أو تغيير صورة الخلفية.Session information get failed.
-
+ فشل الحصول على معلومات الجلسة.
diff --git a/lang/quardCRT_cs_CZ.ts b/lang/quardCRT_cs_CZ.ts
index f8b02c5e..590281f6 100644
--- a/lang/quardCRT_cs_CZ.ts
+++ b/lang/quardCRT_cs_CZ.ts
@@ -1232,72 +1232,72 @@
Image Files (*.jpg)
-
+ Obrázkové soubory (*.jpg)Screenshot saved to %1
-
+ Snímek obrazovky uložen do %1Save Session Export
-
+ Uložit export relaceText Files (*.txt);;HTML Files (*.html)
-
+ Textové soubory (*.txt);;HTML soubory (*.html)Text Files (*.txt)
-
+ Textové soubory (*.txt)HTML Files (*.html)
-
+ HTML soubory (*.html)Session Export saved to %1
-
+ Export relace uložen do %1Session Export failed to save to %1
-
+ Export relace se nepodařilo uložit do %1Select a directory
-
+ Vybrat adresářSelect a bookmark
-
+ Vybrat záložkuAre you sure to clean all bookmark?
-
+ Opravdu chcete vymazat všechny záložky?Port
-
+ PortVideo background is enabled, please enable animation in global options (more system resources) or change background image.
-
+ Video pozadí je povoleno, povolte animaci v globálních možnostech (více systémových prostředků) nebo změňte obrázek pozadí.Session information get failed.
-
+ Načtení informací o relaci se nezdařilo.
diff --git a/lang/quardCRT_de_DE.ts b/lang/quardCRT_de_DE.ts
index 52be1302..185cd010 100644
--- a/lang/quardCRT_de_DE.ts
+++ b/lang/quardCRT_de_DE.ts
@@ -1302,148 +1302,148 @@
Telnet -
-
+ Telnet - Telnet
-
+ TelnetSerial -
-
+ Seriell - Serial
-
+ SeriellRaw -
-
+ Raw - Raw
-
+ RawNamePipe -
-
+ NamePipe - NamePipe
-
+ NamePipeLocal Shell
-
+ Lokale ShellLocal Shell -
-
+ Lokale Shell - Are you sure to disconnect this session?
-
+ Möchten Sie diese Sitzung wirklich trennen?Version
-
+ VersionCommit
-
+ CommitDate
-
+ DatumAuthor
-
+ AutorWebsite
-
+ WebseiteGlobal Shortcuts:
-
+ Globale Tastenkombinationen:show/hide menu bar
-
+ Menüleiste anzeigen/ausblendenconnect to LocalShell
-
+ Mit LocalShell verbindenclone current session
-
+ Aktuelle Sitzung klonenswitch ui to STD mode
-
+ UI in den STD-Modus umschaltenswitch ui to MINI mode
-
+ UI in den MINI-Modus umschaltenswitch to previous session
-
+ Zur vorherigen Sitzung wechselnswitch to next session
-
+ Zur nächsten Sitzung wechselnswitch to session [num]
-
+ Zur Sitzung [Nummer] wechselnGo to line start
-
+ Zur Zeilenanfang gehenGo to line end
-
+ Zum Zeilenende gehenThere are sessions that have not yet been unlocked, please unlock them first.
-
+ Es gibt Sitzungen, die noch nicht entsperrt wurden. Bitte entsperren Sie sie zuerst.Are you sure to quit?
-
+ Möchten Sie wirklich beenden?
@@ -1451,37 +1451,37 @@
Send commands to active session
-
+ Befehle an aktive Sitzung sendenASCII
-
+ ASCIIHEX
-
+ HEXtime
-
+ Zeitms
-
+ msAuto Send
-
+ Automatisch sendenSend
-
+ Senden
@@ -1497,42 +1497,42 @@
Config File
-
+ KonfigurationsdateiTranslate Service
-
+ ÜbersetzungsdienstGoogle Translate
- Google Übersetzer
+ Google ÜbersetzerBaidu Translate
- Baidu Übersetzer
+ Baidu ÜbersetzerMicrosoft Translate
- Microsoft Übersetzer
+ Microsoft ÜbersetzerTerminal background support animation
-
+ Terminalhintergrund unterstützt AnimationenNativeUI(Effective after restart)
-
+ NativeUI (nach Neustart wirksam)Github Copilot
-
+ Github Copilot
@@ -1540,73 +1540,73 @@
Color Schemes
-
+ FarbschemataFont
-
+ SchriftartSeries
-
+ ReiheSize
-
+ GrößeBackground image
-
+ HintergrundbildClear
-
+ LöschenBackground mode
-
+ HintergrundmodusStretch
-
+ StreckenNone
-
+ KeineZoom
-
+ ZoomenFit
-
+ PassenCenter
-
+ ZentrumTile
- Fliese
+ FlieseBackground opacity
-
+ Hintergrunddeckkraft
@@ -1614,62 +1614,62 @@
New tab mode
-
+ Neuer Tab-ModusNew session
-
+ Neue SitzungClone session
-
+ Sitzung klonenLocalShell session
-
+ LocalShell-SitzungNew tab workpath
-
+ Neuer Tab-ArbeitspfadTab title mode
-
+ Tab-Titel-ModusBrief
-
+ KurzFull
-
+ VollständigScroll
-
+ ScrollenTab Title Width
-
+ Tab-Titel-BreiteTab Preview
-
+ Tab-VorschauPreview Width
-
+ Vorschau-Breite
@@ -1677,37 +1677,37 @@
Scrollback lines
-
+ Scrollback-LinienCursor Shape
-
+ Cursor-FormBlock
-
+ BlockierenUnderline
-
+ UnterstreichenIBeam
-
+ IBeamCursor Blink
-
+ Cursor-BlinkenWord Characters
-
+ Wortzeichen
@@ -1715,58 +1715,58 @@
Global Options
-
+ Globale OptionenSelect Background Image
-
+ Hintergrundbild auswählenImage Files (*.png *.jpg *.jpeg *.bmp *.gif);;Video Files (*.mp4 *.avi *.mkv *.mov)
-
+ Bilddateien (*.png *.jpg *.jpeg *.bmp *.gif);;Videodateien (*.mp4 *.avi *.mkv *.mov)Information
-
+ InformationThis feature needs more system resources, please use it carefully!
-
+ Diese Funktion benötigt mehr Systemressourcen. Bitte verwenden Sie sie vorsichtig!This feature is not implemented yet!
-
+ Diese Funktion ist noch nicht implementiert!General
-
+ AllgemeinAppearance
-
+ AussehenTerminal
-
+ TerminalWindow
- Fenster
+ FensterAdvanced
-
+ Erweitert
@@ -1774,7 +1774,7 @@
Transparent window
-
+ Durchsichtiges Fenster
@@ -1782,47 +1782,47 @@
Hex View
- Hex-Ansicht
+ Hex-AnsichtCopy
- Kopieren
+ KopierenCopy Hex
-
+ Hex kopierenDump
-
+ DumpSave As
-
+ Speichern unterBinary File (*.bin)
-
+ Binärdatei (*.bin)Error
-
+ FehlerFailed to save file!
-
+ Datei konnte nicht gespeichert werden!Clear
-
+ Löschen
@@ -1830,7 +1830,7 @@
Bell in session '%1'
-
+ Signalton in Sitzung '%1'
@@ -1838,32 +1838,32 @@
Size: XXX x XXX
-
+ Größe: XXX x XXXSize: %1 x %2
-
+ Größe: %1 x %2Follow link (ctrl + click)
-
+ Link folgen (Strg + Klick)Paste multiline text
-
+ Mehrzeiligen Text einfügenAre you sure you want to paste this text?
-
+ Möchten Sie diesen Text wirklich einfügen?<qt>Output has been <a href="http://en.wikipedia.org/wiki/Flow_control">suspended</a> by pressing Ctrl+S. Press <b>Ctrl+Q</b> to resume.</qt>
-
+ <qt>Die Ausgabe wurde durch Drücken von Strg+S <a href="http://en.wikipedia.org/wiki/Flow_control">angehalten</a>. Drücken Sie <b>Strg+Q</b>, um fortzufahren.</qt>
@@ -1871,7 +1871,7 @@
No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing.
-
+ Kein Tastaturübersetzer verfügbar. Die Informationen, die zum Konvertieren von Tastendrücken in Zeichen, die an das Terminal gesendet werden sollen, fehlen.
@@ -1879,13 +1879,13 @@
Lock Session
- Sitzung sperren
+ Sitzung sperrenEnter the password that will be used to unlock the session:
-
+ Geben Sie das Passwort ein, das zum Entsperren der Sitzung verwendet wird:
diff --git a/lang/quardCRT_pt_BR.ts b/lang/quardCRT_pt_BR.ts
index c96154ba..eb363049 100644
--- a/lang/quardCRT_pt_BR.ts
+++ b/lang/quardCRT_pt_BR.ts
@@ -1227,77 +1227,77 @@
Save Screenshot
-
+ Salvar captura de telaImage Files (*.jpg)
-
+ Arquivos de imagem (*.jpg)Screenshot saved to %1
-
+ Captura de tela salva em %1Save Session Export
-
+ Salvar exportação de sessãoText Files (*.txt);;HTML Files (*.html)
-
+ Arquivos de texto (*.txt);;Arquivos HTML (*.html)Text Files (*.txt)
-
+ Arquivos de texto (*.txt)HTML Files (*.html)
-
+ Arquivos HTML (*.html)Session Export saved to %1
-
+ Exportação de sessão salva em %1Session Export failed to save to %1
-
+ Falha ao salvar a exportação de sessão em %1Select a directory
-
+ Selecione um diretórioSelect a bookmark
-
+ Selecione um favoritoAre you sure to clean all bookmark?
-
+ Você tem certeza de que deseja limpar todos os favoritos?Port
-
+ PortaVideo background is enabled, please enable animation in global options (more system resources) or change background image.
-
+ O plano de fundo de vídeo está ativado, ative a animação nas opções globais (mais recursos do sistema) ou altere a imagem de fundo.Session information get failed.
-
+ Falha ao obter informações da sessão.
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 82dea29f..f2f769e8 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -324,11 +324,10 @@ class MainWindow : public QGoodWindow
* please optimize this code */
int width = 0;
int itemSpacingPx = m_menu_bar->style()->pixelMetric(QStyle::PM_MenuBarItemSpacing);
- qreal deviceratio = m_menu_bar->devicePixelRatio();
for (int i = 0; i < m_menu_bar->actions().size(); i++) {
QString text = m_menu_bar->actions().at(i)->text();
QFontMetrics fm(m_menu_bar->font());
- width += fm.size(0, text).width() + itemSpacingPx*deviceratio;
+ width += fm.size(0, text).width() + itemSpacingPx*1.5;
}
m_good_central_widget->setLeftTitleBarWidth(width);
}