Author Topic: Split view initial font size incorrect  (Read 11064 times)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Split view initial font size incorrect
« Reply #15 on: January 10, 2011, 12:15:52 pm »
To see whether it's related to the zoom-factor or not, close all editor except for one.
Keep it unsplit.
Reset zoom via "Edit -> Special commands -> Zoom -> Reset".
Close C::B and reopen it.
Don't zoom any editor.
Check whether the problem is gone.

Offline UberNewb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Split view initial font size incorrect
« Reply #16 on: January 10, 2011, 12:37:20 pm »
Still using svn6906...

Quote from: jens
To see whether it's related to the zoom-factor or not, close all editor except for one.
Keep it unsplit.
Reset zoom via "Edit -> Special commands -> Zoom -> Reset".
I followed these three steps and when I clicked on Reset, the font size changed to 12 again.

Quote from: jens
Close C::B and reopen it.
Don't zoom any editor.
Check whether the problem is gone.
Then I followed these three steps and now both the original editor and the split editor open in font size 12, which is not what the menu is set to (it is set to 10).

No matter what I do, whether zooming the editor or not, when I split an editor it always opens in font size 12.

If I zoom in and enlarge the font of an unsplit editor and then open a new file, it opens in the same size as the previous editor, not at the font size set in the menu (10). Maybe this is the behaviour that you want, I don't know. If it is, what is the point of setting the font size in the menu then?





Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Split view initial font size incorrect
« Reply #17 on: January 10, 2011, 12:46:44 pm »
Why are you sure, that it is 12 point and not 10 point ?

I just tested it on XP with C::B and another editor, both use 12pt Courier New and both have the exaxt same pixelsize.

Offline UberNewb

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Split view initial font size incorrect
« Reply #18 on: January 10, 2011, 01:15:30 pm »
I tried playing around with the settings some more, and I noticed that no matter what font size I set in the menu, when I split an editor it opens two font sizes larger than the original editor.

Quote from: jens
Why are you sure, that it is 12 point and not 10 point ?
Not perfectly sure, no.

I tested against notepad and my preferred font size is Courier New, bold, 8pt. But the fact is still that the split window opens with a font that is always two sizes larger. (Ctrl+MouseWheel scroll twice).


Wait...
I set my font size to 8 in the menu and then adjusted each editor (main and split) to my preferred font size of 8pt (verified by checking against Notepad). And now when I split the editor it opens using my preferred font size. I must have zoomed at one point.

I'm sorry, I think I've led you all on a wild goose chase.  :(

So I tested it some more, and now I can verify that setting a font size in the menu and then splitting an editor opens the split editor at the correct font size. I guess my zoom is back to zero now.

Again, sorry about the mix up. (Going to go hide in the corner somewhere... :()

Edit :
I guess my problem was that I assumed the zoom level would be reset every time I picked a new font size in the menu. In the future, it might prevent this kind of problem from occurring if the zoom level is reset upon font changes in the menu.


« Last Edit: January 10, 2011, 01:22:57 pm by UberNewb »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Split view initial font size incorrect
« Reply #19 on: January 11, 2011, 05:37:48 pm »
The problem is the zoom-factor for the editor.
The last changed zoomfactor is stored globally and used for all new editor (except for split-view).
I made a change yesterday, that saves the zoom-factor on a per editor base in the projects layout-file.
It also saves the split-state (not the splitter position yet, but this should be easy) and the zoom-factor of both controls in split-view.

I will open another thread for this, to discuss it, because it does more than just simple changes to the behaviour.
I will add a link to the new thread  if it is created.

Patch to test can be found here: http://forums.codeblocks.org/index.php/topic,14027.0.html