Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
johnspackman committed Jul 31, 2024
1 parent 2ca8fd9 commit c6ecd54
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
22 changes: 22 additions & 0 deletions source/class/qxl/datagrid/theme/simple/MAppearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ qx.Theme.define("qxl.datagrid.theme.simple.MAppearance", {
};
}
},

"qxl-datagrid-row": {
style(states) {
let backgroundColor = "qxl-datagrid-row-background-even";
Expand All @@ -78,6 +79,27 @@ qx.Theme.define("qxl.datagrid.theme.simple.MAppearance", {
decorator
};
}
},

"qxl-datagrid-column-header-cell": "widget",

"qxl-datagrid-column-header-cell/sortIcon": {
style(states) {
let icon = null;
/*
if (states.sortAsc) {
icon = qx.theme.tangible.Image.URLS["arrow-up-small"];
} else if (states.sortDesc) {
icon = qx.theme.tangible.Image.URLS["arrow-down-small"];
} else if (states.sortable) {
icon = qx.theme.tangible.Image.URLS["angles-forward"];
}
*/
return {
source: icon,
width: 18
};
}
}
}
});
20 changes: 20 additions & 0 deletions source/class/qxl/datagrid/theme/tangible/MAppearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ qx.Theme.define("qxl.datagrid.theme.tangible.MAppearance", {
};
}
},

"qxl-datagrid-row": {
style(states) {
let backgroundColor = "qxl-datagrid-row-background-even";
Expand All @@ -72,6 +73,25 @@ qx.Theme.define("qxl.datagrid.theme.tangible.MAppearance", {
decorator
};
}
},

"qxl-datagrid-column-header-cell": "widget",

"qxl-datagrid-column-header-cell/sortIcon": {
style(states) {
let icon = null;
if (states.sortAsc) {
icon = qx.theme.tangible.Image.URLS["arrow-up-small"];
} else if (states.sortDesc) {
icon = qx.theme.tangible.Image.URLS["arrow-down-small"];
} else if (states.sortable) {
icon = qx.theme.tangible.Image.URLS["angles-forward"];
}
return {
source: icon,
width: 18
};
}
}
}
});
22 changes: 22 additions & 0 deletions source/class/qxl/datagrid/ui/HeaderRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ qx.Class.define("qxl.datagrid.ui.HeaderRows", {
/** @type{qxl.datagrid.ui.factory.IWidgetFactory} */
__widgetFactory: null,

/**
* @Override
*/
_computeSizeHint() {
let hint = super._computeSizeHint();
let sizesData = this.__sizeCalculator.getSizes();
if (sizesData) {
let height = 0;
for (let rowSizeData of sizesData.rows) {
let left = 0;
if (rowSizeData.rowIndex >= 0) {
continue;
}
height += rowSizeData.height;
}
if (!hint.height || hint.height < height) {
hint.height = height;
}
}
return hint;
},

/**
* Called to update the widgets and synchronise the sizes, creating widgets via the factory
* if required and pooling/disposing of unused widgets
Expand Down

0 comments on commit c6ecd54

Please sign in to comment.