Author Topic: toolbar bottom edge is not shown corectly under C::B build with wx git master  (Read 4130 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4921
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
@cacb: In your Linux's screen shot:

So, the toolbar have both spaces in the top and bottom edges, you expect those edges should be smaller, right?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
@cacb: Sorry, I've asked the wrong question - it should have been - "What gtk theme are you using?"

This is what affects drawing of such controls.
Can you also try the auidemo sample or some other wxwidgets sample to verify that the problem happens there, too?
I'm sure it will happen.

Edit: What is the resolution of you display?
<debugger plugin maintainer>
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4921
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Can you also try the auidemo sample or some other wxwidgets sample to verify that the problem happens there, too?
The wx demo's should not have such issue(I have tested under Windows about one year before), because this issue is caused by our customized xrc loader, see discussion in this thread before(you can see the previous posts).

The wx guys are adding more vertical spaces as in wx 3.0+ compared with wx 2.8.12. This is because we more large screen resolutions nowadays(for me, I'm using a 1920x1080 for 14 inch screen), so people don't care about the added one or two pixels. But for a low resolution screen(as I have an old laptop which is 1280x800 for 14 inch screen), adding one or two space pixesl in the vertical edge may not look good, since the toolbar may looks too high in the vertical direction.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline cacb

  • Regular
  • ***
  • Posts: 346
So, the toolbar have both spaces in the top and bottom edges, you expect those edges should be smaller, right?
Yes, that is correct. This becomes problematic when there is also extra space used left & right of each toolbar item, making the toolbars extra wide. Because they are extra wide, you really need two rows of toolbars, but then you lose twice as much vertical space. So it really adds up.

Ideally, I would like something much more compact (like on Windows). The toolbars were always using more space on linux than windows but it became much more noticeable when I moved from Kubuntu 15.10 (+C::B compiled with wx 2.8.12) to Kubuntu 16.10 (+C::B compiled with wx 3.0)

Offline cacb

  • Regular
  • ***
  • Posts: 346
@cacb: Sorry, I've asked the wrong question - it should have been - "What gtk theme are you using?"
This is what affects drawing of such controls.

It is just the default KDE desktop under Kubuntu 16.10, I think that is "plasma". Is that an answer? I don't have that computer available right now, will try to check tonight.

Can you also try the auidemo sample or some other wxwidgets sample to verify that the problem happens there, too?
I'm sure it will happen.

I will check this and get back to you. Btw, I have a couple of wx GUI applications I have written myself that is using AUI toolbars, and I do not see such issues there, the toolbars are ok. But I will try the auidemo also.

As far as I could tell from browsing the C::B source for the code completion plugin, the C::B toolbars are based on wxToolbar, not wxAuiToolbar, not sure if it makes any difference.

Edit: What is the resolution of you display?

I believe it is 1920x1200, will check later.

Offline cacb

  • Regular
  • ***
  • Posts: 346
It is just the default KDE desktop under Kubuntu 16.10, I think that is "plasma". Is that an answer? I don't have that computer available right now, will try to check tonight.

The desktop theme is "Breeze"

I will check this and get back to you. Btw, I have a couple of wx GUI applications I have written myself that is using AUI toolbars, and I do not see such issues there, the toolbars are ok. But I will try the auidemo also.

See attached image (how do you embed images here??). At the top the C::B toolbar, below is the wxWidgets 3.0 auidemo with much more compact toolbar. At the bottom an application I have made with wxSmith and AUI.

Edit: What is the resolution of you display?

I believe it is 1920x1200, will check later.

Confirmed 1920x1200

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Here is how they look on my machine and theme: (both wx3 and 2.8 )



It is obvious that the toolbar with wxChoice control is bigger than the one without it.
Also it is obvious that our toolbars and the ones in the auidemo/your sample are different. Now we need someone to dig a big in the code and try to make them look the same.

p.s. it is better idea to use image sharing site instead of image attacments here.
<debugger plugin maintainer>
(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

  • Regular
  • ***
  • Posts: 346
I found out something interesting

When using wxAuiToolbar, if you add the code below, the toolbar items are much more packed. If you don't call it, the default is similar to calling it with a paddeing value = 3. My toolbars are created with wxSmith and I tried to find such an option in the properties, with no luck. So I added the code below outside the auto-generated code:

    AuiToolBar1->SetToolBorderPadding(0);
    AuiToolBar1->Realize();


As mentioned, I think Code::Blocks is not using wxAuiToolbar, but wxToolbar? I could not find the SetToolBorderPadding(int padding) for wxToolbar, but there is something similar
   
    wxToolBar::SetToolSeparation(int separation);

In the documentation it says "The default value is 5.". Maybe this is a clue, although it does nothing for the vertical size.

EDIT: there is also
   wxToolBar::SetToolPacking(int packing);

PS. ok I see what you are saying about images, will consider

« Last Edit: March 13, 2017, 09:12:33 pm by cacb »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Can you try to modify C::B and test it with your theme? Then tell us if it makes a difference?
<debugger plugin maintainer>
(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

  • Regular
  • ***
  • Posts: 346
Can you try to modify C::B and test it with your theme? Then tell us if it makes a difference?

I can try, but I don't have a setup to build C::B other than running the build command as mentioned. Do you know where the wxToolbar objects are created (which source file)?  Then I can try to manipulate those things.

Maybe I could set up a virtual machine for building C::B with the IDE, if there is a good link on how to do that, please share.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Search the wiki for tutorials about building. For experiments you can use autotools. Just set the --prefix to something in your home folder.
This method Manager::CreateEmptyToolbar is probably the place to start the investigation.
<debugger plugin maintainer>
(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

  • Regular
  • ***
  • Posts: 346
Search the wiki for tutorials about building. For experiments you can use autotools. Just set the --prefix to something in your home folder.
This method Manager::CreateEmptyToolbar is probably the place to start the investigation.

I added
    toolbar->SetToolPacking(0);
    toolbar->SetToolSeparation(0);

in Manager::CreateEmptyToolbar and rebuilt C::B, but I could not observe any visual difference.

Then I tried
    toolbar->SetMargins(0,0);
This also did not make any difference that I could observe.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10118
Then the next step is to replace wxToolbar with wxAuiToolbar in C::B or vice-versa in auidemo and see if this fixes/reproduces it.
<debugger plugin maintainer>
(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!]