#textdomain wesnoth-lib
###
### Definition of the window to control gamestate inspector.
###

[window]
	id = "gamestate_inspector"
	description = "Gamestate inspector dialog."

	[resolution]
		definition = "default"
		automatic_placement = "true"
		vertical_placement = "top"
		horizontal_placement = "left"

		[linked_group]
			id = "name"
			fixed_width = "true"
		[/linked_group]

		[linked_group]
			id = "typename"
			fixed_width = "true"
		[/linked_group]

		[tooltip]
			id = "tooltip_large"
		[/tooltip]

		[helptip]
			id = "tooltip_large"
		[/helptip]

		[grid]
			[row] #header
				grow_factor = 0

				[column]
					border = "all"
					border_size = 5
					horizontal_alignment = "left"

					[label]
						definition = "title"
						label = _ "Gamestate Inspector"
					[/label]
				[/column]
			[/row]

			[row] #menu
				grow_factor = 0

				[column]
					grow_factor = 7
					border = "all"
					border_size = 5
					horizontal_alignment = "left"

					[label]
						id="inspector_name"
						definition = "default"
						label= ""
					[/label]
				[/column]
			[/row]

			[row] #stack-title
				grow_factor = 4

				[column]
					grow_factor = 7
					horizontal_grow = "true"
					[grid]
						[row]
							[column]
								vertical_alignment = "top"
								horizontal_alignment = "left"
								[grid]
									[row]
										[column]
											grow_factor = 3
											border = "all"
											border_size = 5
											horizontal_grow = "true"

											[listbox]
												id = "stuff_types_list"
												definition = "default"
												[header]
													[row]
														[column]
															grow_factor = 1
															horizontal_grow = "true"
															border = "all"
															border_size = 5

															[label]
																id = "typename"
																definition = "default"
																linked_group = "typename"

																label = _ "Type"
															[/label]
														[/column]
													[/row]
												[/header]

												[list_definition]
													[row]
														[column]
															vertical_grow = "true"
															horizontal_grow = "true"

															[toggle_panel]
																definition = "default"
																[grid]
																	[row]
																		[column]
																			grow_factor = 1
																			horizontal_grow = "true"

																			border = "all"
																			border_size = 5

																			[label]
																				id = "typename"
																				definition = "default"
																				linked_group = "typename"
																			[/label]
																		[/column]
																	[/row]
																[/grid]
															[/toggle_panel]
														[/column]
													[/row]
												[/list_definition]
											[/listbox]
										[/column]
									[/row]

									[row]
										[column]
											grow_factor = 3
											border = "all"
											border_size = 5
											horizontal_grow = "false"

											[listbox]
												id = "stuff_list"
												definition = "default"
												[header]
													[row]
														[column]
															grow_factor = 1
															horizontal_grow = "true"
															border = "all"
															border_size = 5

															[label]
																id = "name"
																definition = "default"
																linked_group = "name"

																label = _ "Items"
															[/label]
														[/column]
													[/row]
												[/header]

												[list_definition]
													[row]
														[column]
															vertical_grow = "true"
															horizontal_grow = "true"

															[toggle_panel]
																definition = "default"
																[grid]
																	[row]
																		[column]
																			grow_factor = 1
																			horizontal_grow = "true"

																			border = "all"
																			border_size = 5

																			[label]
																				id = "name"
																				definition = "default"
																				linked_group = "name"
																			[/label]
																		[/column]
																	[/row]
																[/grid]
															[/toggle_panel]
														[/column]
													[/row]
												[/list_definition]
											[/listbox]
										[/column]
									[/row]
								[/grid]
							[/column]

							[column]
								grow_factor = 6
								vertical_alignment = "top"
								horizontal_alignment = "left"
								[grid]
									[row]
										[column]
											horizontal_grow = "true"
											[grid]
												[row]
													[column]
														#
														# Emulate the listbox headers' top/bottom padding
														# here relative to the scroll_label below.
														#
														border = "top,left,right"
														border_size = 5
														horizontal_alignment = "left"

														[label]
															definition = "default"
															label = _ "Contents"
														[/label]
													[/column]

													[column]
														border = "top,left,right"
														border_size = 5
														horizontal_alignment = "right"

														[button]
															id = "copy"
															definition = "action_copy"
															label = _ "clipboard^Copy"
															# FIXME: tooltips cause weird interactions with map
															#        labels while running a GUI2 dialog, so let's
															#        not use a tooltip yet.
															#tooltip = _ "Copy this report to clipboard"
														[/button]
													[/column]
												[/row]
											[/grid]
										[/column]
									[/row]
									[row]
										[column]
											border = "left,bottom,right"
											border_size = 5
											horizontal_alignment = "left"

											[scroll_label]
												id = "inspect"
												definition = "default"
											[/scroll_label]
										[/column]
									[/row]
								[/grid]
							[/column]
						[/row]
					[/grid]
				[/column]
			[/row]

			[row] #status
				grow_factor = 0

				[column]
					grow_factor = 0
					border = "all"
					border_size = 5
					horizontal_alignment = "right"
					[button]
						id = "cancel"
						definition = "default"
						label = _ "Close"
					[/button]
				[/column]
			[/row]
		[/grid]
	[/resolution]
[/window]
