setShowHorzScrollbar(false) should hide scrollbar

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Montred
Not too shy to talk
Not too shy to talk
Posts: 42
Joined: Sat Nov 10, 2012 06:45

setShowHorzScrollbar(false) should hide scrollbar

Postby Montred » Thu Dec 18, 2014 09:21

For the hiding or showing of scrollbars, most GUI's have three options:

Always show
Always hide
Auto (Show when needed).

CEGUI only has "Always show" and "Show when needed". Most times in modern guis when you are showing a list of elements what you want is to hide the horizontal scrollbars, clip content, then the user can hover over an element to show a tooltip that shows all the text that is missing. ¿Is there a way to accomplish this currently? Is not, ¿would a patch be welcome?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Kulik » Thu Dec 18, 2014 11:23

Yes, patch would be welcome.

This sounds like a feature that should be relatively easy to implement.

Montred
Not too shy to talk
Not too shy to talk
Posts: 42
Joined: Sat Nov 10, 2012 06:45

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Montred » Thu Dec 18, 2014 12:15

Cool. Problem is, I'm using 0.8 but 0.8 as far as I can tell is a maintenance only branch, and something like this wouldn't be accepted because it's API-breaking, right? So what am I supposed to do in this case if I want the feature in CEGUI but I'm only interested in the stable version.

There's a similar problem with the other font fallback change I submitted, is there any ETA for 1.0 so that we can all "sync" our efforts?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Kulik » Thu Dec 18, 2014 12:22

Yeah, this change will most likely break API and cannot be done on v0-8. IMO you need to introduce an enum to allow this option, change the API accordingly and apply it to default.

If you want it in v0-8 you would then cherry pick that one commit there and keep your own v0-8. The change will most likely be small enough for this to be an option.

I am sorry but this is the reality, we can't break API for people using the stable branch. No exceptions. :-(

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Ident » Thu Dec 18, 2014 13:03

If you make a pull request for default branch (See: https://bitbucket.org/cegui/cegui) you can later-on relatively easy apply the commit from default, to your v0-8 and use it (only on your computer). Basically what Kulik said.
CrazyEddie: "I don't like GUIs"

Montred
Not too shy to talk
Not too shy to talk
Posts: 42
Joined: Sat Nov 10, 2012 06:45

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Montred » Sat Dec 20, 2014 19:40

Thanks for the replies.

I actually found a workaround for this that does exactly what I want, you simply have to hide the horizontall scroller element. It's not very elegant of course because you are relying on numeric indices but it works for me:

Code: Select all

      if (scroller->getChildAtIdx(1) && scroller->getChildAtIdx(1)->getChildCount() >= 3){
         scroller->getChildAtIdx(1)->getChildAtIdx(0)->setVisible(false);
         scroller->getChildAtIdx(1)->getChildAtIdx(1)->setVisible(false);
         scroller->getChildAtIdx(1)->getChildAtIdx(2)->setVisible(false);
         scroller->getChildAtIdx(1)->setVisible(false);
                }


I have one little problem though, the layout is a bit broken after I do this and things won't show properly until I nudge the window by resizing by at least a pixel, I'm sure you know what I'm talking about.

My question is, is there anyway of making that "nudge" happen programmatically? I have tried combinations of invalidate() and performChildWindowLayout(true, true) plus changing the size with setSize() and update() on all the elements involved to no avail.

performChildWindowLayout() + changing the size programatically fixes some of the layout problems. The final problem I have now is the "ghost" of the horizontal scrollbar keeps showing (only the rail, not the handle or the direction buttons) until I nudge the parent window of the element by resizing it with the mouse.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: setShowHorzScrollbar(false) should hide scrollbar

Postby Ident » Sun Dec 21, 2014 11:37

I suggest making a patch that does it right instead of messing with workarounds. Seriously. You will probably save time by doing so, and should be really easy to do it.

If you do it with some crazy workaround you will always end up working your way around other issues that arise.
CrazyEddie: "I don't like GUIs"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 6 guests