Author Topic: Font size in "Manager" window, Projects/Resources tabs  (Read 13713 times)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Font size in "Manager" window, Projects/Resources tabs
« on: May 24, 2021, 03:26:02 pm »
I am a long time Code::Blocks user, but have discovered an issue after upgrading to Kubuntu 20.04 and installing a new high resolution graphics card (screen resolution 2560x1440): Most things work but the fonts in the "Manager" window, containing the Projects and Resources tabs are so small they hurt my eyes...

Currently I am running Code::Blocks 20.03, installed from the Ubuntu repository.

I am aware of how to adjust the font size in the editor window, i.e. using
Settings -> Editor -> General Settings .. and then choose a font
or using Ctrl + Mouse wheel

...but these options do not affect the font size elsewhere. I see the font issue in the "Manager" window and also in the Logs & Others below.

Question: Is there a way to adjust the relevant font sizes in Code::Blocks 20.03 ?

If building from source fixes the issue, I can also do that. Please advice.


Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #1 on: May 24, 2021, 05:00:04 pm »
Well, I found a work-around. It is not perfect, but more acceptable to my eyes.

As noted, with the new graphics card I had a screen resolution of 2560x1440. I had also set the KDE font size in Settings -> System Settings -> Fonts  -> Force font DPI 120.  This generally gave good font sizes in all applications, but not in C::B. It also had a side effect in C::B 20.03 in that the compiler tab didn't show the current build target name unless the Compiler tab was deactivated and then reactivated (had to be done each time C::B was started).

So the work-around was to reduce screen resolution to 1920x1080 and disable the "Force font DPI" option in KDE. Then C::B 20.03 works as expected without any side effects (so far).

I would still very much like to know if there is a way to control the font sizes used in the "Management" and "Logs & others" panels, in order to use C::B with a higher screen resolution.



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #2 on: May 24, 2021, 05:52:54 pm »
Does changing "Settings -> Environment -> View -> Message log's font size" help?
Can you post the information in Help ->About -> Information?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #3 on: May 24, 2021, 06:17:01 pm »
Does changing "Settings -> Environment -> View -> Message log's font size" help?
Can you post the information in Help ->About -> Information?

Thanks, that does change the font size in the message log, so it is indeed helpful!  But it doesn't seem to do anything to the font size in the "Projects" tree, and that was the main issue I had. I guess the problem would be resolved if that setting also modified the "Projects" tree, or if there was a separate font size setting (e.g. "Management panel font size") next to it.

I have attached the About -> Information info.

It would be great if I could use the full screen resolution with Code::Blocks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #4 on: May 25, 2021, 08:55:12 pm »
Can you:
1. Reset everything to defaults in KDE
2. Switch to the native resolution
3. Start CB
4. Start gtk3-widget-factory and switch to page 3 (you might need to install/compile this thing separately)
5. Post a screenshot of the two apps next to each other.

This might be another GTK3 issue, which needs to be resolved.
I don't see anywhere in our code (src/projectmanagerui.cpp/h) where we set the font for the tree.

p.s. There should a global way to change the fonts in gtk, but I don't know it. As always using GTK+non-gnome wm is a pain.
p.p.s. GTK3 is not really designed around fractional scaling factors. Setting 120 DPI is most probably leading to such scaling factors. What is the monitor you're using? What is its DPI?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #5 on: May 25, 2021, 09:55:03 pm »
Thanks for the follow-up....

I did 1-5, back to resolution 2560x1440, default Font DPI
to run  gtk3-widget-factory I did "sudo apt install gtk-3-examples"
Screenshot is attached, this is just a part of the screen.
The tree view fonts are painfully small.

Edit: the monitor is Philips PHL 275B1 (DP-0)
Resolution 107x107 dots per inch (according to NVIDIA X Server Settings)
GPU: GeForce GTX 1660 SUPER
« Last Edit: May 25, 2021, 10:00:25 pm by cacb »

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #6 on: May 25, 2021, 11:04:37 pm »
Well, I found a different work around that seems to work in KDE

1. I kept the resolution at 2560x1440

2. In System Settings -> Fonts
Changed the "General" font from "Noto Sans 10pt" to "Noto Sans 14pt"   

I rebooted just to be sure (probably not required). Now the fonts in C::B "Manager" panel are larger and more agreeable.  It looks like 13pt is possible so fine adjustments may be possible.

The fonts in the Log windows are still small, but this is controlled within Code::Blocks Settings -> View -> "Message logs' font size".

This solution is a bit intrusive on other applications, but it seems initially as a usable work around.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #7 on: May 26, 2021, 09:42:26 am »
To me all fonts look fine (I'm on normal DPI monitor), and more importantly they are the same.
If KDE/Qt handles 107 DPI correctly you should find a way to change the fonts only for GTK-3.
It is probably done in the gtk config somewhere/somehow. https://developer.gnome.org/gtk3/stable/GtkSettings.html (there is the gtk-font-name).
I don't know how this works really.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #8 on: May 26, 2021, 01:07:38 pm »
They are the same, yes. But with default font size and high resolution they were much too small for my eyes.

I did search around and found that the gtk-3.0 font size is stored in ~/.config/gtk-3.0/settings.ini

At first I tried to edit the font size there, but it was overridden by KDE on login/reboot. Next attempt to set the font size was via KDE System settings -> Font, I changed the "General font size from 10 to 12. This had the effect of changing the gtk-3.0 font size in the settings.ini file:

[Settings]
gtk-application-prefer-dark-theme=0
gtk-button-images=1
gtk-cursor-theme-name=breeze_cursors
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=1
gtk-font-name=Noto Sans,  12
gtk-icon-theme-name=breeze
gtk-menu-images=1
gtk-primary-button-warps-slider=0
gtk-theme-name=Breeze
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ


So it seems to me this is probably how to do it from KDE. The link you provided mentions gtk-font-name and its default  size = 10, which is too small for a high-resolution screen and my eyes.

So it looks like KDE System settings -> Font is the proper way.

I still see sometimes (not always) that the "Build Target" choice in the Compiler Toolbar is not showing properly (i.e. showing nothing) with increased font size, but it is not 100% repeatable so it is not something to worry about unless it persists. 

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #9 on: May 26, 2021, 01:49:51 pm »
You can add a ticket on SF for a feature request so it wont get lost...
I think it should be doable to implement it...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #10 on: May 26, 2021, 01:53:08 pm »
I still see sometimes (not always) that the "Build Target" choice in the Compiler Toolbar is not showing properly (i.e. showing nothing) with increased font size, but it is not 100% repeatable so it is not something to worry about unless it persists. 
I think this is known problem.
I think you see this problem: https://sourceforge.net/p/codeblocks/tickets/956/

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Probably, but then other parts of the UI would be hard to read, also other gtk3 applications would suffer from the same problem, so I think it is better to solve this globally.


You can add a ticket on SF for a feature request so it wont get lost...
I think it should be doable to implement it...
@cacb Please don't do what BlueHazzard suggests, see above for explanation why I think this way. We don't need another option to confuse people.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #11 on: May 26, 2021, 03:28:58 pm »
I think this is known problem.
I think you see this problem: https://sourceforge.net/p/codeblocks/tickets/956/
This is most likely true, yes. I have build target names like 'GCC_Release' and 'GCC_Debug'. They are not very long IMHO, but they trigger the issue when increasing font size in some way. It is worth noting that disabling/enabling the compiler toolbar in a C::B session seems to fix the issue for that session, so it could also be an initialization problem.

All of this would probably be easier if one could set the font size of the "Manager" panel within C::B, as is possible for the logs. But It seems to be workable the way it is now. I appreciate the assistance received!

Probably, but then other parts of the UI would be hard to read, also other gtk3 applications would suffer from the same problem, so I think it is better to solve this globally.
Maybe consider a global font setting in C::B then, because the 'global dance' in the Window Manager (KDE or Gnome) in combination with applications is not so easy in practice. The global changes required for C::B affect other applications in sometimes unwanted ways, and the other way around. An example: I use the Brave browser and the URL bar had very small fonts indeed, and no way to adjust so I had to go back to setting KDE DPI to 120% again, which affects C::B and others. It would have been better to adjust that in Brave. Adjusting global settings is really a tight 'dance', sometimes with no good outcome. I appreciate the idea of adjusting globally, but sometime local overrides are necessary.

@cacb Please don't do what BlueHazzard suggests, see above for explanation why I think this way. We don't need another option to confuse people.
Ok, I have shared my thoughts above and leave it to you guys to decide. Thanks for the assistance in any case!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #12 on: May 26, 2021, 05:30:45 pm »
I'm not sure what is correct actually.
Your monitor has dpi of 107, this means that 107/92=1.1630434782608696, so you have to run at 116.3% scaling factor to get the same fonts as the same 92 dpi monitor (full hd, 1920x1200, etc). But GTK3 doesn't support fractional scaling factors (at least the last time I've checked it didn't).
So to me it seems plausible that setting 120% is the correct thing to do. And it should be the only thing you need to do in order to get good looking apps.

Obviously this is not the case. Also it is quite hard to test thing, because it needs various different monitors. :(
I have to test what happens if I use VirtualBox's scaling factors.

Is there any documentation about this in KDE? Can you contact KDE people, so they can give a recommendation what is the correct value.
What do you need to do to get good looking KDE apps and fonts? Can you set it up and then show a screen shot next to gtk-widget-factory/CB?

:rant: As always the opensource people did the worst job compared to the commercial vendors (macOS/windows)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #13 on: May 27, 2021, 08:42:40 am »
Is there any documentation about this in KDE? Can you contact KDE people, so they can give a recommendation what is the correct value.
What do you need to do to get good looking KDE apps and fonts? Can you set it up and then show a screen shot next to gtk-widget-factory/CB?

:rant: As always the opensource people did the worst job compared to the commercial vendors (macOS/windows)

I am just a user of KDE. There is probably some documentation somewhere, but I have no idea where. For now, the experimentation and iterations described here have provided a reasonable compromise for myself, even if I may change it again. It is just that I think it was a bit more effort than it should be and my suggestions was aimed at making it easier for other users with similar issues.

Right now I am running with 12pt fonts and 120 DPI as a compromise between conflicting requirements from different applications. Now the tree view in gtk-widget-factory is different with bigger fonts and more spaces than in the C::B Projects tree.  I can live with this, it just illustrates that relying on only global settings does not always work 100% because not all applications adopt the settings the same way.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #14 on: May 27, 2021, 09:24:35 am »
I am just a user of KDE. There is probably some documentation somewhere, but I have no idea where. For now, the experimentation and iterations described here have provided a reasonable compromise for myself, even if I may change it again. It is just that I think it was a bit more effort than it should be and my suggestions was aimed at making it easier for other users with similar issues.
Does this mean that you're just mashing settings and hoping to get it right?
KDE has support forums and wikis. You as a user could describe the problem with more details, so they can guide you better.
If I am to start a discussion would be something like a third person description of the situation and I'm sure I'll get the details wrong.

Right now I am running with 12pt fonts and 120 DPI as a compromise between conflicting requirements from different applications. Now the tree view in gtk-widget-factory is different with bigger fonts and more spaces than in the C::B Projects tree. 
This difference is odd and as far as I know it shouldn't happen.
Can you show a screenshot with these two and some native KDE app. They probably look correct.

I can live with this, it just illustrates that relying on only global settings does not always work 100% because not all applications adopt the settings the same way.
Nope, this just illustrates what happens when the root causes for problem are not solved correctly.
I repeat even if we add a setting for the tree all other fonts would be too small and we'll have to add even more settings.
« Last Edit: May 27, 2021, 09:26:34 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #15 on: May 27, 2021, 09:59:24 am »
Can you show a screenshot with these two and some native KDE app. They probably look correct.

4 applications from left

1. Thunderbird newsgroup tree view
2. Code::Blocks Projects tree view
3. Dolphin File Folder tree view
4. gtk3-widget-factory tree view

The tree view in Code::Blocks is the odd one with smaller fonts compared to the others

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #16 on: May 27, 2021, 10:58:04 am »
Odd, just C::B looks different if I'm not too blind.
Can you run the wxWidgets' tree sample and compare it to C::B? Or some other simple wxWidgets app with a tree in it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #17 on: May 27, 2021, 01:24:42 pm »
Odd, just C::B looks different if I'm not too blind.
Can you run the wxWidgets' tree sample and compare it to C::B? Or some other simple wxWidgets app with a tree in it.
Yes, I agree. it is just C::B that looks different.

In the attached screenshot you have from left
1. Code::Blocks
2. wxWidgets wxTreeCtrl sample
3. dep3, my wxWidgets app built with wxWidgets 3.0.4 and gtk2.0

It is quite clear that C::B is different

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #18 on: May 27, 2021, 02:29:54 pm »
Hm, odd still.
I would expect that CB and wxTreeCtrl would look the same if they use the same wxWidgets libs.
Is this the case from the image above?

gtk2 vs gtk3 differences are expected.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #19 on: May 27, 2021, 03:36:12 pm »
Hm, odd still.
I would expect that CB and wxTreeCtrl would look the same if they use the same wxWidgets libs.
Is this the case from the image above?

gtk2 vs gtk3 differences are expected.
C::B is installed from ubuntu repository, and I guess that is dependent on repository wx *.so libs.

The wxTreeCtrl  sample was built from the samples directory of my static libs wxWidgets with gtk2.
/usr/local/bin/wx-config --list
    Default config is gtk2-unicode-static-3.0



So I did a little bit of research on how to build the wxTreeCtrl sample against the same wxWidgets libs as C::B.
I did :
sudo apt install libwxgtk3.0-gtk3-dev
/usr/bin/wx-config --list
    Default config is gtk3-unicode-3.0



Then copied sample wxtreectrl to wxtreectrl2 and I changed a line in makefile.unx to

# Location and arguments of wx-config script
WX_CONFIG ?= /usr/bin/wx-config


Then did
make -f makefile.unx


The attached screenshot shows (from left)
1 wxTreeCtrl sample built with gtk2-unicode-static-3.0
2 wxTreeCtrl sample built with gtk3-unicode-3.0
3 My dep3 app showing that #2 depends on the repository wx libs (*.so) presumably the same as C::B

It is obvious that the tree view sample font is different from gtk2 to gtk3, the font size is smaller in the gtk3 version, which to me is a problem.

So it seems to me to be a gtk3 problem...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #20 on: May 27, 2021, 06:06:55 pm »
It is obvious that the tree view sample font is different from gtk2 to gtk3, the font size is smaller in the gtk3 version, which to me is a problem.
Good, now you can use trac.wxwidgets.org to report the problem there. But first probably try 3.1.5+gtk3. It might have been fixed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #21 on: May 27, 2021, 07:48:28 pm »
Good, now you can use trac.wxwidgets.org to report the problem there. But first probably try 3.1.5+gtk3. It might have been fixed.
I managed with some difficulty to build wx 3.1.5+gtk3

See screenshot (from left), wxTreeCtrl sample
1. wx3.0.4+gtk2 (static libraries)
2. wx3.0.4+gtk3 (/lib/x86_64-linux-gnu/*.so)
3. wx3.1.5+gtk3 (/usr/local/lib/*.so)

So clearly, the issue is fixed in wx3.1.5

So, to fix the original problem, Code::Blocks must be built against wx3.1.5 and gtk3? Has that been tested?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #22 on: May 28, 2021, 12:50:20 am »
So, to fix the original problem, Code::Blocks must be built against wx3.1.5 and gtk3?
Not exactly. If you can find the fix in wx-master, it could be backported, probably (if it is not something hairy).

Has that been tested?
I'm tracking wx-master + gtk2 for my debugging needs. Using the GTK3 port is known to be buggy in general.
I'll have to spend some time improving the gtk3 support soon... :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #23 on: May 28, 2021, 09:08:11 am »
I'm tracking wx-master + gtk2 for my debugging needs. Using the GTK3 port is known to be buggy in general.

Well that's a shame given that if you install Code::Blocks from the Ubuntu repository, you get a GTK3 port :(

My goal here is not really to debug wx, but simply to get a Code::Blocks IDE under Kubuntu 20.04 with as few bugs as possible. So it seems to me that maybe I should instead build Code::Blocks from source based on a stable version of wx + gtk2

On a related (?) note, I have noticed another problem in the 20.03 official Code::Blocks IDE on Ubuntu. That is in Build Options -> Linker Settings. If you try to reorder libraries using the up/down arrow buttons, things get completely messed up. Is that a likely GTK3 related issue or something else?
« Last Edit: May 28, 2021, 09:10:03 am by cacb »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #24 on: May 28, 2021, 09:21:00 am »
On a related (?) note, I have noticed another problem in the 20.03 official Code::Blocks IDE on Ubuntu. That is in Build Options -> Linker Settings. If you try to reorder libraries using the up/down arrow buttons, things get completely messed up. Is that a likely GTK3 related issue or something else?
Can you post the exact steps to reproduce, probably in new topic. We've had problems with this in the past, but I think, I've fixed those. It might be another gtk3 issue, but it is unlikely.

Here you can try night builds for ubuntu https://launchpad.net/~fuscated/+archive/ubuntu/codeblocks-nightly they should be compatible with kubuntu, too
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #25 on: May 28, 2021, 10:07:49 am »
Thank you for that link. I will follow up in a new topic regarding the Build -> Settings issue.

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size in "Manager" window, Projects/Resources tabs
« Reply #26 on: May 31, 2021, 09:50:29 am »
For the record: Using https://launchpad.net/~fuscated/+archive/ubuntu/codeblocks-nightly did not solve the small font size issue, nor the issue discussed in https://forums.codeblocks.org/index.php/topic,24518.0.html

I can live with my font size tweaks for now, but will probably attempt to build wx+c::b with gtk2 if gtk3+wx+c::b cause other real problems.
« Last Edit: May 31, 2021, 09:52:20 am by cacb »