package org.eclipse.swt.custom;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/*******************************************************************************
* 2016-05-09 HyunJong Park paulhj.park@samsung.com
* Modification by S-Core Co., Ltd.
* 1. Move code to OriginalCCombo.java
+ * 2. Adjust the position of the text widget according to the font height.
*/
public class CCombo extends TizenCombo {
public CCombo(Composite parent, int style) {
super(parent, style);
}
+ /* Tizen */
+ // Adjust the position of the text widget according to the font height.
+ /* =====*/
+ @Override
+ public void setFont(Font font) {
+ super.setFont(font);
+ GridLayout gridLayout = new GridLayout(2, false);
+ if (font.getFontData().length < 1) {
+ return;
+ }
+ gridLayout.marginHeight = (super.getTextHeight() - (int) font.getFontData()[0].height) / 2;
+ super.setLayout(gridLayout);
+ }
}