Skip to content

GUI enhancements planned for 3.0 #1101

Description

@eruvanos

To enhance the GUI code, a few things have to be cleaned which might break compatibility.
The goal is to collect all these changes within a bigger update like 3.0.

Summary of breaking changes

  • Removed
    • UIWrapper (it is a UILayout)
    • UIBorder (functionality covered in UIWidget)
    • UIPadding (functionality covered in UIWidget)
    • UITexturePane (functionality covered in UIWidget)
  • Renamed
    • Rect (_Rect)
    • Property (_Property)

Working on development

Planned

  • UIWidget supports
    • padding
    • border
    • background color
    • states:
      • visibility,
      • disabled,
      • hover,
      • pressed,
      • maybe use a dict mapping state to style class
  • UIWidgets use observable Property
  • Rect is used as the space representation on screen
  • UILayouts shrink and grow children
    • UIAnchorLayout use min_size_hint of UIBoxLayout
    • UIBoxLayout use size_hint to grow children
    • UIBoxLayout respects size_hint_max while growing
    • UIAnchorLayout use size_hint to grow children
    • UIAnchorLayout respects size_hint_max while growing
  • UILayoutManager use size hints
    • UIManager respects size_hint and size_hint_min
  • UIAnchorLayout should behave like a layout (rect set from outside, place children within bounds)
  • Fix stats_top_left example (fix UILabel not showing text)
  • Refactor UIMessageBox to fit into general event system
  • Support NinePatch
    • Basic support and rendering
    • Use as background in UIWidget
    • Use as texture in UITexturedButton
  • Methods do only contain supported parameters
  • Missing documentation
    • UISlider
  • Replace draw_text with a label
    • UIFlatButton
    • UITexturedButton
  • Fix curser in inputtext
  • Improve UIInputText, expose more pyglet parameters (now exposes text.py as UIInputText.layout)
  • Improve UILabel, expose more pyglet parameters (now exposes pyglet.text.Label as UILabel.layout)
  • New widgets
    • UIGridLayout - Finally arrange widgets within a grid
      • resizes child widgets
    • UITexturedSlider (using images for bar and thumb) ⛈️ freeze on some mac

Small improvements

  • UIWidget
    • resize

Styling <-- WIP

  • UIWidgets provide a state, which they currently are in (normal, hover, press, active, focused, deactivated, ...)
  • document known states
  • provide a static and typed style class on style-able widgets
  • store default style as static variable
  • document styles

Maybe

  • button supporting an icon in front of text

Canceled

Postponed to Arcade 3.1

  • Text Widgets
    • trigger render on text layout changes
  • Improve dev life:
    • Generate state images (press, hover, ...) from a base image
    • Provide NinePatchTextures
  • Widget focus management
    • support focus state
    • manage state in a central place
    • support switching between widgets using tab
    • support defining tab order
  • call do_layout only if "something" changes
  • Support placeholder in text widgets
  • call do_layout only if "something" changes
  • New widgets
    • UIProgressBar
    • UIMenu - a menu like widget, which is at the top/bottom of the screen and provides methods to add sub menus and buttons
    • UIDigitLabel - provides a UILabel explicit for digits (format support, performant updates)
    • UIFile - Choose a file dialogue (crazy but possible) Provide dialogue to choose a file or path #1201
    • TK Listbox (text selection widget, without dropdown)
    • DropDownMenu (contribution from jans#1643)
    • Radio buttons

Suggestions by @pushfoo

  • Rethink our widget hierarchy a little, including making a UINinePatchLayout baseclass to encapsulate 9-patch and anchor layout behavior
  • Add a class UIModal(UINinePatchLayout, UIMouseFilterMixin)
  • Make UIMessageBox and this PR's SubMenu inherit from UIModal
  • Create a views index page to aggregate view & menu tutorials like the shader tutorials index page
  • Split this PR's concerns into a Basic Menu & Advanced Menu tutorial

Metadata

Metadata

Assignees

Labels

guiRelated to arcade GUI (sub module arcade.gui)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions