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

Distraction Free Mode Width #727

Closed
ludenticus opened this Issue Sep 27, 2017 · 16 comments

Comments

Projects
None yet
2 participants
@ludenticus
Contributor

ludenticus commented Sep 27, 2017

Expected behaviour

Change Distraction Free Mode width regardless of the font size. This is important when using High DPI monitors

Actual behaviour

Distraction Free Mode width is respected only on small font sizes

Steps to reproduce

  1. Use the Distraction free mode [DFM]
  2. Select Narrow as Editor width
  3. Increase font size several times with Ctrl + +
    So far, the Editor respects the width selection, but...
  4. Exit the DFM
  5. Enter again the DFM
    Now the editor width has changed. Most likely with no margin at all.

@pbek pbek added the enhancement label Sep 27, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Sep 27, 2017

Thank you for your suggestion.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 28, 2017

Currently the DFM aims to set a margin that allows to be 60/80/100 0 characters visible in one line, (this is done in QOwnNotesMarkdownTextEdit::setPaperMargins). This is why there is no margin when you use a very large the font-size.
The margin is currently not updated when the text is zoomed.
If I change that behavior it would irritate other users...

@pbek

This comment has been minimized.

Owner

pbek commented Sep 28, 2017

The margin is currently not updated when the text is zoomed.

I will fix that in the next release.

@pbek

This comment has been minimized.

Owner

pbek commented Sep 28, 2017

17.09.9

  • the note text edit margins will now be updated when the font size increased
    or decreased in the distraction free mode
@pbek

This comment has been minimized.

Owner

pbek commented Sep 28, 2017

There now is a new release, could you please test it and report if it works for you?

@ludenticus

This comment has been minimized.

Contributor

ludenticus commented Sep 28, 2017

I'm sorry to report that it doesn't work as expected; at least not as I was expecting. Maybe I'm wrong, but I thought that the idea of the Editor Width on DFM was to provide some margin to the text under edition: larger margins if you want them (Narrow) or even none at all (Full) if that's your taste. These are the two issues on the 17.09.9 version:

  1. Now it doesn't matter the font size or Editor width I choose, if I exit DFM and then quit QON, after restart and enter DFM it will have full width. If the font size allows it, I can choose again a Narrow width
  2. To have any margin, font size has to be under 30pt. To see any real difference between editor widths, font size has to be around 17pt.

My Narrow width reports 100–110 characters per line, instead of 60.

How can I help you debug it?

@pbek

This comment has been minimized.

Owner

pbek commented Sep 28, 2017

The margin is calculated with 0 characters. So it should be space for about 60 0 characters in narrow. The rest is margin. The margin is not constant. The amount of characters of text is.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 2, 2017

I will close this issue until there is more information.

@pbek pbek closed this Oct 2, 2017

@ludenticus

This comment has been minimized.

Contributor

ludenticus commented Oct 2, 2017

I've been trying different font/size combinations. I made a screenshot to show my characters per line (CPL) count. Font size change has minimal effect on this count (1-4 characters at the most): as expected, it only modifies the «white» margin because the CPL remain constant. As I understand from your comment, the Narrow setting should report 60 CPL. Is this correct?

DFM: Narrow

@pbek

This comment has been minimized.

Owner

pbek commented Oct 3, 2017

Now I see where you are getting at. I even get an other character amounts for zeros than you.
Currently http://doc.qt.io/qt-5/qfontmetrics.html#width is used to get the width of 0. I tried several other methods but none brought the correct result. I also tried using the calculated width of 60 0 characters.

@pbek pbek reopened this Oct 3, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Oct 3, 2017

There are multiple problems, the margin-problem also varies with the width of the application window, the amount of characters that should be viewed and possibly also with the screen DPI and/or font zoom. I don't really know how Qt calculates widths and margins...

@pbek

This comment has been minimized.

Owner

pbek commented Oct 3, 2017

I now spent quite some time at the problem. All I can do at the moment is apply a constant factor to the amount to correct the 60-character assumptions a bit. Every other attempt made it even worse. I wonder it that factor is correct for all operating system font-zoom levels...

@pbek

This comment has been minimized.

Owner

pbek commented Oct 3, 2017

17.10.0

  • tried to remedy some inconsistency in the margins of the distraction free mode

@pbek pbek added this to the 17.10.0 milestone Oct 3, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Oct 3, 2017

There now is a new release, could you please test it and report if it works for you?

@ludenticus

This comment has been minimized.

Contributor

ludenticus commented Oct 3, 2017

With the 17.10.0 release, CPL count of the Narrow settings is better: depending on the font it gives me an average constant of 75–85 CPL, which is more pleasant to work with.

As usual, you are very kind. Lot of thanks

@pbek

This comment has been minimized.

Owner

pbek commented Oct 4, 2017

At least it seems not to vary a lot between systems and screen dpi. Thank you for testing.

@pbek pbek closed this Oct 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment