Cableguy Expert Licensed User Longtime User Sep 17, 2023 #1 Hi guys, Here I am again with a NQ (Noob Question) TreeView has, as many views do, a corner radius property. My issue is the value seems to only be set to the "base panel" of this ("custom view"?) So... what is the view I need to address to set the correct corner radius??
Hi guys, Here I am again with a NQ (Noob Question) TreeView has, as many views do, a corner radius property. My issue is the value seems to only be set to the "base panel" of this ("custom view"?) So... what is the view I need to address to set the correct corner radius??
Solution zed Sep 17, 2023 Hi Cableguy, Is this something like that you want? The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar.
Hi Cableguy, Is this something like that you want? The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar.
BlueVision Well-Known Member Licensed User Longtime User Sep 17, 2023 #2 Lol. Funny that it's not just me who has this problem. However, I have given up trying to solve this problem. But since the proportions in my views usually don't change dynamically, I went the easiest way. I made the radius of the rounded corners a little smaller and then centred the element above it. Within certain limits, this even works with the Designer (calculation of width and height of the underlying element and corresponding centric positioning of the element above). However, if the radii of the corners are too large, this no longer works. As in your picture, it just looks ugly. It simply disturbs the visual aesthetics of the view. It would be helpful if a 'childview' would automatically adapt to the rounded corners of the 'parentview' below. Last edited: Sep 17, 2023 Upvote 0
Lol. Funny that it's not just me who has this problem. However, I have given up trying to solve this problem. But since the proportions in my views usually don't change dynamically, I went the easiest way. I made the radius of the rounded corners a little smaller and then centred the element above it. Within certain limits, this even works with the Designer (calculation of width and height of the underlying element and corresponding centric positioning of the element above). However, if the radii of the corners are too large, this no longer works. As in your picture, it just looks ugly. It simply disturbs the visual aesthetics of the view. It would be helpful if a 'childview' would automatically adapt to the rounded corners of the 'parentview' below.
zed Well-Known Member Licensed User Sep 17, 2023 #3 Hi Cableguy, Is this something like that you want? The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar. Upvote 0 Solution
Hi Cableguy, Is this something like that you want? The treeview is transparent and I put a panel underneath with rounded edges. But I no longer have the scroll bar.
Cableguy Expert Licensed User Longtime User Sep 17, 2023 #5 AAAAARRRRRRGGGGGG It works perfect in the designer preview, but compilated, it doesn't look quite the same! HUMMMMMM..... that is just the treeview focus! Need to keep an eye on that! Last edited: Sep 17, 2023 Upvote 0
AAAAARRRRRRGGGGGG It works perfect in the designer preview, but compilated, it doesn't look quite the same! HUMMMMMM..... that is just the treeview focus! Need to keep an eye on that!
stevel05 Expert Licensed User Longtime User Sep 17, 2023 #6 What is actually causing the issue are the top and bottom treecells contained in the treeview. View from Scenic View If you set the ExtraCss on the treeview something like: -fx-padding:5 20 5 20; (or whatever suits your radius) then the contained cells are no longer wide enough to cause the issue. Whether that is what you want is another matter as you will get bigger left and right margins. Last edited: Sep 17, 2023 Upvote 0
What is actually causing the issue are the top and bottom treecells contained in the treeview. View from Scenic View If you set the ExtraCss on the treeview something like: -fx-padding:5 20 5 20; (or whatever suits your radius) then the contained cells are no longer wide enough to cause the issue. Whether that is what you want is another matter as you will get bigger left and right margins.
zed Well-Known Member Licensed User Sep 17, 2023 #7 It works very well with CSS. Without loss on the sides JavaFX CSS Reference Guide This document describes the JavaFX Cascading Style Sheets (CSS) for JavaFX 2 and explains the styles, values, properties and associated grammar. docs.oracle.com Upvote 0
It works very well with CSS. Without loss on the sides JavaFX CSS Reference Guide This document describes the JavaFX Cascading Style Sheets (CSS) for JavaFX 2 and explains the styles, values, properties and associated grammar. docs.oracle.com
stevel05 Expert Licensed User Longtime User Sep 17, 2023 #8 Yes, it all depends on the Radius you choose. Trying different values for the padding should get somewhere close as a compromise and not lose too much left and right. Upvote 0
Yes, it all depends on the Radius you choose. Trying different values for the padding should get somewhere close as a compromise and not lose too much left and right.
stevel05 Expert Licensed User Longtime User Sep 17, 2023 #9 BTW, that is CSS documentation for a very old version of JavaFX. Look for one that matches the version of JavaFX you are using. not much changes, but you never know. : JavaFX14 Upvote 0
BTW, that is CSS documentation for a very old version of JavaFX. Look for one that matches the version of JavaFX you are using. not much changes, but you never know. : JavaFX14