From 05da13767025fdaa1dcd0dd57a8c4e467b9b15c1 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Thu, 18 Jan 2018 17:16:34 +0100 Subject: [PATCH] Minor code fixes --- flameshot.pro | 3 +- src/capture/widget/capturebutton.cpp | 2 +- src/capture/widget/capturewidget.cpp | 5 +- src/config/uicoloreditor.cpp | 11 ++- translations/Internationalization_ca.ts | 10 ++- translations/Internationalization_es.ts | 63 +++++++++------- .../Internationalization_ka.ts | 67 +++++++++-------- translations/Internationalization_ru.ts | 63 +++++++++------- translations/Internationalization_tr.ts | 63 +++++++++------- translations/Internationalization_zh_CN.ts | 63 +++++++++------- translations/Internationalization_zh_TW.ts | 71 +++++++++++-------- 11 files changed, 244 insertions(+), 177 deletions(-) rename {translation => translations}/Internationalization_ka.ts (96%) diff --git a/flameshot.pro b/flameshot.pro index cf0997e0..05bc9886 100644 --- a/flameshot.pro +++ b/flameshot.pro @@ -37,7 +37,8 @@ TRANSLATIONS = translations/Internationalization_es.ts \ translations/Internationalization_ru.ts \ translations/Internationalization_zh_CN.ts \ translations/Internationalization_zh_TW.ts \ - translations/Internationalization_tr.ts + translations/Internationalization_tr.ts \ + translations/Internationalization_ka.ts # Generate translations in build TRANSLATIONS_FILES = diff --git a/src/capture/widget/capturebutton.cpp b/src/capture/widget/capturebutton.cpp index 7cb09c82..f6b88cb2 100644 --- a/src/capture/widget/capturebutton.cpp +++ b/src/capture/widget/capturebutton.cpp @@ -166,7 +166,7 @@ void CaptureButton::setColor(const QColor &c) { // getButtonBaseSize returns the base size of the buttons size_t CaptureButton::buttonBaseSize() { - return QApplication::fontMetrics().height() * 2.2 * qApp->devicePixelRatio(); + return QApplication::fontMetrics().lineSpacing() * 2.2; } bool CaptureButton::iconIsWhiteByColor(const QColor &c) { diff --git a/src/capture/widget/capturewidget.cpp b/src/capture/widget/capturewidget.cpp index 6a89f1ff..893ad045 100644 --- a/src/capture/widget/capturewidget.cpp +++ b/src/capture/widget/capturewidget.cpp @@ -198,7 +198,7 @@ void CaptureWidget::paintEvent(QPaintEvent *) { QRectF bRect = painter.boundingRect(helpRect, Qt::AlignCenter, helpTxt); // These four calls provide padding for the rect - const int margin = QApplication::fontMetrics().width("-") * 2; + const int margin = QApplication::fontMetrics().height() / 2; bRect.setWidth(bRect.width() + margin); bRect.setHeight(bRect.height() + margin); bRect.setX(bRect.x() - margin); @@ -622,8 +622,7 @@ void CaptureWidget::updateCursor() { } int CaptureWidget::handleSize() { - return (QApplication::fontMetrics().height() * 0.7) * - qApp->devicePixelRatio(); + return (QApplication::fontMetrics().height() * 0.7); } void CaptureWidget::copyScreenshot() { diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index c54be2f9..3c2e220b 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -19,6 +19,7 @@ #include "uicoloreditor.h" #include "clickablelabel.h" #include +#include #include #include #include @@ -29,13 +30,17 @@ UIcolorEditor::UIcolorEditor(QWidget *parent) : QGroupBox(parent) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_hLayout = new QHBoxLayout; m_vLayout = new QVBoxLayout; - m_hLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding)); + + const size_t space = QApplication::fontMetrics().lineSpacing(); + m_hLayout->addItem(new QSpacerItem(space, space, QSizePolicy::Expanding)); m_vLayout->setAlignment(Qt::AlignVCenter); + initButtons(); initColorWheel(); - m_vLayout->addSpacing(10); + + m_vLayout->addSpacing(space); m_hLayout->addLayout(m_vLayout); - m_hLayout->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding)); + m_hLayout->addItem(new QSpacerItem(space, space, QSizePolicy::Expanding)); setLayout(m_hLayout); updateComponents(); } diff --git a/translations/Internationalization_ca.ts b/translations/Internationalization_ca.ts index 61777eb1..04a0fac6 100644 --- a/translations/Internationalization_ca.ts +++ b/translations/Internationalization_ca.ts @@ -454,7 +454,7 @@ Utilitzeu la roda del ratolí per a canviar el gruix de l'eina.QObject Save As - Anomena i guarda + Anomena i guarda Save Error @@ -472,6 +472,14 @@ Utilitzeu la roda del ratolí per a canviar el gruix de l'eina.Unable to connect via DBus No es pot connectar mitjançant DBus + + Error + Error + + + Unable to write in + No es pot escriure a + RectangleTool diff --git a/translations/Internationalization_es.ts b/translations/Internationalization_es.ts index bb9d4b44..19e95a8b 100644 --- a/translations/Internationalization_es.ts +++ b/translations/Internationalization_es.ts @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With Abrir Con - + Launch in terminal Lanzar en terminal - + Keep open after selection Mantener abierto tras la selección - - + + Error Error - + Unable to write in Imposible escribir en - + Unable to launch in terminal. Imposible lanzar en terminal. @@ -77,12 +77,12 @@ CaptureWidget - + Unable to capture screen Imposible capturar la pantalla - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -109,7 +109,7 @@ Usa la rueda del ratón para cambiar el grosor de la herramienta. ConfigWindow - + Configuration Configuración @@ -122,17 +122,17 @@ Usa la rueda del ratón para cambiar el grosor de la herramienta. Seleccionar Todos - + Interface Interfaz - + Filename Editor Editor de Nombre - + General General @@ -547,24 +547,23 @@ Usa la rueda del ratón para cambiar el grosor de la herramienta. QObject - Save As - Guardar Como + Guardar Como - + Save Error Error al Guardar - - + + Capture saved as Captura guardada como - - + + Error trying to save as Error intentando guardar como @@ -575,6 +574,16 @@ Usa la rueda del ratón para cambiar el grosor de la herramienta. Unable to connect via DBus Imposible conectar mediante DBus + + + Error + Error + + + + Unable to write in + Imposible escribir en + RectangleTool @@ -739,37 +748,37 @@ Usa la rueda del ratón para cambiar el grosor de la herramienta. UIcolorEditor - + UI Color Editor Editor de Color de Interfaz - + Change the color moving the selectors and see the changes in the preview buttons. Cambia el color moviendo los selectores y observa los cambios en los botones de previsualización. - + Select a Button to modify it Selecciona un Botón para modificarlo - + Main Color Color Principal - + Click on this button to set the edition mode of the main color. Clica en este botón para aplicar el modo edición para el color primario. - + Contrast Color Color de Contraste - + Click on this button to set the edition mode of the contrast color. Clica en este botón para aplicar el modo edición para el color de contraste. diff --git a/translation/Internationalization_ka.ts b/translations/Internationalization_ka.ts similarity index 96% rename from translation/Internationalization_ka.ts rename to translations/Internationalization_ka.ts index f6baeef9..0d3c6847 100644 --- a/translation/Internationalization_ka.ts +++ b/translations/Internationalization_ka.ts @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With გახსნა პროგრამით - + Launch in terminal ტერმინალში გაშვება - + Keep open after selection არ დახურო დიალოგი არჩევის შემდეგ - - + + Error შეცდომა - + Unable to write in შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: - + Unable to launch in terminal. ტერმინალში გაშვება ვერ მოხერხდა. @@ -77,12 +77,12 @@ CaptureWidget - + Unable to capture screen ეკრანის გადაღება ვერ მოხერხდა - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -109,30 +109,30 @@ Use the Mouse Wheel to change the thickness of your tool. ConfigWindow - + Configuration პარამეტრები Button Selection - ღილაკის არჩევა + ღილაკის არჩევა Select All - ყველაფრის შერჩევა + ყველაფრის შერჩევა - + Interface ინტერფეისი - + Filename Editor ფაილის სახელის რედაქტორი - + General ზოგადი @@ -543,24 +543,23 @@ Use the Mouse Wheel to change the thickness of your tool. QObject - Save As - შენახვა როგორც + შენახვა როგორც - + Save Error შეცდომა შენახვისას - - + + Capture saved as სურათი შენახულია როგორც: - - + + Error trying to save as შეცდომა მცდელობისას შენახულიყო როგორც: @@ -571,6 +570,16 @@ Use the Mouse Wheel to change the thickness of your tool. Unable to connect via DBus DBus-ით დაკავშირება ვერ მოხერხდა + + + Error + შეცდომა + + + + Unable to write in + შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: + RectangleTool @@ -735,37 +744,37 @@ Use the Mouse Wheel to change the thickness of your tool. UIcolorEditor - + UI Color Editor ინტერფეისის ფერის რედაქტორი - + Change the color moving the selectors and see the changes in the preview buttons. შეცვალეთ ფერი ნიშნულის გადაადგილებით და შეხედეთ ცვლილებებს გადასახედ ღილაკებზე. - + Select a Button to modify it აირჩიეთ ღილაკი მის შესაცვლელად - + Main Color ძირითადი ფერი - + Click on this button to set the edition mode of the main color. დააწექით ამ ღილაკს ძირითადი ფერის არჩევის რეჟიმის ჩასართავად. - + Contrast Color კონტრასტული ფერი - + Click on this button to set the edition mode of the contrast color. დააწექით ამ ღილაკს კონტრასტული ფერის არჩევის რეჟიმის ჩასართავად. diff --git a/translations/Internationalization_ru.ts b/translations/Internationalization_ru.ts index 82a86aeb..7dc2a417 100644 --- a/translations/Internationalization_ru.ts +++ b/translations/Internationalization_ru.ts @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With Открыть с помощью - + Launch in terminal Запустить в терминале - + Keep open after selection Оставить запущенным после выделения - - + + Error Ошибка - + Unable to write in Не удалось сохранить - + Unable to launch in terminal. Не удалось запустить в терминале. @@ -77,12 +77,12 @@ CaptureWidget - + Unable to capture screen Не удалось захватить экран - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -109,7 +109,7 @@ Use the Mouse Wheel to change the thickness of your tool. ConfigWindow - + Configuration Настройка @@ -122,17 +122,17 @@ Use the Mouse Wheel to change the thickness of your tool. Выбрать все - + Interface Интерфейс - + Filename Editor Редактор имен файлов - + General Общее @@ -543,24 +543,23 @@ Use the Mouse Wheel to change the thickness of your tool. QObject - Save As - Сохранить как + Сохранить как - + Save Error Ошибка сохранения - - + + Capture saved as Сохранить снимок как - - + + Error trying to save as Ошибка при попытке сохранить как @@ -571,6 +570,16 @@ Use the Mouse Wheel to change the thickness of your tool. Unable to connect via DBus Не удалось подключиться через DBus + + + Error + Ошибка + + + + Unable to write in + Не удалось сохранить + RectangleTool @@ -735,37 +744,37 @@ Use the Mouse Wheel to change the thickness of your tool. UIcolorEditor - + UI Color Editor Редактор цвета интерфейса - + Change the color moving the selectors and see the changes in the preview buttons. Измените цвет, перемещая выделение, и посмотрите изменения в кнопках предварительного просмотра. - + Select a Button to modify it Выберите кнопку, чтобы изменить ее - + Main Color Основной цвет - + Click on this button to set the edition mode of the main color. Нажмите на эту кнопку, чтобы перейти в режим редактирования основного цвета. - + Contrast Color Контрастный цвет - + Click on this button to set the edition mode of the contrast color. Нажмите на эту кнопку, чтобы перейти в режим редактирования контрастного цвета. diff --git a/translations/Internationalization_tr.ts b/translations/Internationalization_tr.ts index 627a29da..548b94bf 100644 --- a/translations/Internationalization_tr.ts +++ b/translations/Internationalization_tr.ts @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With ile Aç - + Launch in terminal Terminalde aç - + Keep open after selection Seçimden sonra açık tutun - - + + Error Hata - + Unable to write in Yazmak mümkün değil - + Unable to launch in terminal. Terminalde başlatılamadı. @@ -77,12 +77,12 @@ CaptureWidget - + Unable to capture screen Ekran yakalanamadı - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -109,7 +109,7 @@ Araç boyutunu değiştirmek için Fare tekerleğini kullanın. ConfigWindow - + Configuration Ayarlar @@ -122,17 +122,17 @@ Araç boyutunu değiştirmek için Fare tekerleğini kullanın. Seleccionar Todos - + Interface Arayüz - + Filename Editor Dosyaadı Düzenleyici - + General Genel @@ -547,24 +547,23 @@ Araç boyutunu değiştirmek için Fare tekerleğini kullanın. QObject - Save As - Farklı Kaydet + Farklı Kaydet - + Save Error Hata Kaydet - - + + Capture saved as Yakalanma şu şekilde kaydedildi - - + + Error trying to save as Olarak kaydedilmeye çalışılırken hata oluştu @@ -575,6 +574,16 @@ Araç boyutunu değiştirmek için Fare tekerleğini kullanın. Unable to connect via DBus DBus ile bağlanılamadı + + + Error + Hata + + + + Unable to write in + Yazmak mümkün değil + RectangleTool @@ -739,37 +748,37 @@ Araç boyutunu değiştirmek için Fare tekerleğini kullanın. UIcolorEditor - + UI Color Editor UI Renk Editörü - + Change the color moving the selectors and see the changes in the preview buttons. Seçicileri hareket ettiren rengi değiştirin ve önizleme düğmelerindeki değişiklikleri görün. - + Select a Button to modify it Değiştirmek için bir Düğme seçin - + Main Color Ana Renk - + Click on this button to set the edition mode of the main color. Ana rengin baskı modunu ayarlamak için bu düğmeyi tıklayın. - + Contrast Color Kontrast Renk - + Click on this button to set the edition mode of the contrast color. Kontrast renginin baskı modunu ayarlamak için bu düğmeyi tıklayın. diff --git a/translations/Internationalization_zh_CN.ts b/translations/Internationalization_zh_CN.ts index 1d187615..e840d119 100644 --- a/translations/Internationalization_zh_CN.ts +++ b/translations/Internationalization_zh_CN.ts @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With 打开 - + Launch in terminal 在终端中启动 - + Keep open after selection 选择后保持此窗口打开 - - + + Error 错误 - + Unable to launch in terminal. 无法在终端中启动。 - + Unable to write in 无法写入 @@ -77,7 +77,7 @@ CaptureWidget - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -88,7 +88,7 @@ Use the Mouse Wheel to change the thickness of your tool. 使用鼠标滚轮来改变油漆工具的厚度。 - + Unable to capture screen 无法捕获屏幕 无法捕获屏幕 @@ -110,7 +110,7 @@ Use the Mouse Wheel to change the thickness of your tool. ConfigWindow - + Configuration 配置 @@ -123,17 +123,17 @@ Use the Mouse Wheel to change the thickness of your tool. 全选 - + Interface 界面 - + Filename Editor 文件名编辑器 - + General 常规 @@ -548,24 +548,23 @@ Use the Mouse Wheel to change the thickness of your tool. QObject - Save As - 另存为 + 另存为 - + Save Error 保存错误 - - + + Capture saved as 捕获保存为 - - + + Error trying to save as 尝试另存为时出错 @@ -576,6 +575,16 @@ Use the Mouse Wheel to change the thickness of your tool. Unable to connect via DBus 无法通过DBus进行连接 + + + Error + 错误 + + + + Unable to write in + 无法写入 + RectangleTool @@ -740,37 +749,37 @@ Use the Mouse Wheel to change the thickness of your tool. UIcolorEditor - + UI Color Editor UI颜色编辑器 - + Change the color moving the selectors and see the changes in the preview buttons. 移动颜色选择并在预览按钮查看。 - + Select a Button to modify it 选择一个按钮来修改它 - + Main Color 主色 - + Click on this button to set the edition mode of the main color. 点击按钮设置主色。 - + Contrast Color 对比色 - + Click on this button to set the edition mode of the contrast color. 点击按钮设置对比色。 diff --git a/translations/Internationalization_zh_TW.ts b/translations/Internationalization_zh_TW.ts index f8b1530f..cef597ff 100644 --- a/translations/Internationalization_zh_TW.ts +++ b/translations/Internationalization_zh_TW.ts @@ -1,6 +1,6 @@ - + AppLauncher @@ -17,33 +17,33 @@ AppLauncherWidget - + Open With 打開 - + Launch in terminal 在終端機中啟動 - + Keep open after selection 選擇後維持此視窗開啟 - - + + Error 錯誤 - + Unable to launch in terminal. 無法在終端機中啟動 - + Unable to write in 無法寫入 @@ -77,7 +77,7 @@ CaptureWidget - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -88,7 +88,7 @@ Use the Mouse Wheel to change the thickness of your tool. 使用滑鼠滾輪來改變繪製工具的寬度 - + Unable to capture screen 無法擷取螢幕 @@ -109,30 +109,30 @@ Use the Mouse Wheel to change the thickness of your tool. ConfigWindow - + Configuration 設定 Button Selection - 按鈕選擇 + 按鈕選擇 Select All - 全選 + 全選 - + Interface 介面 - + Filename Editor 檔案名稱編輯器 - + General 一般 @@ -459,7 +459,7 @@ Use the Mouse Wheel to change the thickness of your tool. Available shorcuts in the screen capture mode. - 螢幕截取模式中的可用快速鍵 + 螢幕截取模式中的可用快速鍵 @@ -547,24 +547,23 @@ Use the Mouse Wheel to change the thickness of your tool. QObject - Save As - 另存為 + 另存為 - + Save Error 存檔錯誤 - - + + Capture saved as 截圖已另存為 - - + + Error trying to save as 嘗試另存新檔時發生錯誤 @@ -575,6 +574,16 @@ Use the Mouse Wheel to change the thickness of your tool. Unable to connect via DBus 無法透過 DBus 進行連接 + + + Error + 錯誤 + + + + Unable to write in + 無法寫入 + RectangleTool @@ -739,37 +748,37 @@ Use the Mouse Wheel to change the thickness of your tool. UIcolorEditor - + UI Color Editor UI 顏色編輯器 - + Change the color moving the selectors and see the changes in the preview buttons. 移動顏色選擇並在預覽按鈕檢視 - + Select a Button to modify it 選擇一個按鈕來修改它 - + Main Color 主色 - + Click on this button to set the edition mode of the main color. 點選按鈕設定主色 - + Contrast Color 對比色 - + Click on this button to set the edition mode of the contrast color. 點選按鈕設定對比色