#######################################
# Modify this file at your own peril. #
#######################################
# Best syntax highlighting: Ruby, Applescript, Graphviz

# Root node, use this to pad the window's edge.
padding:udlr 8

	# Window controls and top bar.
	type:WINDOW_TOP_BAR, stretch:x, solo, margin:udlr 4
		type:WINDOW_MOVE, class:WINDOW_MOVE, stretch:xr, center_content:y
#			type:PROGRAM_ICON, icon:PROGRAM_ICON, center_on_row, mouse_pass_through:self
#			type:MAIN_MENU_TOGGLE, class:TOGGLE, margin:lr 8, button_pad, center_on_row, mouse_pass_through:self, text:"Menu"
			type:MAIN_MENU_TOGGLE, class:TOGGLE, icon:PROGRAM_ICON, margin:lr 8, padding:ud 2 lr 3, center_on_row, no_text_fade
			type:PROGRAM_NAME, margin:lr 8, center_on_row, mouse_pass_through:self
			type:PROGRAM_VERSION_NUMBER, margin:lr 8, center_on_row, mouse_pass_through:self
			class:TOP_INFO, margin:lr 8, center_on_row, mouse_pass_through:group
				icon:INFO_MOUSE_POS, icon_button_pad, margin:l 8, center_on_row, mouse_pass_through:self
				type:CURSOR_POS, padding:u 5 d 4 l 4 r 8, center_on_row, mouse_pass_through:self
			class:TOP_INFO, margin:l 8, center_on_row, mouse_pass_through:group
				icon:INFO_SELECTION_RECT, icon_button_pad, center_on_row, mouse_pass_through:self
				type:SELECTION_RECT, padding:u 5 d 4 l 4 r 8, center_on_row, mouse_pass_through:self
			class:TOP_INFO, margin:l 8, center_on_row, mouse_pass_through:group
				icon:INFO_ZOOM, icon_button_pad, center_on_row, mouse_pass_through:self
				type:CANVAS_ZOOM, padding:u 5 d 4 l 4 r 8, center_on_row, mouse_pass_through:self
			type:CANVAS_ZOOM_MINUS, class:BUTTON, icon:MINUS, icon_button_pad, center_on_row
			type:CANVAS_ZOOM_PLUS, class:BUTTON, icon:PLUS, icon_button_pad, center_on_row
			type:CANVAS_ZOOM_1_1, class:BUTTON, icon:ZOOM_1_1, icon_button_pad, center_on_row
#			icon:INFO_SELECTION_SIZE, icon_button_pad, center_on_row, mouse_pass_through:self
#			type:FILE_SAVE_TIMER, class:TOP_INFO, margin:udlr 8, mouse_pass_through:self, tooltip:"File has been open for this amount of time without being saved."
			class:TOP_INFO, margin:lr 8, center_on_row, mouse_pass_through:group
				icon:INFO_CANVAS_SIZE, icon_button_pad, margin:l 8, center_on_row, mouse_pass_through:self
				type:FILE_DIMENSIONS, margin:r 8, padding:u 5 d 4 l 4 r 8, center_on_row, mouse_pass_through:self
			type:FILE_NAME, margin:lr 8, center_on_row, mouse_pass_through:self
		type:WINDOW_ALWAYS_ON_TOP, class:TOGGLE, icon:WINDOW_ALWAYS_ON_TOP, center_on_row, margin:udlr 4, tooltip:"Always on top.\nIf enabled, the window will stay on top of other windows."
		type:WINDOW_MINIMIZE, class:TOGGLE, icon:WINDOW_MINIMIZE
		type:WINDOW_WINDOWIZE, class:TOGGLE, icon:WINDOW_WINDOWIZE
		type:WINDOW_MAXIMIZE, class:TOGGLE, icon:WINDOW_MAXIMIZE
		type:WINDOW_FULLSCREEN, class:TOGGLE, icon:WINDOW_FULLSCREEN
		type:WINDOW_CLOSE, class:BUTTON, icon:WINDOW_CLOSE, margin:udlr 4

	# Top settings bar.
	type:TOP_BAR, class:TOP_BAR, padding:udlr 8, stretch:x, solo
		# Color sliders.
		class:TOP_BOX, box_margin
			generic_margin, solo, tooltip:"Hue in a HSL scale."
				type:GRADIENT_HUE, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_HUE, class:INPUT, input_pad, center_on_row
			generic_margin, solo, tooltip:"Saturation in a HSL scale."
				type:GRADIENT_SATURATION, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_SATURATION, class:INPUT, input_pad, center_on_row
			generic_margin, solo, tooltip:"Lightness in a HSL scale."
				type:GRADIENT_LIGHTNESS, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_LIGHTNESS, class:INPUT, input_pad, center_on_row
		class:TOP_BOX, box_margin
			generic_margin, solo, tooltip:"Red in an RGB scale."
				type:GRADIENT_RED, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_RED, class:INPUT, input_pad, center_on_row
			generic_margin, solo, tooltip:"Green in an RGB scale."
				type:GRADIENT_GREEN, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_GREEN, class:INPUT, input_pad, center_on_row
			generic_margin, solo, tooltip:"Blue in an RGB scale."
				type:GRADIENT_BLUE, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_BLUE, class:INPUT, input_pad, center_on_row
		class:TOP_BOX, box_margin
			generic_margin, solo, tooltip:"HEX color.\n8-letter hex: RRGGBBAA (every 2 letters corresponds to Red, Green, Blue, and Alpha)\n6-letter hex: RRGGBB (same as 8-letter hex except without Alpha)\n4-letter hex: RGBA (same as 8-letter hex except each character is repeated, for example 0A5F is the same as 00AA55FF)\n3-letter hex: RGB (same as 4-letter hex, except without Alpha)\n\nWhile regular numbers are \"base-10\" and go from 0 to 9, hex colors are \"base-16\" and go from 0 to F (darkest to brightest):\n0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F\nSimilar to how a number increases from 09 to 10, hex value increases from 0F to 10."
				type:INPUT_HEX, class:INPUT, input_pad, center_on_row
			generic_margin, solo, tooltip:"Alpha (transparency/opacity)."
				type:GRADIENT_ALPHA, class:GRADIENT, w:60, h:20, padding:ud 2, center_on_row
				type:INPUT_ALPHA, class:INPUT, input_pad, center_on_row
			generic_margin, solo
				type:TOGGLE_REPLACE_ALPHA, class:TOGGLE, button_pad, generic_margin, center_on_row, text:"Replace alpha", tooltip:"If enabled, transparent color will be replace canvas pixels.\nIf disabled, transparent color will blend on top of canvas pixels."
#		class:TOP_BOX, box_margin
#			type:BUTTON_COLOR_OPTIONS, class:BUTTON, icon:COLOR, icon_button_pad, generic_margin, solo
#			type:BUTTON_PATTERN_OPTIONS, class:BUTTON, icon:PATTERN, icon_button_pad, generic_margin, solo
#			type:BUTTON_COLOR_OPTIONS, class:BUTTON, icon:SWATCHES, icon_button_pad, generic_margin, solo
#		class:SEPARATOR, box_margin, w:1, stretch:r
		# Swatches.
		class:TOP_BOX, box_margin
			type:SWATCH_LIST, class:SWATCH_LIST, padding:udlr 1, generic_margin, tooltip:"Color swatches.\nLeft click to select Color1, right click to select Color2.\nHold CTRL to overwrite the swatch with the active color."
		class:SEPARATOR, box_margin, w:1, stretch:r
		# Foreground/background color.
		class:TOP_BOX, box_margin, stretch:r
			type:BUTTON_COLOR1, class:TOGGLE, stretch:y, generic_margin, padding:ulr 6 d 2, tooltip:"Color1 [1], left click to draw with this color."
				type:BUTTON_COLOR1_RECT, w:30, stretch:xy, margin:udlr 2, mouse_pass_through:self
				solo, text:"Color1", mouse_pass_through:self
			type:BUTTON_COLOR2, class:TOGGLE, stretch:y, generic_margin, padding:ulr 6 d 2, tooltip:"Color2 [2], right click to draw with this color."
				type:BUTTON_COLOR2_RECT, w:30, stretch:xy, margin:udlr 2, mouse_pass_through:self
				solo, text:"Color2", mouse_pass_through:self
			type:BUTTON_SWAP_COLORS, class:BUTTON, icon:SWAP_COLORS, stretch:x, icon_button_pad, generic_margin, break_before, tooltip:"Swap colors [X]."
		class:SEPARATOR, box_margin, w:1, stretch:r
		# Tools.
		class:TOP_BOX, box_margin
			generic_margin, solo
				type:TOOL_BRUSH, class:TOGGLE, icon:TOOL_BRUSH, no_text_fade, icon_button_pad, generic_margin, tooltip:"Brush [B]."
				type:TOOL_AIR_BRUSH, class:TOGGLE, icon:TOOL_AIR_BRUSH, no_text_fade, icon_button_pad, generic_margin, tooltip:"Air brush [A]."
				type:TOOL_ERASER, class:TOGGLE, icon:TOOL_ERASER, no_text_fade, icon_button_pad, generic_margin, tooltip:"Eraser [E].\nIf transparency is enabled, will erase pixels (set alpha to 0).\nIf transparency is disabled, will paint with Color2.\nUse right mouse to replace Color1 with Color2.\nHold [Alt] to restore erased pixels (set alpha to 255)."
				type:TOOL_FILL, class:TOGGLE, icon:TOOL_FILL, no_text_fade, icon_button_pad, generic_margin, tooltip:"Paint bucket fill [F]."
			generic_margin, solo
#				type:TOOL_GRADIENT, class:TOGGLE, no_text_fade, icon:TOOL_GRADIENT, icon_button_pad, generic_margin, tooltip:"Gradient [G]."
#				type:TOOL_TEXT, class:TOGGLE, no_text_fade, icon:TOOL_TEXT, icon_button_pad, generic_margin, tooltip:"Text [T]."
				type:TOOL_ZOOM, class:TOGGLE, no_text_fade, icon:TOOL_ZOOM, icon_button_pad, generic_margin, tooltip:"Zoom.\nLeft click to zoom in, right click to zoom out.\nYou can also zoom with any tool by using the mouse wheel."
				type:TOOL_PAN, class:TOGGLE, no_text_fade, icon:TOOL_PAN, icon_button_pad, generic_margin, tooltip:"Pan (move canvas).\nYou can also pan with any tool by holding [Space], or clicking and dragging with middle mouse.\nYou can also move with the scroll wheel vertically by holding [Shift], and horizontally by holding [Ctrl]."
			generic_margin, solo
				type:TOOL_COLOR_PICKER, class:TOGGLE, no_text_fade, icon:TOOL_COLOR_PICKER, icon_button_pad, generic_margin, tooltip:"Color picker.\nYou can also pick a color with any tool by holding [Z]."
				type:TOOL_SELECT_RECT, class:TOGGLE, no_text_fade, icon:TOOL_SELECT_RECT, icon_button_pad, generic_margin, tooltip:"Rectangle selection.\nHold [Shift] to add to selection, hold [Alt] to remove.\nHold [xxx] to maintain 1:1 aspect ratio.\n\nPress [Ctrl]+[A] to select the entire canvas.\nRight click, press [Esc], or press [Ctrl]+[Shift]+[A] to remove selection."
				type:TOOL_SELECT_OUTLINE, class:TOGGLE, no_text_fade, icon:TOOL_SELECT_OUTLINE, icon_button_pad, generic_margin, tooltip:"Outline selection (lasso).\nHold [Shift] to add to selection, hold [Alt] to remove.\n\nPress [Ctrl]+[A] to select the entire canvas.\nRight click, press [Esc], or press [Ctrl]+[Shift]+[A] to remove selection."
				type:TOOL_SELECT_FILL, class:TOGGLE, no_text_fade, icon:TOOL_SELECT_FILL, icon_button_pad, generic_margin, tooltip:"Fill selection (magic wand).\nHold [Shift] to add to selection, hold [Alt] to remove.\n\nPress [Ctrl]+[A] to select the entire canvas.\nRight click, press [Esc], or press [Ctrl]+[Shift]+[A] to remove selection."
		class:SEPARATOR, box_margin, w:1, stretch:r
		# Tool settings.
		type:BRUSH_SETTINGS, class:TOP_BOX, box_margin
			generic_margin, solo, text:"Brush settings"
			generic_margin, solo
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:1
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:2
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:3
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:5
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:9
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:15
				type:BUTTON_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:25
		type:AIR_BRUSH_SETTINGS, class:TOP_BOX, box_margin
			generic_margin, solo, text:"Air brush settings"
			generic_margin, solo
				type:BUTTON_AIR_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:5
				type:BUTTON_AIR_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:9
				type:BUTTON_AIR_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:17
				type:BUTTON_AIR_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:25
				type:BUTTON_AIR_BRUSH_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:39
				generic_margin, solo, tooltip:"This is how many pixels are sprayed at once."
					text:"Density:", generic_margin, center_on_row
					type:INPUT_AIR_BRUSH_DENSITY, class:INPUT, input_pad, generic_margin, center_on_row
					type:BUTTON_AIR_BRUSH_DENSITY_MINUS, class:BUTTON, icon:MINUS, icon_button_pad, center_on_row
					type:BUTTON_AIR_BRUSH_DENSITY_PLUS, class:BUTTON, icon:PLUS, icon_button_pad, center_on_row
		type:ERASER_SETTINGS, class:TOP_BOX, box_margin
			generic_margin, solo, text:"Eraser settings"
			generic_margin, solo
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:1
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:2
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:3
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:5
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:9
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:15
				type:BUTTON_ERASER_SIZE, class:TOGGLE, generic_margin, padding:udlr 2, w:17, h:17, value:25
		type:FILL_SETTINGS, class:TOP_BOX, box_margin
			generic_margin, solo, text:"Fill settings"
			generic_margin, solo
				type:TOGGLE_FILL_CONTIGUOUS, class:TOGGLE, button_pad, generic_margin, text:"Contiguous", tooltip:"If enabled, only pixels that are connected to the first pixel will be filled.\nIf disabled, all pixels on the canvas that have the same color will be filled."
				generic_margin, solo, tooltip:"How precisely pixel colors are checked.\nFor example, if tolerance is 10 and you click a pixel with Red value of 100, any Red value between 90 and 110 will be included in the fill.\nIf tolerance is 0, only exact color matches are included.\nPixel RGB values go from 0 to 255, so at tolerance 255 all pixels would be filled."
					text:"Tolerance:", generic_margin, center_on_row
					type:INPUT_FILL_TOLERANCE, class:INPUT, input_pad, generic_margin
		type:SELECT_RECT_SETTINGS, class:TOP_BOX, box_margin
		type:SELECT_OUTLINE_SETTINGS, class:TOP_BOX, box_margin
		type:SELECT_FILL_SETTINGS, class:TOP_BOX, box_margin
			generic_margin, solo, text:"Fill selection settings"
			generic_margin, solo
				type:TOGGLE_SELECT_FILL_CONTIGUOUS, class:TOGGLE, button_pad, generic_margin, text:"Contiguous", tooltip:"If enabled, only pixels that are connected to the first pixel will be selected.\nIf disabled, all pixels on the canvas that have the same color will be selected."
				generic_margin, solo, tooltip:"How precisely pixel colors are checked.\nFor example, if tolerance is 10 and you click a pixel with Red value of 100, any Red value between 90 and 110 will be included in the selection.\nIf tolerance is 0, only exact color matches are included.\nPixel RGB values go from 0 to 255, so at tolerance 255 all pixels would be selected."
					text:"Tolerance:", generic_margin, center_on_row
					type:INPUT_SELECT_FILL_TOLERANCE, class:INPUT, input_pad, generic_margin

	# Canvas.
	type:CANVAS, class:CANVAS, stretch:xy, solo

	# Opens from the button at top-left of the window.
	type:MAIN_MENU_POPUP, class:POPUP, padding:udlr 1, floating, reset_tooltip
		class:POPUP_SECT, padding:udlr 16, stretch:r
			generic_margin, solo, text:"Save new file:"
			type:SAVE_BUTTONS_CONTAINER, generic_margin, solo
			class:SEPARATOR, h:1, margin:udlr 10, stretch:x, solo
			type:BUTTON_SAVE_OVERWRITE, class:BUTTON, button_pad, generic_margin, tooltip:"Overwrite the file is currently open."
				mouse_pass_through:self, solo, text:"Save and replace current file:"
				type:FILE_NAME, mouse_pass_through:self
		class:POPUP_SECT, padding:udlr 16, stretch:r
			type:NOT_SAVED_WARNING, margin:d 10, padding:u 7 d 6 lr 10, solo, text:"WARNING: current image has not been saved."
			type:BUTTON_OPEN_NEW, class:BUTTON, button_pad, generic_margin, text:"New canvas", tooltip:"Erase the current canvas and start a new one."
			class:SEPARATOR, h:1, margin:udlr 10, stretch:x, solo
			type:BUTTON_OPEN_RELOAD, class:BUTTON, button_pad, generic_margin, tooltip:"Reload the current file, reverting all unsaved changes."
				mouse_pass_through:self, solo, text:"Reload current file:"
				type:FILE_NAME, mouse_pass_through:self
			class:SEPARATOR, h:1, margin:udlr 10, stretch:x, solo
			type:BUTTON_OPEN_FILE, class:BUTTON, button_pad, generic_margin, text:"Open file...", tooltip:"Browse for a file to open.\nNote: you can also open a file by dragging and dropping it into the window."
			generic_margin, solo, text:"Open a recently saved file:"
			type:RECENT_FILES_CONTAINER, generic_margin, solo
#		class:POPUP_SECT, padding:udlr 16, stretch:r
#			text:"TFF Paint is free software.\nFor updates and source code, visit\nhttps://sundee.neocities.org/tffpaint"

	# Shows up when you hover over an node with a tooltip.
	type:TOOLTIP, class:POPUP, floating, padding:ud 8 lr 10, mouse_pass_through:self

	# Handles for resizing the window.
	type:WINDOW_SCALE_LEFT, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_RIGHT, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_TOP, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_BOTTOM, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_TOP_LEFT, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_TOP_RIGHT, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_BOTTOM_LEFT, class:WINDOW_SCALE_HANDLE, floating
	type:WINDOW_SCALE_BOTTOM_RIGHT, class:WINDOW_SCALE_HANDLE, floating