JavaFX8 tree table remove disclosure node indentation - javafx

The disclosure node is placed in a separate column which for root items contain that arrow and for child items - some data. Currently there's an indentation between arrow and data(see image below).
How can I remove that? Thanks.

I looked high and low for a solution to this my self and finally found it by looking at the source for the skin for the TreeTableRow. Apparently there is a css property called -fx-indent that will do what you need.
This is how I achieved a similar result to what I believe you are trying to do:
.tree-table-row-cell{
-fx-indent: -20;
}
Obviously you need to figure out a better value than -20 but that did the trick in my proof of concept.
I hope this helps.

Related

NG Zorro Multi Select - keep selected items on one line instead of wrapping and doubling height

Anyone know if there is a way to make the ng zorro select (multi) to stick to one line instead of wrapping the selected items. In some scenarios its fine but when you have certain layouts you cant have the height doubling on each selection.
There is a codebox demo here: https://codesandbox.io/s/2lp2n (reduce the size of the view panel to see what i mean).
I have tried pretty much all i can think of (adding css to the select and select top classes to try and force it to stay on one line but it doesnt seem to work). I wanted to ask here first to see if anyone has any ideas since their git would normally close a question and ask me to come here first.
Thanks
In the end i just had to add:
flex-wrap: nowrap !important;
to nz-select-top-control

How to only set the right padding without changing the other sides

this is a possible duplicate of this question but as it wasn't answered or the provided answers didn't satisfy my needs i had to post a new question here, so how do i set the padding value to a javaFX node to only one side without having to specify padding values for the other sides, better if through CSS, thank you.
after fabian pointed out that there is no way to specify one side without affecting other sides as the padding is a single property, that's the solution that i came up with, which worked for my specific case and i hope someone finds this useful
Insets old = region.getPadding();
int rightPadding = 45;
region.setPadding(new Insets(old.getTop(), rightPadding , old.getBottom(), old.getLeft()));

Create Profile Dropdown Menu in Polymer with Triangular top

I am trying to create a profile menu for my polymer website, something on the lines of github.com
If you notice,there is a triangular tip at the top of the menu.I am trying to create a similar triangle at the top of paper-listbox.
The problem I am facing is that the triangle seems to hide as soon as it gets out of the boundaries of paper-listbox.
I have create a jsbin to demonstrate my problem: http://jsbin.com/samaloqowu/1/edit?html,console,output
If you change the top property of the triangle (say -16px), it hides when it gets out of the listbox region. Please help me solve this CSS issue.
Short answer : No you can't.
Explanation : Because the dropdown content get encapsulated in a slotted element that gets styled inside the shadowRoot of the custom element you try to modify the behavior. And the paper-menu-button doesn't actually gives you a way to directly customize the slotted.
But there is a trick ! You can access the slotted through classic javascript. Just alter your connectedCallback function and add this line :
...
connectedCallback() {
super.connectedCallback();
this.$.profileMenu.$.dropdown.querySelector('.dropdown-content').style.overflow = 'visible';
...
}
...
This should do the trick, I agree this looks totally awful and trying to force and change the initial behavior of an element is not really recommended but well it seems to work, just make some tests when the element gets in a new context to see if anything breaks.
UPDATE (22/09/2017) :
Thinking of that again, I think this is a terrible idea to change this overflow to visible, I guess the polymer team has set the overflow to auto because if the list get long and you force the height of the element, the list will flow and be visible which is not really a dropdown anymore, but more like a full list display and that will mess with the general design purpose of your app. IMO when you start trying to mess with the inner properties of a custom element it means this element doesn't quench your requirement, and that it's time to make your own, especially when you try to modify the design of a custom element that has a design already implemented.

Cancel the indentation of leaf nodes in an AdvancedDataGrid tree

I have an AdvancedDataGrid structured as a tree. Since the non-leaf nodes have an arrow to open/close them (I have no icons), their labels start just after the arrow, and the leaf nodes in the same level are indented to be aligned to them. I want to cancel that indentation so the leaf nodes will start from the beginning of the column. I tried to set the indentation to 0, but it doesn't have any effect.
Does anybody know how to do that, if at all possible?
Thanks.
there is no need to use a custom renderer for that. Just set the displayDisclosureIcon property of AdvancedDatagrid to false.
I think you can override the AdvancedDataGridItemRenderer or you can replace it with your own renderere. However, the ADG renderers take care of a lot of things automatically, so approach this with caution.
So as I said in my comment, I used AdvancedDataGridGroupItemRenderer. I created a subclass of it and overrode updateDisplayList, in which I set the dimensions of the disclosureIcon field to 0. That did the trick.

Can I use a table view for a table containing many images?

I have a table view in PyQt that needs to have an image in every cell.
I have used delegation of a label (and added a pixmap to that label). But the problem is when I add 12 cells (12 images of size 60x30 pixels), the table becomes too slow, and I need to have a table that contains hundreds of images. Should I be using another delegation? Or is it just not doable with a table view? If so, what is the best widget for such a task?
Any answer for Qt or PyQt would be highly appreciated.
I think you should try using QGraphicsView for your purpose. Its much faster to render images on it.
One clever way to do is created a huge graphicsitem which mimics a table based on ur rows and columns count.
then add children graphicsrectitem item as each cell container.
lastly add the images as qgraphicspixmap item as children of the rectitem. this way u can make it quicker and also interactive since u can select them individually and also make them movable inside the cell by user by checking collision detection to make sure they are not pulled outside the cell boundary.
hope that provides u an alternative.
QListView provides an icon mode where you can stack your images in a grid.

Resources