Comments (7)
This should work today i think:
Give the TBTabContainer some special skin name, f.ex skin: "duck", "badger" for every new style.
Then in "TBTabContainer.rootlayout", "TBTabContainer.tablayout_x/y", "TBTabContainer.container" and "TBTabContainer.tab" you can use override (or strong-override) with a condition for ancestors with skin name "duck" or "badger" to specify the different versions. It would probably quickly get quite messy (and less efficient) if you have a lot of different visuals though.
Other possible solutions:
You can use the skin attribute under the "tabs" section (or any other attribute) and it will apply to the tabs layout. Adding the same possibility for "container" and "root" would be super simple and allow the skin attribute on those too.
A bug: I noticed TBTabLayout::OnChildAdded always override the skin for TBButton, so any attempt to set the skin attibute directly on a specific tab will currently fail.
from turbobadger.
Could you write a little example of skin for additional skin, please. For example I want to change background of layout and backgrounds of tab buttons.
Thank you!
from turbobadger.
In your ui resource:
TBTabContainer: skin: "duck"
In your skin override (assuming you override the default skin):
TBTabContainer.tab_top
strong-overrides
element TBTabContainer.ducky_tab
condition: target: ancestors, property: skin, value: duck
TBTabContainer.ducky_tab
padding 10
overrides
element TBTabContainer.ducky_tab.pressed
state pressed
TBTabContainer.ducky_tab.pressed
padding 10
background-color #fd0
This will add the strong-override section to the default "TBTabContainer.tab_top" skin so the TBTabContainer.ducky_tab skin will be used instead if any ancestor has skin "duck", which the TBTabContainer has.
There's some limitations for what you can change in an override skin, since they can only add to the override/strong-override/child/overlay lists (and not replace in them). So some things requires changing the base skin.
from turbobadger.
The example won't look pretty, but at least it shows how conditions can be used :)
from turbobadger.
It working! Thank you!
from turbobadger.
Great!
And now it's also possible to use the skin attribute on "content" and "root".
from turbobadger.
Cool! Thanks! :)
from turbobadger.
Related Issues (20)
- Glyph collision in hashmap
- Korean input not support under Windows HOT 5
- Window without System Window HOT 2
- Fonts switch HOT 2
- Unicode language Input with Extra Enter HOT 1
- TBEditField rendering performance HOT 7
- Remove scroll bar of TBEditField HOT 2
- The Relationship with AtomicEngine's Turbobadger HOT 2
- TBImageManager improvements
- Need update to new version of third lib stb_image
- Suggestion on how to best implement drag and drop between item source views.
- Missing TBMover factory
- how to run the tests ? HOT 1
- TBLayout: one fixed item and one item take remaining space HOT 1
- How should I use TBWidgetsReader to set up a widget?
- gcc9 warning
- Nice project. But it was abandoned? HOT 6
- It works on emscripten/wasm? HOT 1
- OnInflateChild question HOT 4
- Dawing custom shapes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbobadger.