GtkTextView top/bottom margin? - gtk3

I would like to know the correct and generally accepted way of adding a top and bottom margin to a GtkTextView that is inside of a GtkScrolledWindow. There are functions to set the left and right margin, which I am using:
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(editor_text_view), 2);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(editor_text_view), 2);
But I can't seem to find any documentation on top and bottom. I've tried changing the border width of the GtkTextView with gtk_container_set_border_width but the border is not painted with the background color of the GtkTextView.
Basically - what I have is on the left and what I want is on the right.

You should use CSS for this things in GTK+ 3:
http://developer.gnome.org/gtk3/3.3/GtkCssProvider.html
Maybe you can use the view class:
.view {
padding: 3px;
}
Or only apply the style to the GtkTextView:
GtkTextView {
padding: 3px;
}

I'm using Ubuntu Natty with gtk+-3.2.3. and those CSS properties don't have any affect for some reason.
But you can use:
gtk_text_view_set_border_window_size( )
Along with: GTK_TEXT_WINDOW_TOP and GTK_TEXT_WINDOW_BOTTOM
And the border color will match the background of the GtkTextView.
http://developer.gnome.org/gtk3/3.4/GtkTextView.html#gtk-text-view-set-border-window-size

I just had to solve similar issue and I nested the text view in GtkAlignment - that gave me an option to set padding for all sides.

Related

Transparent div "above" map blocking dragging

I have a full screen map with a sibling div that appears "above" the map. The div is a full width 3 column flex, the left and right columns contain information panels (green in the diagram), the centre one is empty (pink in the diagram):
As far as the user is concerned, the pink column doesn't exist.
The problem I'm facing is that the center column is blocking drag events on the map, moving the mouse over it changes the pointer from a drag handle to a pointer.
It seems the standard solution for this is to add
pointer-events: none;
to the blocking div. I've tried this and it seems to make no difference, so I'm wondering if there's some Leaflet specific knowledge I'm lacking in regard to this.
Anyone got any ideas? Any suggestions welcome! :)
May be you can giving the center column a class.
for example:
class "center-column"
and put some css rule, like this:
.center-column {
position: relative;
z-index: -10;
}
Turns out it was due to a mistake I made. Since my map was full screen, I've given it's container the following styles:
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
z-index: -5000;
It looks like reducing the z-index of the map to be underneath the panels was the wrong way to do it. Removing the z-index: -5000, and increasing the z-index of the panels resulted in the same display, but without the problem!

Ag Grid - How to set the width and height of a standard cell editor to the full width and height of the cell

I have a standard cell editor and when I am in edit mode the width and the height of the cell editor is not the full width and height of the cell.
Should I overwrite the styles or is there any flag in the configuration to turn off this effect?
I had this same problem. If you look at the DOM, you'll see ag-grid adds a wrapper div around all custom editors, and it's actually that div that is the problem. I solved it by adding this to my global CSS:
.ag-react-container {
/*
* This class is used on divs automatically inserted by AgGrid around custom cell editors.
* Without this, I don't know of another way of ensuring that the underlying <input> can take
* up 100% of the height of the parent cell, if it so chooses to.
*/
height: 100%;
}
I think a better way to achieve this is to only modify the inline style editor css:
.ag-theme-balham .ag-cell.ag-cell-inline-editing{
height: 100%;
}

Dynamically set div with leaflet side-by-side plugin

I want to set the left margin of a div by the position of the slider from the side-by-side plug in. It looks to be possible as the dividermove event built into the plug-in, but I haven't been able to figure out a method to feed that into the CSS for my div.
In the jsfiddle below, I basically want to dynamically set the left margin #year05 and #year15 using dividermove. I tried setting the #year05 class to inherit left from leaflet-sbs-divider but couldn't get it to work and I imagine is not the proper way to do it.
https://jsfiddle.net/x8r0pvg1/45/
If I understand correctly, you just want to position some text that follows the slider of Leaflet Side-by-Side plugin.
In that case, instead of trying to re-position your text / div on "dividermove" event, a very simple solution would be to append your div into the slider / divider itself, so that when the plugin adjusts the position of the latter, your div follows along automatically:
var yearsEl = document.getElementById('years'); // your div
document.querySelector('.leaflet-sbs-divider').appendChild(yearsEl);
Then you can center your div on the divider with your method of choice, e.g. using CSS:
#years {
width: 200px;
transform: translateX(-50%);
text-align: center;
}
Updated JSFiddle: https://jsfiddle.net/x8r0pvg1/47/

Setting color of padding for GtkAlignment

I have a GtkTextView inside a GtkAlignment, which I'm using to add top/bottom padding to the text view:
GtkAlignment
top-padding: 5
bottom-padding: 5
child: GtkTextView
Right now it looks like this:
So, it works, but the padding is gray and I want it to be white (ideally I want it to be “the color of the text view” in case the user has a custom theme, but white would do as well). Is there any way to do it?

Gwt DockLayoutPanel Styling

Is there a way to remove the gap/padding between the panels in DockLayoutPanels. I couldn't find anything online on how to do that. If using CSS is the way to go, what attribute do I have to configure. I try setting padding to 0px in css, that didn't work. Thanks in advance.
If you want to remove the extra padding and margin of the DockLayoutPanel then you can try any one as mentioned below
CSS:
.dockpanel{
margin: 0;
padding: 0;
}
JAVA:
DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
dockLayoutPanel.setWidth("200px");
//dockLayoutPanel.setStyleName("dockpanel");
//dockLayoutPanel.getElement().getStyle().setPaddingBottom(0, Unit.PX);
dockLayoutPanel.getElement().getStyle().setPadding(0, Unit.PX);
dockLayoutPanel.getElement().getStyle().setMargin(0, Unit.PX);
By default there is no extra padding and margin between its components. DockLayoutPanel fits the components as per their placement. It ignores component's preferred size.
For e.g.
Width is ignored for the component set in north or south
Height is ignored for the component set in the west or east.
Rest available space is covered by center component.
If still there is any gap then do the same for other components placed inside DockLayoutPanel.