Visual representation (error?) of part stack for e4 oxygen - swt

We recently updated our e4 target platform to oxygen.
Now, we are seeing strange lines on each part stack.
Does anybody know why this could be happening and how we can get a "clean" rendering?

This was caused by the css styling. This is an example of a setting which causes this:
.MPartStack {
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-unselected-tabs-color: radial #ffffff #ffffff 60%;
swt-shadow-visible: true;
}
Either of the following corrects the problem:
add "100%":
swt-unselected-tabs-color: radial #ffffff #ffffff 60% 100%;
set from true to false:
swt-shadow-visible: false;

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!

Line thickness of 0.5px (1 real pixel) on a retina display in mobile safari

How can I draw a line with mobile safari that is one real pixel wide on a retina display?
I tried:
border-bottom:0.5px solid #fff;
and
border-bottom:0.05em solid #fff;
with different values between 0.01em and 0.1em.
Mobile Safari always draws a line that is one pixel wide (2 pixels on a retina display) or none at all. How can I make mobile safari draw a line that is one real pixel (0.5px) wide ?
Use scale. The style below will give you hairline
.transform-border-hairline {
border-bottom: 1px #ff0000 solid;
transform: scaleY(0.5);
}
More specificly (and that trick in live use) here http://atirip.com/2013/09/22/yes-we-can-do-fraction-of-a-pixel/
Use border-width: 0.5px
Safari 8 (in both iOS and OS X) brings border-width: 0.5px. You can use that if you’re ready to accept that current versions of Android and old versions of iOS and OS X will just show a regular border (a fair compromise in my opinion).
You can’t use this directly though, because browsers that don’t know about 0.5px borders will interpret it as 0px. No border. So what you need to do is add a class to your <html> element when it is supported:
if (window.devicePixelRatio && devicePixelRatio >= 2) {
var testElem = document.createElement('div');
testElem.style.border = '.5px solid transparent';
document.body.appendChild(testElem);
if (testElem.offsetHeight == 1)
{
document.querySelector('html').classList.add('hairlines');
}
document.body.removeChild(testElem);
}
// This assumes this script runs in <body>, if it runs in <head> wrap it in $(document).ready(function() { })
Then, using retina hairlines becomes really easy:
div {
border: 1px solid #bbb;
}
.hairlines div {
border-width: 0.5px;
}
Best of all, you can use border-radius with it. And you can use it with the 4 borders (top/right/bottom/left) as easily.
Source: http://dieulot.net/css-retina-hairline
I don't normally suggest using .5 in pixels ever really. But you want a fallback to it.
just place the fallback on top. Like this.
border-bottom: 1px solid #fff;
border-bottom: 0.5px solid #fff;
Warning: Many phones are now 3x (3 real pixels for each logical pixel).
Therefore 0.5px mathematically equates to 1.5 real pixels - which is impossible to render consistently.
So if you're trying to put a 0.5px border around something it's physically impossible for it to be consistent. Now the browser may decide to always round it to 1 real pixel or 2 real pixels OR it may try to anti-alias it. Unfortunately not even 'thin' as a thickness renders as one device pixel.
The worse case scanerio is it will use 1 pixel on one edge and 2 pixels on another which will end up looking awful. So be sure to keep this in mind and test on a 3x phone.

Offsetting a chart legend/Layered charts with JavaFX

Short version: is it possible to offset a chart legend in JavaFX, i.e. left align a bottom legend or shift the legend 20px off of center? It does not look possible with either Java code or with CSS, from looking through the JavaFX documentation or just general Google searching.
Longer version:
Let's say that, for example, I have a chart showing 3-phase AC power utilization on say, 4 different breakers. I want to show both the total percent utilization of the circuit and the percent that is being used of each individual phase on "one chart". So I take two different bar charts and stack them ending up with something like below:
Example chart
However, because the overall utilization and the phase utilization are in different charts, they have different legends. Because the phase chart is on top of the overall chart, we can't see the legend for the overall utilization chart. So then, is it possible to offset to two legends so that both are visible, as in the following image (it's photo-edited):
Example of desired result
Is this possible, or is this just a dumb approach, as in, is there a better way to get this or other similar result? Any thoughts would be appreciated.
Not so elegant, hard coded but straightforward way seems again to play with CSS:
/* The default css of chart legend in caspian. */
.chart-legend {
-fx-background-color: #cccccc, #eeeeee;
-fx-background-insets: 0,1;
-fx-background-radius: 6,5;
-fx-padding: 6px;
}
/* We customize the above default background-color to transparent for
the chart legend on the right side, in our own CSS file. */
#my-legend-on-the-right-side .chart-legend {
-fx-background-color: transparent;
-fx-background-insets: 0,1;
-fx-background-radius: 6,5;
-fx-padding: 6px;
}
/* Then we customize the legend on the left side by padding
it to the left while its background covers the legend on the right. */
#my-legend-on-the-left-side .chart-legend {
-fx-background-color: #cccccc, #eeeeee;
-fx-background-insets: 0,1;
-fx-background-radius: 6,5;
-fx-padding: 6px 300px 6px 6px;
}
Use them by setting ids:
barChartTotal.setId("my-legend-on-the-left-side");
barChartPhases.setId("my-legend-on-the-right-side");

GtkTextView top/bottom margin?

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.

square Facebook pictures

Using Graph API I can get small, large, medium pictures. Or I can get small square picture.
But how can I get large square picture? Is there any service I can use?
Simple, I just found this out.
Example,
https://graph.facebook.com/friends_Id/picture?width=200&height=200
tada~
Oddly enough, Facebook itself doesn't use a bigger square image even though they show a bigger squared profile picture on the new timeline pictures. If you take a closer look they take a larger rectangular image and reposition it inside an HTML element as Michael proposed above.
I would expect that at some point the positioning data they use for this will be released via the API but I am not aware of that data being available yet. I've had times where this would have been helpful also and have thus far either just centered the image or used the top portion. Not ideal though since FB already allows for and tracks custom positioning of the most important "square" of the image via their "icon" creator.
There is no way to do this officially, here's a silly hack. The following code will make sure the image is no wider/taller than 120 pixels. If it is, then the image will overflow outside the element:
<div style="width: 120px; height: 120px; overflow: hidden; display: inline-block;">
<img src="{$image}" align="absmiddle" width=120 style="min-width: 120px; min-height: 120px;" />
</div>
You can specify the picture size you want with the type argument, which should be one of square (50x50), small (50 pixels wide, variable height), and large (about 200 pixels wide, variable height).
From the Graph API Reference. Those are the only three sizes available. You can use a bigger version of the 50x50 image but it'll obviously look dithered.
Nowadays Graph actually could return you square image of any size. They cache most common sizes (like 100x100, 128x128) and return the closest size by the following request (hover to see)
As the other answers already stated, in facebook the square pictures are only in 50x50 resolution.
A simple CSS hack does the trick though:
Query the large image, wrap the img-tag with a div and apply this CSS to the div:
img#facebook_img {
width: YOUR_WIDTH;
}
div#wrapper {
height: YOUR_HEIGHT;
overflow: hidden;
}
If YOUR_WIDTH and YOUR_HEIGHT are the same you get your square image and the ratio is preserved.
None of the answers worked perfectly for me, having come across profile pictures of various dimensions (some with a greater height than expected, some with a smaller height) which ended up either stretched or non-centered.
In the end I used a div element instead of an img and set the image through a background-image style attribute rather than through its src attribute.
CSS file:
.profile-pic {
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 120px;
width: 120px;
border: solid 1px #ddd;
}
HTML:
<div style="background-image:url(https://graph.facebook.com/123/picture?width=120&height=120);" class="profile-pic"></div>
Replace 120px in the above (occurs twice in the CSS and twice in the HTML fragment) with your desired dimensions.