Bug 577188 - Layout issue with GridLayout and larger sized widget on Mac
Summary: Layout issue with GridLayout and larger sized widget on Mac
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-10 09:38 EST by Lars Vogel CLA
Modified: 2021-12-02 06:47 EST (History)
2 users (show)

See Also:


Attachments
Screenshot under Windows (6.23 KB, image/png)
2021-11-10 09:38 EST, Lars Vogel CLA
no flags Details
Screenshot under Mac (118.49 KB, image/png)
2021-11-10 10:03 EST, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2021-11-10 09:38:38 EST
Created attachment 287478 [details]
Screenshot under Windows

A Button with a larger font is sized correctly on Windows but not on Mac.
I assume this is a bug, both implementation should behave the same. Windows seems to be correct in its behavior.

I attach the result of the snippet under Windows and Mac.



package org.eclipse.swt.snippets;

/*
 * GridLayout with large sized button
 *
 * For a list of all SWT example snippets see
 * http://www.eclipse.org/swt/snippets/
 *
 */
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Snippet379 {

public static void main (String [] args) {
	var display = new Display ();
	var shell = new Shell (display);
	shell.setText("Snippet 379");
	shell.setLayout(new GridLayout());
	var c = new Composite(shell, SWT.NONE);
	GridLayout layout = new GridLayout(1, false);
	c.setLayout(layout);
	Button b = new Button(c, SWT.PUSH);
	b.setText("Button ");
	FontData fontData = new FontData();
	fontData.height = 80;
	Font font = new Font(display, fontData);
	b.setFont(font);
	shell.setSize(800, 400);
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}

}
Comment 1 Lars Vogel CLA 2021-11-10 10:03:26 EST
Created attachment 287482 [details]
Screenshot under Mac
Comment 2 Lars Vogel CLA 2021-12-02 06:47:56 EST
Lakshmi, can you have a look?