Share widget-width across different widgets in gtk3 via css - css

I have different sub-elements in a GtkBox, the first item always is a GtkLabel which should show the line-number. ( Each element of the GtkBox shows a line of a file )
Now I want to make sure that the width of the GtkLabel always is the maximum used width across all GtkLabel's in the GtkBox.
I already implemented that in C-code, however I wonder if it is as well possible to do so by using css ... probably that would be more elegant.
For gtkBoxes the css-attribute "min‑width" is available ... but I dont want to set a fixed value, I want to set the maximum width of all objects which are in the css-class.
I have no idea how/if that is possible. Is there some way to express that in css ?

No, you cannot define this behaviour in CSS.
You should use a GtkSizeGroup with a GTK_SIZE_GROUP_HORIZONTAL mode, instead; you can also define size groups inside your GtkBuilder XML files, if you want to avoid having this relationship inside the source code.

Related

Is there a way to change size of ng-cicle-progress CircleProgressComponent element dynamically?

In the Angular 11 project I need to change ng-circle-progress library CircleProgressComponent element size dynamically.
I have found out, that size of the element can be changed by putting width/height CSS properties on the child DOM element - svg. Problem is that svg doesn't have any id or class values, so even if I could somehow query the element, this would be not that easy and flexible as it should be.
Would be extremely nice to have a parameter in the CircleProgressComponent, that listens to outer variable changes and re-renders the element with a new size.
I had never used this library, so I've read their doc and thier demo page.
If I understand, they have the parameter that you want called radius
<circle-progress
[percent]="85"
[radius]="200" // the size you want
[outerStrokeWidth]="16"
[innerStrokeWidth]="8"
[outerStrokeColor]="'#78C000'"
[innerStrokeColor]="'#C7E596'"
[animation]="true"
[animationDuration]="300"
></circle-progress>

GXT3 - Change grid cell background color dependent on value (without CSS classes)

In GXT2 it was possible to change a cell's background color within the GridCellRenderer's render method. With GXT3 this is not possible anymore and the suggested approach is to use a GridViewConfig and override the getColStyle method.
My problem with this appoach is that I don't want to use css classes here but directly manipulate the cell's style as the desired background colors are only known at runtime.
My first idea was to do something like grid.getView().getCell(rowIndex, colIndex).getStyle().setBackgroundColor(...) within getColStyle but the returned cell always seems to be null here.
I've found a solution by myself:
I had to override com.sencha.gxt.widget.core.client.grid.GridView#doRender and append some custom SafeStyles to the cell dependend on the model. To make it more flexible, I introduced also an inheritance of the GridViewConfig to do this job.
I hoped that there would be a simpler solution but at least it is one.

How to remove padding created by ResponsiveGridLayout control in OpenUI5 (SAPUI5)?

I am creating a form using OpenUI5 and I noticed that when I am using the ResponsiveGridLayout layout, the form gets some padding (blue area around the input fields). Please see result here:
http://plnkr.co/edit/G4NrKPMGdN4DACXZgZOg?p=preview
If I am using the GridLayout layout, the padding is as expected:
http://plnkr.co/edit/Yp6Ul7gLDf0t88vMWrWD?p=preview
Any idea how I can get a form with very a small padding (like in GridLayout example), but in the same time I want to be able to use the 12-column grid system so I can set the size on my input fields?
Ideally, the views need to be XML and to use OpenUI5 classes/controls if possible.
You could just swap the responsible style classes using .addStyleClass() and .removeStyleClass().
Not sure if it works, but thats the easiest possible fix I can think of that might be worth a try.

View multiple user interface elements properly

I would like to set multiple UI elements visible. There is one problem though. I have a lot of UI elements and it's been set up like this:
nameLanguageLabel.setVisible(true);
descriptionLabel.setVisible(true);
mainNameLabel.setVisible(true);
mainURLLabel.setVisible(true);
URLLanguageLabel.setVisible(true);
mainBodyLabel.setVisible(true);
filesLabel.setVisible(true);
fileTypeLabel.setVisible(true);
srcLabel.setVisible(true);
isHeaderImageLabel.setVisible(true);
mainDescriptionTxtField.setVisible(true);
mainIsHeaderImageTxtField.setVisible(true);
mainSrcTxtField.setVisible(true);
mainFileTypeTxtField.setVisible(true);
mainURLTxtField.setVisible(true);
mainNameTxtField.setVisible(true);
Is there a way to make the code shorter? It may be something I haven't noticed during the tutorials I've been doing. (It's not the same project).
http://code.makery.ch/library/javafx-8-tutorial/
All the elements are in a container. I've set it to visible false, and set it visible, whenever I need it. It's been reduced to this:
mainPane.setVisible(true);

Dojo GFX widgets displaying float-like behaviour instead of correct positioning

I'm using Dojo GFX to do some simple drawing, but having a problem with IE 7/8 (switching browsers is not an option).
If I create a div, set up a surface and draw some rects, they draw correctly relative to the div, so far so good.
However, what I want to do is create a widget, something with an embedded 'surface' that draws based on some widget-specific data. As such, I have a widget that contains a div, and I draw into this div. When I do that, the rects I create behave as if they are responding to a float:right, appearing in order they are created and ignoring the 'x' parameter.
I assume that this behaviour is something to do with CSS, but I haven't got to the bottom of it yet. Any ideas or solutions gratefully appreciated!
Updates:
I've disabled all stylesheets and I am not using style attributes. No difference to the behaviour.
I've inspected the markup that gets generated using IE8 dev tools. Apart from the different location of the containing div, the only difference I can see is that the v:roundrect elements have no child elements when created against the widget div, but they do have empty elements like stroke when created against the div referenced by ID.
Reading back through the docs, a difference I can see that might be responsible is that the postCreate method where I am doing my drawing is manipulating a div that has not been added to the dom yet, whereas drawing on a hardcoded div is done when it does exist. Maybe the difference in rendering is something to do with this? Is there a specific lifecycle function which is appropriate to draw in for widgets?
It seems that if you are going to use Dojo GFX and draw on DOM elements that are created as part of a widget in IE7/8, you must actually do the drawing in an override of the startup() method.
Drawing in the postCreate() method causes incorrect rendering resembling a float: left.

Resources