This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 6b03a5ed3e issue #7220 : dialogs are sized too large when a table view 
has many items (#7370)
6b03a5ed3e is described below

commit 6b03a5ed3e5cb1291fc8d2ffa02fa3be77091271
Author: Matt Casters <[email protected]>
AuthorDate: Tue Jun 30 09:18:37 2026 +0200

    issue #7220 : dialogs are sized too large when a table view has many items 
(#7370)
---
 .../java/org/apache/hop/ui/core/widget/TableView.java     | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java 
b/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java
index cbda66fef5..fe29824a04 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java
@@ -114,6 +114,9 @@ public class TableView extends Composite {
   /** Default minimum height hint in pixels for all TableView instances. */
   public static final int HEIGHT_HINT_PX = 200;
 
+  /** Default maximum height hint in pixels for all TableView instances. */
+  public static final int HEIGHT_HINT_MAX_PX = 350;
+
   /**
    * Default minimum width hint in pixels for all TableView instances (matches 
typical shell width).
    */
@@ -641,8 +644,16 @@ public class TableView extends Composite {
   @Override
   public Point computeSize(int wHint, int hHint, boolean changed) {
     Point size = super.computeSize(wHint, hHint, changed);
-    if (hHint == SWT.DEFAULT && size.y < HEIGHT_HINT_PX) {
-      size.y = HEIGHT_HINT_PX;
+    double zoomFactor = PropsUi.getNativeZoomFactor();
+    int minHeight = (int) Math.round(HEIGHT_HINT_PX * zoomFactor);
+    int maxHeight = (int) Math.round(HEIGHT_HINT_MAX_PX * zoomFactor);
+
+    if (hHint == SWT.DEFAULT) {
+      if (size.y < minHeight) {
+        size.y = minHeight;
+      } else if (size.y > maxHeight) {
+        size.y = maxHeight;
+      }
     }
     return size;
   }

Reply via email to