wesnoth/data/gui/widget/chatbox.cfg
Charles Dang 7188781f91 GUI2: made link_aware a per-instance config option rather than per-definition
Back when link awareness was first added (https://github.com/wesnoth/wesnoth/pull/300), this key was added
globally to label definitions alongside link_color. This had the unintended side effect of making *all* labels
link aware, leading to issues such as being able to open a do-you-want-to-open prompt from an instance of the
same ad-infinitum.

This became an active issue after 213453e6cf78371360471ac4d110602aafecd9f3, since now that labels could capture
focus if link_aware was true - which it always was for most labels - labels in toggle panels would always
grab mouse_motion events and no longer allow their parent toggle panels to gain their hovered states. That
appears to be in keeping with the design of GUI2, and a further evaluation of that issue is needed at a later
time. However, the fact remains that almost every single label was marked as link-aware, even when in almost every
case that was not the desired behavior.

This change move the link_aware config option to individual label and scroll_label instances. The following uses
had this explicitly enabled:

- Addon license prompt
- Addon descriptions
- Campaign descriptions
- The Server Info popup
- The chatbox
2020-12-12 03:03:09 +11:00

168 lines
2.7 KiB
INI

#textdomain wesnoth-lib
###
### Definition of a chat area.
###
#define _GUI_ROOM_TAB_BAR
[horizontal_listbox]
id = "room_list"
definition = "default"
horizontal_scrollbar_mode = "never"
vertical_scrollbar_mode = "never"
[list_definition]
[row]
[column]
horizontal_grow = true
[toggle_panel]
definition = "default"
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "room"
definition = "default_small"
[/label]
[/column]
[column]
grow_factor = 0
border = "left"
border_size = 5
[image]
definition = "default"
id = "pending_messages"
label = "lobby/sort-friend.png"
tooltip = _"Messages waiting"
[/image]
[/column]
[column]
grow_factor = 0
horizontal_alignment = "right"
border = "right"
border_size = 5
[button]
id = "close_window"
definition = "close"
label = _ "Close"
[/button]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/horizontal_listbox]
#enddef
#define _GUI_CHATLOG
[multi_page]
id = "chat_log_container"
definition = "default"
horizontal_scrollbar_mode = "never"
[page_definition]
[row]
grow_factor = 1
[column]
horizontal_grow = true
vertical_grow = true
[scroll_label]
id = "log_text"
definition = "description_small"
vertical_scrollbar_mode = "always"
horizontal_scrollbar_mode = "never"
link_aware = true
[/scroll_label]
[/column]
[/row]
[/page_definition]
[/multi_page]
#enddef
[chatbox_definition]
id = "default"
description = "Mp chatbox"
[resolution]
min_width = 0
min_height = 0
default_width = 0
default_height = 0
max_width = 0
max_height = 0
[background]
[draw]
[/draw]
[/background]
[foreground]
[draw]
[/draw]
[/foreground]
[grid]
[row]
grow_factor = 0
[column]
horizontal_alignment = "left"
{_GUI_ROOM_TAB_BAR}
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = true
vertical_grow = true
{_GUI_CHATLOG}
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_grow = true
vertical_alignment = "bottom"
[text_box]
id = "chat_input"
definition = "default"
max_input_length = 256
[/text_box]
[/column]
[/row]
[/grid]
[/resolution]
[/chatbox_definition]
#undef _GUI_ROOM_TAB_BAR
#undef _GUI_CHATLOG