NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

[UI] Status bar eolFormat StatusLabel needs to be wider

Open inkydragon opened this issue 3 years ago • 5 comments
trafficstars

image

https://github.com/dail8859/NotepadNext/blob/6888d4b9fb7544a5ba9ce06228ba603f37e06e5d/src/NotepadNext/widgets/EditorInfoStatusBar.cpp#L38

Maybe 120?

-     eolFormat = new StatusLabel(100);
+     eolFormat = new StatusLabel(120);

image

inkydragon avatar May 30 '22 14:05 inkydragon

Do you happen to know what font that is using for the UI (looks like a mono-spaced font which will definitely take up much more room)? What OS are you using?

On Windows I'm assuming it defaults to some flavor of Segoe UI which fits fine.

image

It might be better to dynamically calculate an appropriate width for that section (and maybe other sections) of the status bar based on the font being used.

Even your selection information has barely enough information, whereas on my screenshot there's plenty of room.

dail8859 avatar May 31 '22 12:05 dail8859

    qInfo("rawName: %s", qUtf8Printable(app.font().rawName()));
    qInfo("family: %s", qUtf8Printable(app.font().family()));
    qInfo("defaultFamily: %s", qUtf8Printable(app.font().defaultFamily()));
    qInfo("styleName: %s", qUtf8Printable(app.font().styleName()));
    qInfo("toString: %s", qUtf8Printable(app.font().toString()));
[     0.174] I: rawName: unknown
[     0.174] I: family: SimSun
[     0.939] W: Unable to enumerate family ' "Ubuntu Mono derivative Powerline" '
[     1.057] I: defaultFamily: SimSun
[     1.057] I: styleName: 
[     1.057] I: toString: SimSun,9,-1,5,50,0,0,0,0,0

So, maybe SimSun @ 10pt

image

I'am using Windows 10.

inkydragon avatar May 31 '22 18:05 inkydragon

Thanks for that additional info!

I'am using Windows 10.

Interesting. Any idea why it is using a non-standard font? Did you change the default Font in Windows? If so this will give me a way to reproduce the issue.

dail8859 avatar May 31 '22 18:05 dail8859

Any idea why it is using a non-standard font? Did you change the default Font in Windows?

I'm not sure. My system language setting is Simplified Chinese (zh-CN), may be related to this. I guess you can simulate this by manually specifying QT's font settings: QFont Class | Qt GUI 5.15.9

Some additional information: I'm not quite sure of the exact definition of the default font. But noMeiryoUI tells me that my global default font is: Microsoft YaHei UI 9pt.

It looks like QT will read the system settings if the default font is not set.

inkydragon avatar Jun 01 '22 12:06 inkydragon

Thanks for the info.

My system language setting is Simplified Chinese (zh-CN), may be related to this.

Yeah possibly. Windows might try to select a better font for other languages.

I guess you can simulate this by manually specifying QT's font settings

Agreed this is probably the best way to test it instead of trying to mess around with Windows settings. Really all that's needed is to force a different default font.

dail8859 avatar Jun 01 '22 13:06 dail8859

Maybe this issue has been fixed since v0.6? I'd like to close this.

image

inkydragon avatar Jan 25 '23 12:01 inkydragon

Maybe this issue has been fixed since v0.6?

Great to hear! Most likely the upgrade to Qt6 fixed the issue for us :)

dail8859 avatar Jan 25 '23 13:01 dail8859