guerinoni / qTsConverter

A simple tool to convert qt translation file (ts) to other format (xlsx / csv) and vice versa
MIT License
42 stars 16 forks source link

Text cut inside conversion combo-box #9

Closed AndreaRicchi closed 4 years ago

AndreaRicchi commented 4 years ago

With the latest UI changes, the text inside the conversion combo-box is longer than the combo itself.

Screenshot from 2020-03-05 19-07-10

kelteseth commented 4 years ago

Interesting. On windows this looks normal: image

An easy fix: image

RowLayout {
            spacing: 20
            ComboBox {
                id: comboType
                Layout.preferredWidth: 200
                model: ["TS => CSV", "CSV => TS", "TS => XLSX", "XLSX => TS"]
            }
AndreaRicchi commented 4 years ago

I think the issue is related to the fact that I don't have the Roboto font installed. I think is better to embed it in the application instead of applying a simple hotfix.

kelteseth commented 4 years ago

Ok but I only can add the fonts when we move the qml.qrc file in the root dir. For some reason qrc does not like ../paths

    // Returns -1 aka faild
    qDebug() << QFontDatabase::addApplicationFont(":/../assets/fonts/Roboto-Light.ttf");
    qDebug() << QFontDatabase::addApplicationFont(":/../assets/fonts/Roboto-Regular.ttf");

   // Returns 0 1
    qDebug() << QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Light.ttf");
    qDebug() << QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Regular.ttf");
kelteseth commented 4 years ago

@AndreaRicchi can you test my changes at https://github.com/kelteseth/qt-ts-csv ?

AndreaRicchi commented 4 years ago

I've just tested it and it works properly. The fonts are loaded correctly and the combo box text is not cut.

kelteseth commented 4 years ago

Ok thanks!