package com.topsun.posclient.common.ui.style;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
/**
* @author Dong
*
*/
public class CommonCss {
/**
* 表格行高
*/
public static final int TABLE_HEIGHT = 30;
/**
* 18个像素的黑体字
* @param device
* @return
*/
public static Font getDefaultFont(Device device){
return new Font(device,"微软雅黑", 10, SWT.NONE);
}
public static Font getPlusButtonFont(Device device){
return new Font(device,"微软雅黑", 18, SWT.BOLD);
}
/**
* 表头字体
* @param device
* @return
*/
public static Font getTableHeaderFont(Device device){
return new Font(device,"微软雅黑", 10, SWT.NONE);
}
public static Font getFontForSize(Device device, int size){
return new Font(device,"微软雅黑", size, SWT.NONE);
}
/**
* 获取文本输入框样式
* @param width 指定宽度
* @return
*/
public static GridData getTextData(int width){
if(width == 0){
width = 240;
}
GridData data = new GridData();
data.heightHint = 22;
data.widthHint = width;
return data;
}
/**
* 获取默认文本输入框样式
* @return
*/
public static GridData getDefaultTextData(){
GridData data = new GridData();
data.heightHint = 25;
data.widthHint = 200;
return data;
}
}