mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 04:07:42 +08:00
PL-8224 Table headers are shifted when Windows "Scale factor" is 125%
This commit is contained in:
parent
c9bb092d3e
commit
8073eb5781
@ -300,6 +300,16 @@ public class CubaGroupTableWidget extends CubaScrollTableWidget {
|
||||
return super.handleNavigation(keycode, ctrl, shift);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isGenericRow(Widget rowWidget) {
|
||||
return super.isGenericRow(rowWidget) && !(rowWidget instanceof CubaGroupTableBody.CubaGroupTableGroupRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCustomColumn(int colIndex) {
|
||||
return GROUP_DIVIDER_COLUMN_KEY.equals(getColKeyByIndex(colIndex));
|
||||
}
|
||||
|
||||
public CubaGroupTableBody.CubaGroupTableGroupRow getRenderedGroupRowByKey(String key) {
|
||||
if (scrollBody != null) {
|
||||
final Iterator<Widget> it = scrollBody.iterator();
|
||||
|
@ -42,6 +42,7 @@ import com.vaadin.client.ui.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.haulmont.cuba.web.toolkit.ui.client.Tools.isAnyModifierKeyPressed;
|
||||
@ -238,6 +239,36 @@ public class CubaScrollTableWidget extends VScrollTable implements ShortcutActio
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void reassignHeaderCellWidth(int colIndex, HeaderCell hcell, int minWidth) {
|
||||
if (isCustomColumn(colIndex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Widget rowWidget : ((CubaScrollTableBody) scrollBody).getRenderedRows()) {
|
||||
if (isGenericRow(rowWidget)) {
|
||||
VScrollTableBody.VScrollTableRow row = (VScrollTableBody.VScrollTableRow) rowWidget;
|
||||
|
||||
double realColWidth = row.getRealCellWidth(colIndex);
|
||||
if (realColWidth > 0) {
|
||||
if (realColWidth > minWidth) {
|
||||
hcell.setWidth(realColWidth + "px");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isCustomColumn(int colIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isGenericRow(Widget rowWidget) {
|
||||
return rowWidget instanceof VScrollTableBody.VScrollTableRow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAdditionalRowsHeight() {
|
||||
if (aggregationRow != null) {
|
||||
@ -867,6 +898,10 @@ public class CubaScrollTableWidget extends VScrollTable implements ShortcutActio
|
||||
profilerMarker = ScreenClientProfiler.getInstance().getProfilerMarker();
|
||||
super.renderInitialRows(rowData, firstIndex, rows);
|
||||
}
|
||||
|
||||
public LinkedList<Widget> getRenderedRows() {
|
||||
return renderedRows;
|
||||
}
|
||||
}
|
||||
|
||||
public void requestFocus(final String itemKey, final String columnKey) {
|
||||
|
@ -43,6 +43,7 @@ import com.vaadin.client.ui.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.haulmont.cuba.web.toolkit.ui.client.Tools.isAnyModifierKeyPressed;
|
||||
@ -372,6 +373,28 @@ public class CubaTreeTableWidget extends VTreeTable implements ShortcutActionHan
|
||||
return rowRequestHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void reassignHeaderCellWidth(int colIndex, HeaderCell hcell, int minWidth) {
|
||||
for (Widget rowWidget : ((CubaTreeTableWidget.CubaTreeTableBody) scrollBody).getRenderedRows()) {
|
||||
if (isGenericRow(rowWidget)) {
|
||||
VScrollTableBody.VScrollTableRow row = (VScrollTableBody.VScrollTableRow) rowWidget;
|
||||
|
||||
double realColWidth = row.getRealCellWidth(colIndex);
|
||||
if (realColWidth > 0) {
|
||||
if (realColWidth > minWidth) {
|
||||
hcell.setWidth(realColWidth + "px");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isGenericRow(Widget rowWidget) {
|
||||
return rowWidget instanceof VScrollTableBody.VScrollTableRow;
|
||||
}
|
||||
|
||||
protected class CubaTreeTableTableHead extends TableHead {
|
||||
|
||||
protected final SimplePanel presentationsEditIcon = GWT.create(SimplePanel.class);
|
||||
@ -826,6 +849,10 @@ public class CubaTreeTableWidget extends VTreeTable implements ShortcutActionHan
|
||||
profilerMarker = ScreenClientProfiler.getInstance().getProfilerMarker();
|
||||
super.renderInitialRows(rowData, firstIndex, rows);
|
||||
}
|
||||
|
||||
public LinkedList<Widget> getRenderedRows() {
|
||||
return renderedRows;
|
||||
}
|
||||
}
|
||||
|
||||
protected void showContextMenuPopup(int left, int top) {
|
||||
|
Loading…
Reference in New Issue
Block a user