You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Merge pull request #63173 from fire-forge/layers-grid
This commit is contained in:
@@ -1147,6 +1147,17 @@ void EditorPropertyLayersGrid::_bind_methods() {
|
|||||||
ADD_SIGNAL(MethodInfo("rename_confirmed", PropertyInfo(Variant::INT, "layer_id"), PropertyInfo(Variant::STRING, "new_name")));
|
ADD_SIGNAL(MethodInfo("rename_confirmed", PropertyInfo(Variant::INT, "layer_id"), PropertyInfo(Variant::STRING, "new_name")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorPropertyLayers::_notification(int p_what) {
|
||||||
|
switch (p_what) {
|
||||||
|
case NOTIFICATION_ENTER_TREE:
|
||||||
|
case NOTIFICATION_THEME_CHANGED: {
|
||||||
|
button->set_normal_texture(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||||
|
button->set_pressed_texture(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons")));
|
||||||
|
button->set_disabled_texture(get_theme_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons")));
|
||||||
|
} break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditorPropertyLayers::_set_read_only(bool p_read_only) {
|
void EditorPropertyLayers::_set_read_only(bool p_read_only) {
|
||||||
button->set_disabled(p_read_only);
|
button->set_disabled(p_read_only);
|
||||||
grid->set_read_only(p_read_only);
|
grid->set_read_only(p_read_only);
|
||||||
@@ -1283,9 +1294,9 @@ EditorPropertyLayers::EditorPropertyLayers() {
|
|||||||
grid->set_h_size_flags(SIZE_EXPAND_FILL);
|
grid->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
hb->add_child(grid);
|
hb->add_child(grid);
|
||||||
|
|
||||||
button = memnew(Button);
|
button = memnew(TextureButton);
|
||||||
|
button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED);
|
||||||
button->set_toggle_mode(true);
|
button->set_toggle_mode(true);
|
||||||
button->set_text("...");
|
|
||||||
button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed));
|
button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed));
|
||||||
hb->add_child(button);
|
hb->add_child(button);
|
||||||
|
|
||||||
|
|||||||
@@ -342,13 +342,14 @@ private:
|
|||||||
String basename;
|
String basename;
|
||||||
LayerType layer_type;
|
LayerType layer_type;
|
||||||
PopupMenu *layers = nullptr;
|
PopupMenu *layers = nullptr;
|
||||||
Button *button = nullptr;
|
TextureButton *button = nullptr;
|
||||||
|
|
||||||
void _button_pressed();
|
void _button_pressed();
|
||||||
void _menu_pressed(int p_menu);
|
void _menu_pressed(int p_menu);
|
||||||
void _refresh_names();
|
void _refresh_names();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void _notification(int p_what);
|
||||||
virtual void _set_read_only(bool p_read_only) override;
|
virtual void _set_read_only(bool p_read_only) override;
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user