0ad/binaries/data/mods/mod/gui/common/modern/styles.xml
Vantha 8a2a450686 Align text as usual if the scrollbar is invisible
Previously, while `scrollbar` was set to true, the text was always
vertically aligned to the top, no matter what its `text_valign` was, by
the scrolling logic. However, this was done even when the text's caption
was so short that no scrollbar was required in the first place (and not
rendered). Falling back to the specified `text_valign` value in that case
instead seems like the expected behavior.

On a few occasions in the GUI, the text was supposed to be aligned to
the top in either case, but still set `text_valign` to a different value
(for whatever reason), which didn't have any effect previously. But
now since it does, the values have to be corrected to specify what is
actually desired.
2026-04-06 21:39:18 +02:00

204 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<styles>
<!--
==========================================
- DEFAULT STYLE: The style with the name 'default' is special, it will
- be called by every object before any other style is loaded.
==========================================
Note that the default z value is determined by GUI engine regardless of what is specified here.
-->
<style name="default"
absolute="false"
enabled="true"
ghost="false"
hidden="false"
size="0 0 100% 100%"
font="sans-14"
buffer_zone="5"
/>
<style name="ModernWindow"
sprite="ModernWindow"
/>
<style name="ModernDialog"
sprite="ModernDialog"
/>
<style name="ModernList"
buffer_zone="5"
font="sans-bold-stroke-14"
scrollbar="true"
scrollbar_style="ModernScrollBar"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxBottomGold"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
textcolor="white"
textcolor_selected="white"
text_align="left"
sound_selected="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernSortedList"
buffer_zone="5"
font="sans-bold-stroke-14"
scrollbar="true"
scrollbar_style="ModernScrollBar"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxBottomGold"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
sprite_heading="ModernDarkBoxGoldNoBottom"
sprite_asc="ModernArrowUp"
sprite_desc="ModernArrowDown"
sprite_not_sorted="ModernNotSorted"
textcolor="white"
textcolor_selected="white"
text_align="left"
sound_selected="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernDropDown"
dropdown_buffer="1"
font="sans-bold-14"
textcolor="white"
text_align="left"
text_valign="center"
button_width="16"
sprite="ModernDarkBox"
sprite_disabled="ModernDarkBoxDisabled"
sprite_overlay="ModernDarkBoxGoldBorder"
sprite_overlay_disabled="ModernDarkBoxGoldBorderDisabled"
sprite2="ModernDropDownArrow"
sprite2_disabled="ModernDropDownArrowDisabled"
sprite2_pressed="ModernDropDownArrowHighlight"
buffer_zone="8"
dropdown_size="440"
minimum_visible_items="3"
sprite_list="GrayBackground"
sprite_list_overlay="BlackBorder"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
textcolor_selected="white"
textcolor_disabled="140 140 140 255"
scrollbar="true"
scrollbar_style="ModernScrollBar"
sound_opened="audio/interface/ui/ui_button_click.ogg"
sound_closed="audio/interface/ui/ui_button_click.ogg"
sound_selected="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernLabelText"
font="sans-bold-stroke-14"
textcolor="white"
textcolor_disabled="140 140 140 255"
text_align="center"
text_valign="center"
/>
<style name="ModernRightLabelText"
font="sans-bold-stroke-14"
textcolor="white"
textcolor_disabled="140 140 140 255"
text_align="right"
text_valign="center"
/>
<style name="ModernLeftLabelText"
font="sans-bold-stroke-14"
textcolor="white"
textcolor_disabled="140 140 140 255"
text_align="left"
text_valign="center"
/>
<style name="ModernTopLabelText"
font="sans-bold-stroke-14"
textcolor="white"
text_align="center"
text_valign="top"
/>
<style name="ModernLeftTopLabelText"
font="sans-bold-stroke-14"
textcolor="white"
text_align="left"
text_valign="top"
/>
<style name="ModernText"
font="sans-14"
textcolor="white"
text_align="left"
text_valign="top"
scrollbar="true"
scrollbar_style="ModernScrollBar"
/>
<style name="ModernTextPanel"
buffer_zone="8"
scrollbar="true"
scrollbar_style="ModernScrollBar"
textcolor="white"
text_align="left"
text_valign="top"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxGoldBorder"
/>
<style name="ModernInput"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxGoldBorder"
sprite_selectarea="color:150 0 0"
textcolor="white"
textcolor_selected="white"
placeholder_color="gray"
/>
<style name="ModernTickBox"
sprite="ModernTickOff"
sprite2="ModernTickOn"
sprite_disabled="ModernTickDisabledOff"
sprite2_disabled="ModernTickDisabledOn"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernSlider"
sprite="ModernSliderButton"
sprite_disabled="ModernSliderButtonDisabled"
sprite_bar="ModernSliderLine"
sprite_bar_disabled="ModernSliderLineDisabled"
button_width="20"
tooltip_style="tooltipInstant"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernButtonRed"
sprite="ModernButtonRed"
sprite_disabled="ModernButtonRedDisabled"
sprite_over="ModernButtonRedOver"
sprite_pressed="ModernButtonRed"
font="sans-bold-stroke-14"
textcolor="white"
textcolor_disabled="210 210 210 160"
text_align="center"
text_valign="center"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernProgressBarBackground"
sprite="ModernProgressBarBackground"
/>
<style name="ModernProgressBar"
sprite_bar="ModernProgressBar"
size="3 0 100%-3 100%"
/>
<style name="ModernProgressBarText"
font="sans-stroke-14"
textcolor="white"
text_align="center"
text_valign="center"
/>
<style name="ModernTabButtonHorizontal"
sprite="ModernTabHorizontalBackground"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernTabButtonVertical"
sprite="ModernTabVerticalBackground"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernChart"
axis_color="209 174 132 255"
axis_width="2"
buffer_zone="4"
font="sans-stroke-14"
format_x="DECIMAL2"
format_y="DECIMAL2"
text_align="left"
/>
</styles>