You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/08/11 05:28:17 UTC
[royale-asjs] branch develop updated: more Jewel DataGrid layout
tuning
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 8b77dd5 more Jewel DataGrid layout tuning
8b77dd5 is described below
commit 8b77dd590b83a725913da07edf825d5d2d6292c7
Author: greg-dove <gr...@gmail.com>
AuthorDate: Tue Aug 11 17:27:58 2020 +1200
more Jewel DataGrid layout tuning
---
.../org/apache/royale/jewel/beads/layouts/DataGridLayout.as | 11 ++++++++---
.../jewel/supportClasses/datagrid/DataGridColumnWidth.as | 10 +++-------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
index 5648141..57fd5f2 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
@@ -199,9 +199,14 @@ package org.apache.royale.jewel.beads.layouts
if (defaultColumnWidth.value) defaultColumnWidth.widthType = DataGridColumnWidth.DEFAULT;
}
// special case when no width is set at all, defaultColumnWidth will be 0
- if (defaultColumnWidth.value == 0 && isDGWidthSizedToContent) {
- defaultColumnWidth.value = 80 ;
- defaultColumnWidth.widthType = DataGridColumnWidth.EXPLICIT_PIXELS;
+ if (defaultColumnWidth.value == 0){
+ if (isDGWidthSizedToContent || (100 - explicitPercents <= 0)) {
+ defaultColumnWidth.value = 80;
+ defaultColumnWidth.widthType = DataGridColumnWidth.EXPLICIT_PIXELS;
+ } else {
+ defaultColumnWidth.value = (100 - explicitPercents) / denominatorInst.value;
+ defaultColumnWidth.widthType = DataGridColumnWidth.EXPLICIT_PERCENT;
+ }
}
}
}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnWidth.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnWidth.as
index 2914586..7b3ca77 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnWidth.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnWidth.as
@@ -95,7 +95,7 @@ package org.apache.royale.jewel.supportClasses.datagrid {
if (isPercent() && denominator && denominator.value > 0){
var assigned:Number = uint(_value);//value/100 * denominator.value;
targetElement.style['flex'] = assigned + ' ' + assigned + ' 0px';
- targetElement.style['minWidth'] = '';
+ targetElement.style['minWidth'] = '0';
targetElement.style['maxWidth'] = '';
content.width = NaN;
} else if (isPixel()) {
@@ -107,7 +107,7 @@ package org.apache.royale.jewel.supportClasses.datagrid {
content.width = NaN;
if (_value) {
targetElement.style['flex'] = '0 1 ' + _value +'px';
- targetElement.style['minWidth'] = '';
+ targetElement.style['minWidth'] = '0';
targetElement.style['maxWidth'] = '';
} else {
targetElement.style['flex'] = '';
@@ -140,11 +140,7 @@ package org.apache.royale.jewel.supportClasses.datagrid {
_value = orig;
}
targetElement.style['paddingRight'] = offset + 'px'
-
- /*} else {
- console.log('todo...investigate rightmost');
- }*/
-
+
}