#textdomain wesnoth-lib
###
### Experimental slider variant that does not have a text label since the
### default variant does have one that takes up more space than is strictly
### necessary and I (shadowm) can't deal with all the magic numbers in it.
###

#define _GUI_STATE IMAGE_SUFFIX GROOVE_COLOR
	[draw]

		#
		# Groove
		#

		[line]
			x1 = 0
			y1 = "(height / 2)"
			x2 = "(width - 1)"
			y2 = "(height / 2)"

			color = {GROOVE_COLOR}
			thickness = 1
		[/line]

		#
		# Slider
		#

		[image]
			x = "(positioner_offset)"
			y = "(if (image_height < height, (height - image_height) / 2, 0))"
			name = "buttons/sliders/slider{IMAGE_SUFFIX}"
		[/image]

	[/draw]
#enddef

#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT POSITIONER_LENGTH

	[resolution]

		{RESOLUTION}

		min_width = {MIN_WIDTH}
		min_height = {HEIGHT}

		default_width = {DEFAULT_WIDTH}
		default_height = {HEIGHT}

		max_width = 0
		max_height = {HEIGHT}

		minimum_positioner_length = {POSITIONER_LENGTH}
		maximum_positioner_length = {POSITIONER_LENGTH}

		#text_font_size = 1 # placeholder

		[state_enabled]
			{_GUI_STATE
				".png"
				({GUI__FONT_COLOR_ENABLED__DEFAULT})
			}
		[/state_enabled]

		[state_disabled]
			{_GUI_STATE
				".png~GS()"
				({GUI__FONT_COLOR_DISABLED__DEFAULT})
			}
		[/state_disabled]

		[state_pressed]
			{_GUI_STATE
				"-pressed.png"
				({GUI__FONT_COLOR_ENABLED__DEFAULT})
			}
		[/state_pressed]

		[state_focussed]
			{_GUI_STATE
				"-active.png"
				({GUI__FONT_COLOR_ENABLED__DEFAULT})
			}
		[/state_focussed]

	[/resolution]
#enddef

[slider_definition]
	id = "minimal"
	description = "A slider without a value label."

	# Tiny gui sizes haven't been tested yet so might need some tuning.
	{_GUI_RESOLUTION ({GUI_TINY__RESOLUTION})  75 125 11  8 }
	{_GUI_RESOLUTION ()                       150 250 22 16 }

[/slider_definition]

#undef _GUI_STATE
#undef _GUI_RESOLUTION
