Skip to content

Commit

Permalink
Several changes:
Browse files Browse the repository at this point in the history
    - layout managers: honour minimum sizes, really
    - wt homepage: http -> schemaless urls for webtoolkit.eu and emweb.be
    - WCartesianChart: Don't interpret long pause after pinch to zoom as long press
  • Loading branch information
Koen Deforche committed Apr 8, 2016
1 parent e372603 commit 2fad170
Show file tree
Hide file tree
Showing 10 changed files with 321 additions and 303 deletions.
2 changes: 1 addition & 1 deletion cmake/WtFindSkia.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ IF(WIN32)
optimized ${SKIA_OPTS_SSE41_LIB_R}
debug ${SKIA_OPTS_SSE41_LIB_D}
)
ENDIF(SKIA_ETC1_LIB_D AND SKIA_ETC1_LIB_R)
ENDIF(SKIA_OPTS_SSE41_LIB_D AND SKIA_OPTS_SSE41_LIB_R)
IF(SKIA_ETC1_LIB_D AND SKIA_ETC1_LIB_R)
SET(SKIA_LIBRARIES ${SKIA_LIBRARIES}
optimized ${SKIA_ETC1_LIB_R}
Expand Down
4 changes: 2 additions & 2 deletions examples/widgetgallery/TopicTemplate.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ TopicTemplate::TopicTemplate(const char *trKey)
#ifndef WT_TARGET_JAVA
setCondition("if:cpp", true);
setCondition("if:java", false);
bindString("doc-url", "http://www.webtoolkit.eu/wt/doc/reference/html/");
bindString("doc-url", "//www.webtoolkit.eu/wt/doc/reference/html/");
#else
setCondition("if:cpp", false);
setCondition("if:java", true);
bindString("doc-url", "http://www.webtoolkit.eu/"
bindString("doc-url", "//www.webtoolkit.eu/"
"jwt/latest/doc/javadoc/eu/webtoolkit/jwt/");
#endif
}
Expand Down
154 changes: 77 additions & 77 deletions examples/wt-homepage/wt-home.xml

Large diffs are not rendered by default.

128 changes: 64 additions & 64 deletions examples/wt-homepage/wt-home_cn.xml

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions examples/wt-homepage/wt-home_ru.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Wt/Chart/WCartesianChart.C
Original file line number Diff line number Diff line change
Expand Up @@ -3791,7 +3791,8 @@ void WCartesianChart::clearPens()

void WCartesianChart::createPensForAxis(Axis ax)
{
if (!axis(ax).isVisible()) return;
if (!axis(ax).isVisible() || axis(ax).scale() == LogScale)
return;

double zoom = axis(ax).zoom();
if (zoom > axis(ax).maxZoom()) {
Expand Down
3 changes: 2 additions & 1 deletion src/js/StdGridLayoutImpl2.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ WT_DECLARE_WT_MEMBER
if (!item.span || item.span[dir] == 1) {
if (wPreferred > dPreferred)
dPreferred = wPreferred;
if (wMinimum > dMinimum)
dMinimum = wMinimum;
} else
spanned = true;
} else {
Expand Down Expand Up @@ -776,7 +778,6 @@ WT_DECLARE_WT_MEMBER
* mark the corresponding cell as dirty if the TOTAL_PREFERRED_SIZE
* has changed (or force).
*/

if (parent && parentItemWidget.id) {
var piw = WT.$(parentItemWidget.id);
if (piw) {
Expand Down
66 changes: 33 additions & 33 deletions src/js/StdGridLayoutImpl2.min.js

Large diffs are not rendered by default.

69 changes: 42 additions & 27 deletions src/js/WCartesianChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,20 +308,23 @@ WT_DECLARE_WT_MEMBER
var seriesSelectionTimeout = null;
var lastDate = null;

var tooltipTimeout = null;
var tooltipPosition = null;
var tooltipOuterDiv = null;
var tooltipEl = null;
var tobj = jQuery.data(widget, 'tobj');
if (!tobj) {
tobj = {};
jQuery.data(widget, 'tobj', tobj);
}

function hideTooltip() {
if (tooltipTimeout) {
clearTimeout(tooltipTimeout);
tooltipTimeout = null;
if (!tobj)
return; // TODO(Roel): is this a bug?
if (tobj.tooltipTimeout) {
clearTimeout(tobj.tooltipTimeout);
tobj.tooltipTimeout = null;
}
if (tooltipOuterDiv) {
document.body.removeChild(tooltipOuterDiv);
tooltipEl = null;
tooltipOuterDiv = null;
if (tobj.tooltipOuterDiv) {
document.body.removeChild(tobj.tooltipOuterDiv);
tobj.tooltipEl = null;
tobj.tooltipOuterDiv = null;
}
}

Expand Down Expand Up @@ -428,6 +431,11 @@ WT_DECLARE_WT_MEMBER

function repaint() {
hideTooltip();
if (hasToolTips() && tobj.tooltipPosition) {
tobj.tooltipTimeout = setTimeout(function() {
loadTooltip();
}, TOOLTIP_TIMEOUT);
}
if (!paintEnabled) return;
rqAnimFrameThrottled(function(){
target.repaint();
Expand Down Expand Up @@ -566,28 +574,31 @@ WT_DECLARE_WT_MEMBER
}

function loadTooltip() {
APP.emit(target.widget, "loadTooltip", tooltipPosition[X], tooltipPosition[Y]);
APP.emit(target.widget, "loadTooltip", tobj.tooltipPosition[X], tobj.tooltipPosition[Y]);
}

/* const */ var MouseDistance = 10;

this.updateTooltip = function(contents) {
hideTooltip();
if (contents) {
var toolTipEl = document.createElement('div');
toolTipEl.className = config.ToolTipInnerStyle;
toolTipEl.innerHTML = contents;
if (!tobj.tooltipPosition) {
return;
}
tobj.toolTipEl = document.createElement('div');
tobj.toolTipEl.className = config.ToolTipInnerStyle;
tobj.toolTipEl.innerHTML = contents;

tooltipOuterDiv = document.createElement('div');
tooltipOuterDiv.className = config.ToolTipOuterStyle;
tobj.tooltipOuterDiv = document.createElement('div');
tobj.tooltipOuterDiv.className = config.ToolTipOuterStyle;

document.body.appendChild(tooltipOuterDiv);
tooltipOuterDiv.appendChild(toolTipEl);
document.body.appendChild(tobj.tooltipOuterDiv);
tobj.tooltipOuterDiv.appendChild(tobj.toolTipEl);
var c = WT.widgetPageCoordinates(target.canvas);

var x = tooltipPosition[X] + c.x;
var y = tooltipPosition[Y] + c.y;
WT.fitToWindow(tooltipOuterDiv, x + MouseDistance, y + MouseDistance,
var x = tobj.tooltipPosition[X] + c.x;
var y = tobj.tooltipPosition[Y] + c.y;
WT.fitToWindow(tobj.tooltipOuterDiv, x + MouseDistance, y + MouseDistance,
x - MouseDistance, y - MouseDistance);
}
}
Expand All @@ -603,8 +614,8 @@ WT_DECLARE_WT_MEMBER
if (!isPointInRect(c, configArea())) return;

if (hasToolTips()) {
tooltipPosition = [c.x,c.y];
tooltipTimeout = setTimeout(function() {
tobj.tooltipPosition = [c.x,c.y];
tobj.tooltipTimeout = setTimeout(function() {
loadTooltip();
}, TOOLTIP_TIMEOUT);
}
Expand Down Expand Up @@ -772,7 +783,9 @@ WT_DECLARE_WT_MEMBER
APP.emit(target.widget, 'seriesSelected', dragPreviousXY.x, dragPreviousXY.y);
}

touchHandlers.start = function(o, event) {
// fromDoubleTouch: indicates that this start of a touch comes from releasing of a double touch,
// so should not be interpreted for series selection
touchHandlers.start = function(o, event, fromDoubleTouch) {
singleTouch = len(event.touches) === 1;
doubleTouch = len(event.touches) === 2;

Expand All @@ -788,7 +801,9 @@ WT_DECLARE_WT_MEMBER
lastDate = Date.now();
dragPreviousXY = c;
if (mode !== CROSSHAIR_MODE) {
seriesSelectionTimeout = window.setTimeout(seriesSelected, SERIES_SELECTION_TIMEOUT);
if (!fromDoubleTouch) {
seriesSelectionTimeout = window.setTimeout(seriesSelected, SERIES_SELECTION_TIMEOUT);
}
addEventListener('contextmenu', eobj2.contextmenuListener);
}
WT.capture(null);
Expand Down Expand Up @@ -1003,7 +1018,7 @@ WT_DECLARE_WT_MEMBER
}
mode = null;
} else if (singleTouch || doubleTouch)
touchHandlers.start(o, event);
touchHandlers.start(o, event, true);
};

var moveTimeout = null;
Expand Down
Loading

0 comments on commit 2fad170

Please sign in to comment.