wesnoth/data/gui/widget/addon_list.cfg
Charles Dang c75ca87517 GUI2/Addon List: improved a bunch of stuff related to inline control buttons
* Flipped the arrow on the Update icon set to point downwards, since it's a download operation.
* Renamed existing small Update icon set Publish, and added downwards version to replace Update.
* Renamed all addon manager icons and their respective button definitions to be clearer.
* Moved unused small icon versions to their own subfolder.
* Added separate Publish inline button to image list. This is now used in all cases to publish,
  regardless of whether the addon has been uploaded previously or not. Prior to this, the Install
  button was used for non-published addons, and the Update one for published ones. This means the
* Refactor addon_list inline button setup to be clearer.
* Made inline Uninstall button display in all cases where an addon was installed, instead of just
  INSTALLED and NSTALLED_UPGRADABLE. It will not display if a publishable addon has not been
  published, however.
* Changed is_local check to match the ADDON_INSTALLED_LOCAL_ONLY. I figured this is a bit more
  robust. TODO: do the same in the addon manager itself?

Art assets credit to @Lordbob
2018-02-10 21:26:33 +11:00

595 lines
8.7 KiB
INI

#textdomain wesnoth-lib
###
### Definition of an addon list widget
###
#define _GUI_ADDON_LIST HEADER ROW_DEF
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = true
vertical_grow = true
[listbox]
id = "addons"
definition = "default"
horizontal_scrollbar_mode = "never"
[header]
[row]
grow_factor = 1
{HEADER}
[/row]
[/header]
[list_definition]
[row]
[column]
vertical_grow = true
horizontal_grow = true
[toggle_panel]
## linked_group = "list_item"
id = "list_panel"
definition = "fancy"
[grid]
[row]
{ROW_DEF}
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/listbox]
[/column]
[/row]
[/grid]
#enddef
#define _GUI_ADDON_LIST_HEADER_BASIC
[column]
grow_factor = 1
horizontal_grow = true
[spacer]
linked_group = "icon"
[/spacer]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
[toggle_button]
id = "sort_0"
definition = "listbox_header"
linked_group = "name"
label = _ "Name"
[/toggle_button]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
border = "left"
border_size = 5
[label]
definition = "gold_small"
linked_group = "version"
label = _ "Version"
[/label]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
[toggle_button]
id = "sort_1"
definition = "listbox_header"
linked_group = "author"
label = _ "Author"
[/toggle_button]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
[toggle_button]
id = "sort_2"
definition = "listbox_header"
linked_group = "size"
label = _ "Size"
[/toggle_button]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
[toggle_button]
id = "sort_3"
definition = "listbox_header"
linked_group = "downloads"
label = _ "Downloads"
[/toggle_button]
[/column]
#enddef
#define _GUI_ADDON_LIST_HEADER_TYPE
[column]
grow_factor = 1
horizontal_grow = true
[toggle_button]
id = "sort_4"
definition = "listbox_header"
linked_group = "type"
label = _ "Type"
[/toggle_button]
[/column]
#enddef
#define _GUI_ADDON_LIST_HEADER_CONTROL
[column]
grow_factor = 1
horizontal_grow = true
[spacer]
linked_group = "control_buttons"
[/spacer]
[/column]
#enddef
#define _GUI_ADDON_LIST_CONTENT_BASIC
[column]
horizontal_grow = false
vertical_alignment = "center"
border = "all"
border_size = 5
[drawing]
id = "icon"
definition = "default"
linked_group = "icon"
width = 72
height = 72
[draw]
[image]
name = "(text)"
w = "(min(image_original_width, 72))"
h = "(min(image_original_height, 72))"
{GUI_CENTERED_IMAGE}
[/image]
[/draw]
[/drawing]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
vertical_alignment = "center"
[grid]
[row]
grow_factor = 1
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "name"
definition = "default"
linked_group = "name"
wrap = true
characters_per_line = 20
use_markup = true
[/label]
[/column]
[/row]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "left,right,bottom"
border_size = 5
[label]
id = "installation_status"
definition = "default_small"
linked_group = "name"
use_markup = true
[/label]
[/column]
[/row]
[/grid]
[/column]
[column]
grow_factor = 0
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "version"
definition = "default_small"
linked_group = "version"
use_markup = true
characters_per_line = 10
wrap = true
[/label]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "author"
definition = "default_small"
linked_group = "author"
wrap = true
characters_per_line = 20
[/label]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "size"
definition = "default_small"
linked_group = "size"
wrap = true
[/label]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "downloads"
definition = "default_small"
linked_group = "downloads"
wrap = true
[/label]
[/column]
#enddef
#define _GUI_ADDON_LIST_CONTENT_TYPE
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[label]
id = "type"
definition = "default_small"
linked_group = "type"
wrap = true
[/label]
[/column]
#enddef
#define _GUI_ADDON_LIST_CONTENT_CONTROL
[column]
[grid]
id = "single_install_buttons"
linked_group = "control_buttons"
[row]
[column]
[stacked_widget]
id = "install_update_stack"
definition = "default"
[layer]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[button]
id = "single_install"
definition = "addon_install_small"
tooltip = _ "Install add-on"
[/button]
[/column]
[/row]
[/layer]
[layer]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[button]
id = "single_update"
definition = "addon_update_small"
tooltip = _ "Update add-on"
[/button]
[/column]
[/row]
[/layer]
[layer]
[row]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[button]
id = "single_publish"
definition = "addon_publish_small"
tooltip = _ "Publish add-on"
[/button]
[/column]
[/row]
[/layer]
[/stacked_widget]
[/column]
[column]
grow_factor = 1
horizontal_grow = true
border = "all"
border_size = 5
[button]
id = "single_uninstall"
definition = "addon_uninstall_small"
tooltip = _"Uninstall add-on"
[/button]
[/column]
[/row]
[/grid]
[/column]
#enddef
[addon_list_definition]
id = "default"
description = "List of one or more add-ons."
[resolution]
window_width = 800
[linked_group]
id = "icon"
fixed_width = true
[/linked_group]
[linked_group]
id = "name"
fixed_width = true
[/linked_group]
[linked_group]
id = "version"
fixed_width = true
[/linked_group]
[linked_group]
id = "author"
fixed_width = true
[/linked_group]
[linked_group]
id = "downloads"
fixed_width = true
[/linked_group]
[linked_group]
id = "size"
fixed_width = true
[/linked_group]
{_GUI_ADDON_LIST (
{_GUI_ADDON_LIST_HEADER_BASIC}
) (
{_GUI_ADDON_LIST_CONTENT_BASIC}
)}
[/resolution]
[resolution]
window_width = 900
[linked_group]
id = "icon"
fixed_width = true
[/linked_group]
[linked_group]
id = "name"
fixed_width = true
[/linked_group]
[linked_group]
id = "version"
fixed_width = true
[/linked_group]
[linked_group]
id = "author"
fixed_width = true
[/linked_group]
[linked_group]
id = "downloads"
fixed_width = true
[/linked_group]
[linked_group]
id = "size"
fixed_width = true
[/linked_group]
[linked_group]
id = "control_buttons"
fixed_width = true
[/linked_group]
{_GUI_ADDON_LIST (
{_GUI_ADDON_LIST_HEADER_BASIC}
{_GUI_ADDON_LIST_HEADER_CONTROL}
) (
{_GUI_ADDON_LIST_CONTENT_BASIC}
{_GUI_ADDON_LIST_CONTENT_CONTROL}
)}
[/resolution]
[resolution]
window_width = 1050
[linked_group]
id = "icon"
fixed_width = true
[/linked_group]
[linked_group]
id = "name"
fixed_width = true
[/linked_group]
[linked_group]
id = "version"
fixed_width = true
[/linked_group]
[linked_group]
id = "author"
fixed_width = true
[/linked_group]
[linked_group]
id = "downloads"
fixed_width = true
[/linked_group]
[linked_group]
id = "size"
fixed_width = true
[/linked_group]
[linked_group]
id = "type"
fixed_width = true
[/linked_group]
[linked_group]
id = "control_buttons"
fixed_width = true
[/linked_group]
{_GUI_ADDON_LIST (
{_GUI_ADDON_LIST_HEADER_BASIC}
{_GUI_ADDON_LIST_HEADER_TYPE}
{_GUI_ADDON_LIST_HEADER_CONTROL}
) (
{_GUI_ADDON_LIST_CONTENT_BASIC}
{_GUI_ADDON_LIST_CONTENT_TYPE}
{_GUI_ADDON_LIST_CONTENT_CONTROL}
)}
[/resolution]
[/addon_list_definition]
#undef _GUI_ADDON_LIST