Opened 8 years ago

Closed 8 years ago

#4156 closed defect (fixed)

OMEdit Visual glitches on high-res monitors

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: normal Milestone: 2.0.0
Component: OMEdit Version:
Keywords: windows Cc:

Description (last modified by massimo ceraolo)

Today's 4k monitors in practice require fonts to be scaled-up. factors between 1.5x - 2.0x on DPI are typical.
Generally OMEdit behaves well in such environments, however:
1) the plus sign near variables in the Variables Browser is too large (First.png)
2) OMEdit about window is too small in comparison with font sizes (Second.png)
3) tools on the main toolbox are correctly scaled-up, while icons of views (icon, diagram, text, documentation) are too small (Third.png).
4) the documentation browser shows a very small font (looks like not being scaled-up, as if its size is set in pixels instead of points)

The screenshots I add refers to 1.75x (i.e. 168 virtual DPI) in windows.

Attachments (8)

First.png (132.3 KB ) - added by massimo ceraolo 8 years ago.
Second.png (172.7 KB ) - added by massimo ceraolo 8 years ago.
Third.png (110.5 KB ) - added by massimo ceraolo 8 years ago.
Fourth.png (78.9 KB ) - added by massimo ceraolo 8 years ago.
Fifth.png (110.5 KB ) - added by massimo ceraolo 8 years ago.
docu.png (35.6 KB ) - added by massimo ceraolo 8 years ago.
info.png (35.4 KB ) - added by massimo ceraolo 8 years ago.
comparison.png (189.4 KB ) - added by massimo ceraolo 8 years ago.

Download all attachments as: .zip

Change History (38)

by massimo ceraolo, 8 years ago

Attachment: First.png added

by massimo ceraolo, 8 years ago

Attachment: Second.png added

comment:1 by massimo ceraolo, 8 years ago

Description: modified (diff)

comment:2 by Adeel Asghar, 8 years ago

3) tools on the main toolbox are correctly scaled-up, while icons of views (icon, diagram, text, documentation) are too small (First.png).

I think you are referring to a wrong image. I can't find any icons of view in First.png.

in reply to:  2 comment:3 by massimo ceraolo, 8 years ago

I think you are referring to a wrong image. I can't find any icons of view in First.png.

Right. I forgot to switch to modelling perspective.
To update it I need my work's PC: I'll do this tomorrow...
DONE (Third.png)

Last edited 8 years ago by massimo ceraolo (previous) (diff)

by massimo ceraolo, 8 years ago

Attachment: Third.png added

comment:4 by massimo ceraolo, 8 years ago

Today I made a further check, with the same OMEdit version (1.11.0-dev267), but without zooming fonts.
I had an additional small issue: the package branch markers were first nice ">" symbols (Fourth.png). but, as far as I opened a branch, they were converted into squares, containing the "+" sign, with a too large size (Fifth.png).

by massimo ceraolo, 8 years ago

Attachment: Fourth.png added

by massimo ceraolo, 8 years ago

Attachment: Fifth.png added

comment:5 by Henning Kiel, 8 years ago

comment:6 by Martin Sjölund, 8 years ago

Keywords: windows added

Most of these issues seem Windows-specific. The about box is rendered in a sort of weird way on Linux too though. (Note: Need Ubuntu 16.10+ for Hi-DPI in Qt applications)

Does the documentation browser show a small font by default on Windows as well? (I usually do ctrl+mousewheel up for Linux in that Window).

in reply to:  6 comment:7 by massimo ceraolo, 8 years ago

Most of these issues seem Windows-specific.

Indeed if the fonts' and windows' sizes are defined in pixels, these issues should be cross-platform.
I've some experience in making DPI-aware software with Qt, and I found it easy to make DPI-aware programs using simple rules:

  • defining fonts in points instead of pixels (or, in case a special effect is wanted as a fraction of window's actual size )
  • resizing windows on proportion to actual DPI's (and, for which maximum and minimum sizes are defined resizing them as well)
  • adjusting the maximum size of those toolButtons for which maximum and minimum sizes are defined in proportion to actual DPI's

(not to mention the need to always use layouts, that is standard Qt GUI programming).

If none of this is done, I expect on other OS's problems similar to those we see in Windows.

BTW, what I did does not make usage e of any recent feature of Qt. I retrieved DPI's using

QScreen *screen=QGuiApplication::primaryScreen();
int myDPI=screen->logicalDotsPerInch();

Does the documentation browser show a small font by default on Windows as well? (I usually do ctrl+mousewheel up for Linux in that Window).

Yes, it is small, It looks like its size is defined in OMEdit software in pixels (that does not scale when DPI's are changed) and not in points.

Final consideration. There's a lot of software around that is not DPI-aware yet. The very box in which I'm writing now contains fonts that appear very tiny on my 4k screen!

comment:8 by Adeel Asghar, 8 years ago

cdab4c8/OMEdit fixes point 3.

comment:9 by Adeel Asghar, 8 years ago

Point 2. The about window uses a png as background which is ofcourse fixed size and doesn't scale up. I think we should get rid of it and just show the information in a standard window.

comment:10 by massimo ceraolo, 8 years ago

Description: modified (diff)

comment:11 by massimo ceraolo, 8 years ago

Description: modified (diff)

comment:12 by Adeel Asghar, 8 years ago

c9f07ae/OMEdit adds a new about dialog which should fix point 2.

comment:13 by Henning Kiel, 8 years ago

The two buttons "Create New Modelica Class" and "Open Model/Library File(s)" are too small in height on my hi-res screen, see: https://trac.openmodelica.org/OpenModelica/attachment/ticket/3414/omedit_win81_largefonts.png
This is also the case with 1.11 beta1

in reply to:  13 comment:14 by massimo ceraolo, 8 years ago

Replying to hkiel:

The two buttons "Create New Modelica Class" and "Open Model/Library File(s)" are too small in height on my hi-res screen, see: https://trac.openmodelica.org/OpenModelica/attachment/ticket/3414/omedit_win81_largefonts.png
This is also the case with 1.11 beta1

Your buttons have the same size as mine in "Third.png".
They are largher than buttons to change views (icon, diagram, text, documentation), which I asked to enlarge.

To enlarge "Create New Modelica Class" and the other buttons in the main toolbar is a question of taste: e.g. I'm at ease with the current size. On the opposite, the buttons to change views were really very small.

BTW, Dymola as well is not very DPI-aware: its buttons appear all tiny, much smaller than our "Create New Modelica Class" and the other buttons of ours in the main toolbar.

Last edited 8 years ago by massimo ceraolo (previous) (diff)

comment:15 by Adeel Asghar, 8 years ago

@ceraolo you misunderstood. @hkiel meant the two buttons shown in the bottom of the welcome window.

comment:16 by massimo ceraolo, 8 years ago

ah, yes!
:-(

comment:17 by Adeel Asghar, 8 years ago

6e46b93/OMEdit fixes the issue @hkiel mentioned about "Create New Modelica Class" and "Open Model/Library File(s)" buttons.

30ec275/OMEdit fixes point 4.

Point 1 is a qt bug (https://bugreports.qt.io/browse/QTBUG-52689). It will be fixed once we move from Qt 5.6 to Qt 5.7. Unfortunately, the plan for 1.11 release is to use Qt 5.6.

I guess everything you mentioned is fixed. If there is nothing else you can close the ticket.

comment:18 by massimo ceraolo, 8 years ago

The link says that the Qt bug is fixed in 5.6.1. If this is confirmed for our issue, maybe it is possible to use that version for the OM 1.11 release? In principle, in case semaver is valid for Qt, this should not create any problem.

comment:19 by Adeel Asghar, 8 years ago

Unfortunately we can't do that. We use msys2 for development and in order to get new qt version we need to upgrade msys2 which means it will also upgrade from gcc 5.x to gcc 6.x. Updating gcc version just before the release is too risky.

However, we can do it for 1.12.

comment:20 by massimo ceraolo, 8 years ago

I see. Could not not envisage this.
I'm going to close this ticket.
We will wait for 1.12.

comment:21 by massimo ceraolo, 8 years ago

Resolution: fixed
Status: newclosed

comment:22 by massimo ceraolo, 8 years ago

Resolution: fixed
Status: closedreopened

comment:23 by massimo ceraolo, 8 years ago

The documentation browser text is very tiny on hi-res moniteors.
When "info" button is clicked, however it has normal size.

Version 0, edited 8 years ago by massimo ceraolo (next)

comment:24 by Adeel Asghar, 8 years ago

When info button is clicked you see an editor instead of documentation browser.
Can you provide a screenshot?

comment:25 by massimo ceraolo, 8 years ago

In enclose "docu.png" (tiny fonts) and "info.png" (correct fonts).

by massimo ceraolo, 8 years ago

Attachment: docu.png added

by massimo ceraolo, 8 years ago

Attachment: info.png added

comment:26 by Adeel Asghar, 8 years ago

They seems right to me.
Its two different views with two different fonts. docu.png is your system default font with default font size (i.e., on Windows "MS Shell Dlg 2" with size 12), info.png font is set via Tools->Options->Text Editor.

Note that QWebView (i.e, docu.png) doesn't scale the font based on your DPI instead it uses a fixed 96 DPI. So OMEdit uses the zoom factor to make the font readable which means depending on our screen different zoom level is used. In the source code it looks like this,

QWidget *pScreenWidget = QApplication::desktop()->screen();
setZoomFactor(pScreenWidget->logicalDpiX() / 96);

comment:27 by massimo ceraolo, 8 years ago

Do you use the same size for the libraries tree and for info browser?
If so, something should be wrong: see comparison of the two fonts under a 175% scaling factor (comparison.png).

Last edited 8 years ago by massimo ceraolo (previous) (diff)

by massimo ceraolo, 8 years ago

Attachment: comparison.png added

comment:28 by Adeel Asghar, 8 years ago

No, they are two different fonts.
I checked it a bit more and find out that Qt is using Segoe UI with size 9 for Libraries browser. However, for info browser I use the system default font i.e., MS Shell Dlg 2 with size 8.

comment:29 by massimo ceraolo, 8 years ago

I repeated my tests on 1.12.0-dev40-222: now that we have a size spinbox I can play with it.

I've seen strange things: with a 150% magnification on my screen an approximate equality between Libraries Browser and Documentation Browser fonts is when I set the documentation font size to "5"; with a 200% magnification factor this happens using your default font size "3".

So it seems to be a problem related to my system, as you guessed. I think I can close this ticket now.

BTW, which unit is the font size you chose in the Info Editor? "3" cannot mean three points: it is much larger than that. So, what does it mean?

comment:30 by massimo ceraolo, 8 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.