package com.approximatrix.draco.application.preferences;

import java.io.ByteArrayOutputStream;

import com.approximatrix.draco.application.ApplicationManager;


public class UIPreferences implements DracoPreferences {

	public static String TAG = "ui";
	
	private static final int MAX_ICON_SIZE=256;
	
	private int iconSize = 32;	
	
	public UIPreferences() {
		if(ApplicationManager.GetIconLibrary() != null)
			iconSize = ApplicationManager.GetIconLibrary().getIconSize().height;
	}
	
	public int getIconSize() {
		return iconSize;
	}

	public void setIconSize(int iconSize) {
		this.iconSize = Math.min(Math.max(iconSize,1),MAX_ICON_SIZE);
	}
	
	public int getMaxIconSize() {
		return MAX_ICON_SIZE;
	}

	public void apply() {
		ApplicationManager.GetIconLibrary().setIconSize(iconSize);
	}

}