Author Topic: The 20 February 2011 build (7017) is out.  (Read 50451 times)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #30 on: March 08, 2011, 10:24:39 am »
OK, I'll test tonight, but I prefer the style to be in separate file.
I had an idea to show it to the wx guys, so it can be included in wxGTK, by default.
But I'm lacking the motivation to talk to them:)
I put it into the notebookstyles.{cpp|h} files to keep it consistent with the other two styles we already have.
It would possibly make sense to put the styles in own files inside a subfolder, to make it easier to add new (community-generated ?) styles, without littering the src-folder .

Offline jccddd

  • Single posting newcomer
  • *
  • Posts: 4
Re: The 20 February 2011 build (7017) is out.
« Reply #31 on: March 08, 2011, 12:24:55 pm »
If change the notebook tab style to "default" ,the problem's gone.It shows up when the tab style is changed to visual studio 7.1.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13007
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #32 on: March 08, 2011, 09:40:34 pm »
Jens: Can you apply your changes over my patch, so I can see what you've changed (no naming changes please, for now at least)...
Also you've lost the Makefile.am changes...
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #33 on: March 08, 2011, 10:56:16 pm »
Jens: Can you apply your changes over my patch, so I can see what you've changed (no naming changes please, for now at least)...
Also you've lost the Makefile.am changes...
I attach two diffs, one for the header and one for the cpp file.
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.

The main changes:
  • I removed GetIcon() and m_close_icon completely, because wxGTK seems not to update the "gtk-close" icon if the theme is changed, only on program startup.
  • I fetch the actual close-icon from stock and rescale it if necessary to the wanted size (16x16)
  • The wanted close-icon-size is set as static variable, I also added a setter-function to change the size, but it is actually not used
  • I removed completely GetTabSize
  • I use m_normal_font as measuring-font in GetBestTabCtrlSize()
  • I always use normal font (for all tabs as gtk seems to do it), a better approach would surely be to get the actual notebook-font from gtk if possible
  • I changed ArrowStateAndShadow() to return values for disabled, hovered, pressed and normal buttons, according to the way it is done in by gtk
  • I use nullptr instead of NULL, wherever it is possible
  • I overwork DrawTab() at many places to create tabs with different height for normal and selected tabs, to fetch the actual close-button from gtk-stock, to draw a focus-rect and to place the bitmap and the label

To fix the issue with not correctly applied/used TabArtProvider, I use target->SetTabCtrlHeight(0); before applying the new ArtProvider and target->SetTabCtrlHeight(-1); after applying it. Doing so seems to fix the issue (at least here).

The automake-stuff will come with my next patch, it was not on top of my priority list.
I do not use your GTK2 test from configure.in, because we already test for it some lines later, I just remove the if-xlause around the test, as we need it for C::B's core now.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13007
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #34 on: March 08, 2011, 11:26:44 pm »
Okay, you've broken my theme -> http://smrt.is-a-geek.org/codeblocks/screens/cb_gtk_tool_breakage.png
On the second row is the working version with my patch, forth row is screenshot from pidgin.

I attach two diffs, one for the header and one for the cpp file.
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.
There are many irrelevant changes, so it is hard to follow :(

The main changes:
    1.I removed
GetIcon() and m_close_icon completely, because wxGTK seems not to update the "gtk-close" icon if the theme is changed, only on program startup.[/li][/list]
2.I fetch the actual close-icon from stock and rescale it if necessary to the wanted size (16x16)[/li][/list]
3.The wanted close-icon-size is set as static variable, I also added a setter-function to change the size, but it is actually not used[/li][/list]
4.I removed completely GetTabSize[/li][/list]
5.I use m_normal_font as measuring-font in GetBestTabCtrlSize()[/li][/list]
6.I always use normal font (for all tabs as gtk seems to do it), a better approach would surely be to get the actual notebook-font from gtk if possible[/li][/list]
7.I changed ArrowStateAndShadow() to return values for disabled, hovered, pressed and normal buttons, according to the way it is done in by gtk[/li][/list]
8.I use nullptr instead of NULL, wherever it is possible[/li][/list]
9.I overwork DrawTab() at many places to create tabs with different height for normal and selected tabs, to fetch the actual close-button from gtk-stock, to draw a focus-rect and to place the bitmap and the label[/li]
[/list]
1. Probably this should be fixed in the wxGTK, not workarounded?
4. Why?
5. Why, too?
8. Don't do it please, the main idea was to prepare this for inclusion in wxGTK, not distributed in C::B
9. Seems broken with my theme :( -> Darkilouche

To fix the issue with not correctly applied/used TabArtProvider, I use target->SetTabCtrlHeight(0); before applying the new ArtProvider and target->SetTabCtrlHeight(-1); after applying it. Doing so seems to fix the issue (at least here).
This seems to work, probably you can apply it separately...

The automake-stuff will come with my next patch, it was not on top of my priority list.
I do not use your GTK2 test from configure.in, because we already test for it some lines later, I just remove the if-xlause around the test, as we need it for C::B's core now.
OK, my auto-fu is very low...
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #35 on: March 09, 2011, 10:24:33 am »
The automake-stuff will come with my next patch, it was not on top of my priority list.

Here it comes.
Some small changes :
focus-rect nowalso includes bitmap and close-icon as done by gtk,
close-button removed from DraSimpleButtun, because it's not used there.

A real fix: texth was used to calculate texty before it was calculated  :oops:
Curiously this issue only leads to an incorrect text-placement in the first tab, if it is not the active tab.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13007
    • Travis build status
Re: The 20 February 2011 build (7017) is out.
« Reply #36 on: March 09, 2011, 10:29:27 am »
But my comment is still regarded as spam...
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 20 February 2011 build (7017) is out.
« Reply #37 on: March 09, 2011, 10:55:23 am »
    But my comment is still regarded as spam...
    Some of my posts are also regarde as spam, especially if they contain many quotes.
    Yours  is approved now.
    If that happens you can send me or another admin a PM.

    Okay, you've broken my theme -> http://smrt.is-a-geek.org/codeblocks/screens/cb_gtk_tool_breakage.png
    On the second row is the working version with my patch, forth row is screenshot from pidgin.

    I attach two diffs, one for the header and one for the cpp file.
    The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.
    There are many irrelevant changes, so it is hard to follow :(

    The main changes:
      1.I removed
    GetIcon() and m_close_icon completely, because wxGTK seems not to update the "gtk-close" icon if the theme is changed, only on program startup.[/li][/list]
    2.I fetch the actual close-icon from stock and rescale it if necessary to the wanted size (16x16)[/li][/list]
    3.The wanted close-icon-size is set as static variable, I also added a setter-function to change the size, but it is actually not used[/li][/list]
    4.I removed completely GetTabSize[/li][/list]
    5.I use m_normal_font as measuring-font in GetBestTabCtrlSize()[/li][/list]
    6.I always use normal font (for all tabs as gtk seems to do it), a better approach would surely be to get the actual notebook-font from gtk if possible[/li][/list]
    7.I changed ArrowStateAndShadow() to return values for disabled, hovered, pressed and normal buttons, according to the way it is done in by gtk[/li][/list]
    8.I use nullptr instead of NULL, wherever it is possible[/li][/list]
    9.I overwork DrawTab() at many places to create tabs with different height for normal and selected tabs, to fetch the actual close-button from gtk-stock, to draw a focus-rect and to place the bitmap and the label[/li]
    [/list]
    1. Probably this should be fixed in the wxGTK, not workarounded?
    4. Why?
    5. Why, too?
    8. Don't do it please, the main idea was to prepare this for inclusion in wxGTK, not distributed in C::B
    9. Seems broken with my theme :( -> Darkilouche

    To fix the issue with not correctly applied/used TabArtProvider, I use target->SetTabCtrlHeight(0); before applying the new ArtProvider and target->SetTabCtrlHeight(-1); after applying it. Doing so seems to fix the issue (at least here).
    This seems to work, probably you can apply it separately...

    The automake-stuff will come with my next patch, it was not on top of my priority list.
    I do not use your GTK2 test from configure.in, because we already test for it some lines later, I just remove the if-xlause around the test, as we need it for C::B's core now.
    OK, my auto-fu is very low...


    1. Surely, but it is not yet fixed and it might take a while until this happens (probably never). Sometimes it takes very long until fixes like this will be accepted or it never happens, but it is aminor issue, because changing the icon-theme while C::B is running will not happen so often.
    4. Because there is no need to derive it.
    5. because of 6. The measuring-font is by default m_selected_font and it is a bold-font, but as far as I have seen all gtk-themes use normal fonts for the tab-labels, if a bold-font is used for measuring, but a normal one is efectively used, the tab-size is too large for the active tab.
    8. Just replace all nullptr's with NULL and it is done. I think it's a great enhancement for C::B to use the "real" gtk-theme for the notebooks (if selected) and until it is in wxWidgets, I like to have it in C::B (and as implied in 1. it sometimes take very much time until new things make it into wxWidgets). And I prefer to use nullptr instead of NULL for uninitialized pointers.
    9. Should be fixed with the new patch.
    The broken theme should be fixed with the new patch (incorrect calculation of texty).

    Offline oBFusCATed

    • Developer
    • Lives here!
    • *****
    • Posts: 13007
      • Travis build status
    Re: The 20 February 2011 build (7017) is out.
    « Reply #38 on: March 09, 2011, 01:04:21 pm »
    BTW: the forum started to behave strangely... missing posts, when using the 'Show unread post since ...', so someone have changed some setting, which broke it...

    1. Why don't we leave it just like it is now and report a problem to wxGTK. It is not a very big problem after all.
    8. I would prefer both versions to be very similar, because if this is added to wxGTK it will be added at trunk,
       so wx2.8 won't have it and we would have to support it in C::B.
       If the versions are very different it would be harder to keep them in sync.

    I'll test your new patch tonight and report if there are problems.

    p.s. probably you should add some copyright names in the license header, so if the code would be included in wxGTK, a license change would be required and as this is a team effort now, all contributors should approve it (I'm not a lawyer, so I could be wrong).
    (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 oBFusCATed

    • Developer
    • Lives here!
    • *****
    • Posts: 13007
      • Travis build status
    Re: The 20 February 2011 build (7017) is out.
    « Reply #39 on: March 09, 2011, 09:43:46 pm »
    Jens:
    The new patch doesn't fix my theme...
    Probably, you've calculated too large height of the tab.
    The nice edge at the bottom is missing, see the screen shot I've made...
    This border is missing from many themes I have on my machine
    (my themes are old, because I've not updated theme for the last 6-12 months, but I doubt it makes a difference)

    Some themes are even more broken. This is because they want to make the notebook higher that possible (probably) in wxAuiNotebook.
    Probably that is why I've not done the selected tab is higher thing. Firefox does the same -> all tabs have the same height...

    One very broken theme is "Milke 2.3"...
    The focus rectangle is very broken in the "MurrinaAqualsh" theme....

    On all themes the text is moving in the wrong direction (up instead of down), when the tab is unselected.

    On the other hand, your patch does many things well...
    The fonts are always working, which my patch does not  do successfully.
    The close button is placed, correctly, for all themes, my patch failed on some of them...
    (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 jens

    • Administrator
    • Lives here!
    • *****
    • Posts: 7255
    Re: The 20 February 2011 build (7017) is out.
    « Reply #40 on: March 12, 2011, 11:24:18 am »
    Jens:
    The new patch doesn't fix my theme...
    Probably, you've calculated too large height of the tab.
    The nice edge at the bottom is missing, see the screen shot I've made...
    This border is missing from many themes I have on my machine
    (my themes are old, because I've not updated theme for the last 6-12 months, but I doubt it makes a difference)

    Some themes are even more broken. This is because they want to make the notebook higher that possible (probably) in wxAuiNotebook.
    Probably that is why I've not done the selected tab is higher thing. Firefox does the same -> all tabs have the same height...

    One very broken theme is "Milke 2.3"...
    The focus rectangle is very broken in the "MurrinaAqualsh" theme....

    On all themes the text is moving in the wrong direction (up instead of down), when the tab is unselected.

    On the other hand, your patch does many things well...
    The fonts are always working, which my patch does not  do successfully.
    The close button is placed, correctly, for all themes, my patch failed on some of them...

    Sorry for the delay, time is a little bit limited sometimes.

    FireFox does not really use gtk, because it applies it's own themes.


    Can you test the attached patch ?
    I do not have issues with it until now, but four (or more) eyes see mre than two of course.

    Offline oBFusCATed

    • Developer
    • Lives here!
    • *****
    • Posts: 13007
      • Travis build status
    Re: The 20 February 2011 build (7017) is out.
    « Reply #41 on: March 12, 2011, 05:24:32 pm »
    FF <= 3.6 uses gtk, I've looked at their code to see how they've done their notebook
    In FF > 3.6 they seems to draw the buttons themselves.

    I'll test when I'm on linux again...
    (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 jens

    • Administrator
    • Lives here!
    • *****
    • Posts: 7255
    Re: The 20 February 2011 build (7017) is out.
    « Reply #42 on: March 12, 2011, 06:30:47 pm »
    FF <= 3.6 uses gtk, I've looked at their code to see how they've done their notebook
    In FF > 3.6 they seems to draw the buttons themselves.

    I'll test when I'm on linux again...
    I use 4.0b12 at the moment, but as far as I know the tabs appearance depends on the theme you use.
    And all other (native) gtk-2.0 programs use tabs with different heights as far as I know.
    The default wxNotebook also uses real gtk-tabs with wxGTK.

    Offline oBFusCATed

    • Developer
    • Lives here!
    • *****
    • Posts: 13007
      • Travis build status
    Re: The 20 February 2011 build (7017) is out.
    « Reply #43 on: March 12, 2011, 07:06:31 pm »
    I'm on 4.0b13pre or something like that and that's why I've noticed the change.
    When I've done the patch FF was 3.6 and the notebook was different... more similar to the gtk-notebook.

    wxNotebook uses gtk-notebook directly...
    (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 jens

    • Administrator
    • Lives here!
    • *****
    • Posts: 7255
    Re: The 20 February 2011 build (7017) is out.
    « Reply #44 on: March 12, 2011, 07:21:38 pm »
    wxNotebook uses gtk-notebook directly...
    That's what I meant.