Merge pull request #10247 from djrm/pr_bus_fixes

Fixes to buses editor
This commit is contained in:
Rémi Verschelde 2017-08-11 10:43:30 +02:00 committed by GitHub
commit ff2cb35b90
6 changed files with 120 additions and 11 deletions

View File

@ -51,6 +51,8 @@ void EditorAudioBus::_notification(int p_what) {
mute->set_icon(get_icon("AudioBusMute", "EditorIcons"));
bypass->set_icon(get_icon("AudioBusBypass", "EditorIcons"));
bus_options->set_icon(get_icon("GuiMiniTabMenu", "EditorIcons"));
prev_active = true;
update_bus();
set_process(true);
@ -620,15 +622,26 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
buses = p_buses;
updating_bus = false;
set_tooltip(TTR("Audio Bus, Drag and Drop to rearrange."));
VBoxContainer *vb = memnew(VBoxContainer);
add_child(vb);
set_v_size_flags(SIZE_EXPAND_FILL);
HBoxContainer *head = memnew(HBoxContainer);
track_name = memnew(LineEdit);
vb->add_child(track_name);
head->add_child(track_name);
track_name->connect("text_entered", this, "_name_changed");
track_name->connect("focus_exited", this, "_name_focus_exit");
track_name->set_h_size_flags(SIZE_EXPAND_FILL);
bus_options = memnew(MenuButton);
bus_options->set_h_size_flags(SIZE_SHRINK_END);
bus_options->set_tooltip(TTR("Bus options"));
head->add_child(bus_options);
vb->add_child(head);
HBoxContainer *hbc = memnew(HBoxContainer);
vb->add_child(hbc);
@ -636,24 +649,18 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
solo = memnew(ToolButton);
solo->set_toggle_mode(true);
solo->set_tooltip(TTR("Solo"));
solo->add_color_override("font_color_pressed", Color(0.2, 0.9, 0.2));
solo->add_color_override("font_color_hover", Color(0.6, 0.9, 0.6));
solo->set_focus_mode(FOCUS_NONE);
solo->connect("pressed", this, "_solo_toggled");
hbc->add_child(solo);
mute = memnew(ToolButton);
mute->set_toggle_mode(true);
mute->set_tooltip(TTR("Mute"));
mute->add_color_override("font_color_pressed", Color(0.9, 0.2, 0.2));
mute->add_color_override("font_color_hover", Color(0.9, 0.6, 0.6));
mute->set_focus_mode(FOCUS_NONE);
mute->connect("pressed", this, "_mute_toggled");
hbc->add_child(mute);
bypass = memnew(ToolButton);
bypass->set_toggle_mode(true);
bypass->set_tooltip(TTR("Bypass"));
bypass->add_color_override("font_color_pressed", Color(0.9, 0.9, 0.2));
bypass->add_color_override("font_color_hover", Color(0.9, 0.9, 0.6));
bypass->set_focus_mode(FOCUS_NONE);
bypass->connect("pressed", this, "_bypass_toggled");
hbc->add_child(bypass);
@ -689,7 +696,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effects = memnew(Tree);
effects->set_hide_root(true);
effects->set_custom_minimum_size(Size2(0, 90) * EDSCALE);
effects->set_custom_minimum_size(Size2(0, 100) * EDSCALE);
effects->set_hide_folding(true);
vb->add_child(effects);
effects->connect("item_edited", this, "_effect_edited");
@ -698,6 +705,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effects->set_drag_forwarding(this);
effects->connect("item_rmb_selected", this, "_effect_rmb");
effects->set_allow_rmb_select(true);
effects->set_single_select_cell_editing_only_when_already_selected(true);
effects->set_focus_mode(FOCUS_CLICK);
send = memnew(OptionButton);
send->set_clip_text(true);
@ -726,7 +735,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
effect_options->set_item_icon(effect_options->get_item_count() - 1, icon);
}
delete_popup = memnew(PopupMenu);
delete_popup = bus_options->get_popup();
delete_popup->add_item("Duplicate");
delete_popup->add_item("Delete");
add_child(delete_popup);
@ -1069,6 +1078,7 @@ EditorAudioBuses::EditorAudioBuses() {
add = memnew(Button);
top_hb->add_child(add);
add->set_text(TTR("Add Bus"));
add->set_tooltip(TTR("Create a new Bus Layout."));
add->connect("pressed", this, "_add_bus");
@ -1076,21 +1086,25 @@ EditorAudioBuses::EditorAudioBuses() {
load = memnew(Button);
load->set_text(TTR("Load"));
load->set_tooltip(TTR("Load an existing Bus Layout."));
top_hb->add_child(load);
load->connect("pressed", this, "_load_layout");
save_as = memnew(Button);
save_as->set_text(TTR("Save As"));
save_as->set_tooltip(TTR("Save this Bus Layout to a file."));
top_hb->add_child(save_as);
save_as->connect("pressed", this, "_save_as_layout");
_default = memnew(Button);
_default->set_text(TTR("Default"));
_default->set_text(TTR("Load Default"));
_default->set_tooltip(TTR("Load the default Bus Layout."));
top_hb->add_child(_default);
_default->connect("pressed", this, "_load_default_layout");
_new = memnew(Button);
_new->set_text(TTR("Create"));
_new->set_tooltip(TTR("Create a new Bus Layout."));
top_hb->add_child(_new);
_new->connect("pressed", this, "_new_layout");

View File

@ -35,6 +35,7 @@
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/line_edit.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/option_button.h"
#include "scene/gui/panel.h"
#include "scene/gui/panel_container.h"
@ -57,6 +58,7 @@ class EditorAudioBus : public PanelContainer {
Ref<Texture> disabled_vu;
LineEdit *track_name;
MenuButton *bus_options;
VSlider *slider;
TextureProgress *vu_l;
TextureProgress *vu_r;

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="6"
height="16"
viewBox="0 0 6 16"
id="svg2"
version="1.1"
inkscape:version="0.92+devel unknown"
inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45"
sodipodi:docname="icon_GUI_mini_tab_menu.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="32.000001"
inkscape:cx="5.71687"
inkscape:cy="8.5207578"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
units="px"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:snap-smooth-nodes="true"
inkscape:object-nodes="true"
inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3336" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
<circle
style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
id="path819"
cx="3"
cy="1038.3622"
r="2" />
<circle
r="2"
cy="1044.3622"
cx="3"
id="circle821"
style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" />
<circle
style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118"
id="circle823"
cx="3"
cy="1050.3622"
r="2" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1478,7 +1478,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c
if (!r_in_range && &selected_cell == &c) {
if (!selected_cell.selected) {
if (!selected_cell.selected || force_select_on_already_selected) {
selected_cell.selected = true;