Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed scaling issues #2250

Closed

Conversation

lucas-wilkins
Copy link
Contributor

Fixed scaling issues by setting a default font size.

@lucas-wilkins lucas-wilkins linked an issue Oct 12, 2022 that may be closed by this pull request
@wpotrzebowski
Copy link
Contributor

@lucas-wilkins is it supposed to be changing all text except plots? This is at least what I see on Mac when testing with Fitting perspective.

@lucas-wilkins
Copy link
Contributor Author

@wpotrzebowski it sets the default font size, so that for any component that doesn't explicitly set the font size will have a font size of 11pt.

It looks right on my machine, I guess the question that needs to be answered by you or another mac person, is whether it looks wrong on MacOS?

@wpotrzebowski
Copy link
Contributor

wpotrzebowski commented Oct 13, 2022

The size of general font is fine but it looks quite strange compare to plot legends depending on what screen do you work. See images bellow

@wpotrzebowski
Copy link
Contributor

On laptop
Screenshot 2022-10-13 at 12 53 09

@wpotrzebowski
Copy link
Contributor

On external screen:
Screenshot 2022-10-13 at 10 33 37

@wpotrzebowski
Copy link
Contributor

We've been having issues with this on Mac for long while... There is also extreme case when one works with external screen and lid open. Then legend on plots can become huge. Unfortunatelly I am not able to test it now.

@lucas-wilkins
Copy link
Contributor Author

@wpotrzebowski Ah, I see. That's a different issue to the one this PR is supposed to fix (see the image #2249), which is purely Qt problem that needs a workaround.

Your problem is probably relevant to discussion #2244

If it doesn't break anything for you, I think its good to go.

@butlerpd
Copy link
Member

I have not had a chance to look at this but I have been thinking for a while that our default font size seems to be a bit large which may be a good thing from the point of accessibility but does make it hard to work with on a laptop screen. 11 point (depending on the font) sounds reasonable. If we figure out it is too small or too big we can change the one line that is added here to tune it?

I note it is also a single line change to the style sheet so don't see there is much risk?

@lucas-wilkins
Copy link
Contributor Author

@butlerpd Also, I took the 11pt value from some of the buttons where it is explicitly set.

Annoyingly, if you want a different font size, you'll have to go through all the widgets that have their font size set, e.g. the load and send buttons.

@rozyczko
Copy link
Member

maybe then font size should be a user-settable property? In the config?

@lucas-wilkins
Copy link
Contributor Author

maybe then font size should be a user-settable property? In the config?

Not a bad idea.

Probably changing the stylesheet entry for * should work in real time, but I've not tested it.

@butlerpd
Copy link
Member

I like the idea of user settable size a lot, though that sounds like a big project. To @lucas-wilkins point, as I recall things like the "LOAD" button were deliberately set in a larger font (though as I recall there was some discussion about how big it should be). Perhaps what is needed is for all fonts to be defined in % increments from a base, user settable, font? At this point though this probably should be moved to a discussion?

@lucas-wilkins
Copy link
Contributor Author

At this point though this probably should be moved to a discussion?

Sure. Will someone accept this PR though, please.

@butlerpd
Copy link
Member

Ok. I downloaded the installer and tested on windows and see some really bizare behavior in fitting that will need addressing, but I don't think is linked to this PR. so I will not worry about it here.

I am however now really confused.

First off, I don't understand how you can get the image you posted in #2249 @lucas-wilkins?!! both directions of the fit panel (and the data explorer panel) on my windows machine have a minimum size that absolutely does not allow scrunching down to anything that small. Secondly the fonts are opposite of what you see: Load data, Send data to and Fitting are actually BIGGER than all other text not smaller as in the image you post. This is true of 5.0.4 and all computers I've seen it on.

What I see that your PR does compared to 5.0.5 and before is make the text from the three buttons above smaller (not bigger as would be presumably needed from the image you post) and now the same size as all other fonts? ..... EXCEPT this weird thing in the Fitting perspective where the Value column in the Model tab. That font is quite a bit smaller than the rest now (including the text in the adjacent Paramater' and Error(orMin`) columns. When clicking on the Value to change it, the font increases to match the rest of the fonts but then goes back to it small size when hitting enter.

The only other thing I see, which may be the same in 5.0.5 is that the Corefunc perspective, under "Lamellar Parameters" the top line are truncated on the left!! (both columns) as is the 2nd line (1rst column). So, for example line 1 column1 reads:

Avg. Thicknesses: rd Block: (text box).

actually part of an "a" is showing in front of "rd" Again.... I suspect this is not to do with this PR but with a previous on that maybe @smk78 did not notice? (the whole layout is different from 5.0.5).

All this to say, I'm not comfortable merging this from my testing alone without understanding what is supposed to be happening? Can anybody else test this?

@rozyczko
Copy link
Member

This is what I get. 1920x1080, 100% font size settings. Visibly different font on charts and in fitting parameter values.
Also, some widget labels overflow.
Things get worse when switched to 125% or 150% font size.

fonts

@lucas-wilkins
Copy link
Contributor Author

Arguably the font size should be 9, not 11.

@lucas-wilkins
Copy link
Contributor Author

I don't understand how you can get the image you posted in #2249 @lucas-wilkins?!!

I just run sasview, that's how it has always looked on my machine.

I say always, maybe 50% of the time it looks like that. Sometimes its normal, sometimes the buttons are so small you can bearly read them. By always, I mean it is a problem that has existed since I started working on SasView - I did put an issue for it at the time, though it appears to have disappeared. It's just got to the point where I hate it so much I want to do something about it.

Secondly the fonts are opposite of what you see: Load data, Send data to and Fitting are actually BIGGER than all other text not smaller as in the image you post.

I see, that's why 11pt is the wrong size. They're the only ones with a font size set and I got it from there, thinking that's the size it is supposed to be. Should probably be 9.

on my windows machine have a minimum size that absolutely does not allow scrunching down to anything that small.

Nothing is small, everything is giant, except the load/send buttons, which stay the same size.

@lucas-wilkins
Copy link
Contributor Author

@butlerpd How about now?

@lucas-wilkins
Copy link
Contributor Author

@rozyczko I have no idea why it would be affecting the charts. Is it possible that they have always been different, and its just that nobody has drawn attention to it until now?

@rozyczko
Copy link
Member

This looks much better now. At 100% and 125% I can see almost no issues, at 150% some label clipping occurs but this might have already happened with the current code.
I would propose to merge it in its current state but add another task to expose font size in the config file and make sure the sizing is consistent everywhere (labels, tables etc.)

@wpotrzebowski
Copy link
Contributor

wpotrzebowski commented Oct 14, 2022

9pt for me is too small (particularly compare to other text (e.g. system text)) :

However I am fine with merging it and making font size configurable (as discussed).

@lucas-wilkins
Copy link
Contributor Author

@wpotrzebowski @butlerpd Perhaps you guys could measure the font size that you think it should be (i.e. in main on your machines) and we can take a data driven approach.

@wpotrzebowski
Copy link
Contributor

I would prefer 11 for my setup on Mac but this seems to contradicts windows requierments

@lucas-wilkins
Copy link
Contributor Author

I would prefer 11 for my setup on Mac but this seems to contradicts windows requierments

I also prefer 11, but it is a bit bigger than some of the widgets were layed out for...

sigh Thought this would be an easy fix!

@rozyczko
Copy link
Member

if macos then fontsize=11 else fontsize=9 :)

(no, please don't)

@krzywon
Copy link
Contributor

krzywon commented Oct 21, 2022

With the range of fonts wanted and the cascading of sizes to other elements, this sounds like a good use of our new configuration system (#2168) and (upcoming) preferences panel (#2167). This could become a project where we fully move to a user-modifiable stylesheet but this will likely require removing inline styles and ensuring all panels have the sheet applied.

@wpotrzebowski
Copy link
Contributor

Should we put it on hold until we have a proper solution?

@krzywon
Copy link
Contributor

krzywon commented Oct 24, 2022

Should we put it on hold until we have a proper solution?

I'm working on a proper solution in #2258

@SasView SasView locked as too heated and limited conversation to collaborators Oct 25, 2022
@lucas-wilkins
Copy link
Contributor Author

Closing this because its got out of hand.

@lucas-wilkins lucas-wilkins deleted the 2249-weird-scaling-on-some-windows-installations branch November 8, 2022 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird Scaling on Some Windows Installations
5 participants