Skip to content

MenuButton Label dissapears when a shortcut is set. #25519

@coppolaemilio

Description

@coppolaemilio

Godot version:
Latest from: https://hugo.pro/projects/godot-builds/ (v3.1.beta.calinou.c21ca98)

OS/device including version:
Windows 10

Issue description:
MenuButton items lose the label when a shortcut is set.

Steps to reproduce:

  1. Create new scene with a Control node as the root
  2. Add MenuButton node
  3. Add this code to the root node:
extends Control

func _ready():
	# Add items
	$MenuButton.get_popup().add_item("I'm a regular item")
	$MenuButton.get_popup().add_item("I am not")
	
	# Create the shortcut
	var shortcut = ShortCut.new()
	var inputeventkey = InputEventKey.new()
	inputeventkey.set_scancode(KEY_Q)
	inputeventkey.control = true
	shortcut.set_shortcut(inputeventkey)
	
	# Set shortcut
	$MenuButton.get_popup().set_item_shortcut(1, shortcut, true)
  1. Run project and check how the label on the second menu item is gone.

Minimal reproduction project:
MenuButtonItemBug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions