Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove scroll bar of TBEditField #112

Open
karamellpelle opened this issue Nov 27, 2016 · 2 comments
Open

Remove scroll bar of TBEditField #112

karamellpelle opened this issue Nov 27, 2016 · 2 comments

Comments

@karamellpelle
Copy link

Is there a way to hide the scroll bar of TBEditField? I tried to find a way to change the skin of the scroller to blank, but I couldn't.

I wanted to use TBEditField as a read-only text label, that wraps its text according to its size. But I don't want the scroller to show up. And I don't want the border either. The TBTextField gives just one line of text. Or maybe there is a better widget for this than TBEditField?

@fruxo
Copy link
Owner

fruxo commented Nov 28, 2016

No there isn't.
TBEditField::UpdateScrollbarVisibility is always setting y-scrollbar depending on "multiline && !m_adapt_to_content_size". Adding SCROLL_MODE to it would be nice IMO. Another personal wish i have is mobile-style scrollbars (that takes no space and fades in/out only when scrolled).

There is a workaround though. You could wrap it in TBScrollContainer which already has SCROLL_MODE like this:

TBScrollContainer
    scroll-mode off
    adapt-to-content 1
    TBEditField
        text yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada yada
        multiline 1
        readonly 1
        adapt-to-content 1
        virtual-width 300dp
        skin

@fruxo
Copy link
Owner

fruxo commented Nov 28, 2016

Oh, and now i realize that was overly complicated since you always wanted scrollbars off. So you can just skip the whole part wrapping it in a TBScrollContainer and use the adapt-to-content attribute :)
virtual-width will guide the initial measuring so that wrapping happens at that limit by default (but still allowing it to wrap somewhere else within its min and max constraints)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants