|
@@ -4447,7 +4447,7 @@ void CanvasItemEditor::_button_override_camera(bool p_pressed) {
|
|
|
}
|
|
|
|
|
|
void CanvasItemEditor::_button_tool_select(int p_index) {
|
|
|
- ToolButton *tb[TOOL_MAX] = { select_button, list_select_button, move_button, scale_button, rotate_button, pivot_button, pan_button, ruler_button };
|
|
|
+ Button *tb[TOOL_MAX] = { select_button, list_select_button, move_button, scale_button, rotate_button, pivot_button, pan_button, ruler_button };
|
|
|
for (int i = 0; i < TOOL_MAX; i++) {
|
|
|
tb[i]->set_pressed(i == p_index);
|
|
|
}
|
|
@@ -5577,13 +5577,15 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
viewport->add_child(controls_vb);
|
|
|
|
|
|
- zoom_minus = memnew(ToolButton);
|
|
|
+ zoom_minus = memnew(Button);
|
|
|
+ zoom_minus->set_flat(true);
|
|
|
zoom_hb->add_child(zoom_minus);
|
|
|
zoom_minus->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_zoom_minus));
|
|
|
zoom_minus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_minus", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS));
|
|
|
zoom_minus->set_focus_mode(FOCUS_NONE);
|
|
|
|
|
|
- zoom_reset = memnew(ToolButton);
|
|
|
+ zoom_reset = memnew(Button);
|
|
|
+ zoom_reset->set_flat(true);
|
|
|
zoom_hb->add_child(zoom_reset);
|
|
|
zoom_reset->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_zoom_reset));
|
|
|
zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KEY_MASK_CMD | KEY_0));
|
|
@@ -5592,7 +5594,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
// Prevent the button's size from changing when the text size changes
|
|
|
zoom_reset->set_custom_minimum_size(Size2(75 * EDSCALE, 0));
|
|
|
|
|
|
- zoom_plus = memnew(ToolButton);
|
|
|
+ zoom_plus = memnew(Button);
|
|
|
+ zoom_plus->set_flat(true);
|
|
|
zoom_hb->add_child(zoom_plus);
|
|
|
zoom_plus->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_zoom_plus));
|
|
|
zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom In"), KEY_MASK_CMD | KEY_EQUAL)); // Usually direct access key for PLUS
|
|
@@ -5600,7 +5603,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
updating_scroll = false;
|
|
|
|
|
|
- select_button = memnew(ToolButton);
|
|
|
+ select_button = memnew(Button);
|
|
|
+ select_button->set_flat(true);
|
|
|
hb->add_child(select_button);
|
|
|
select_button->set_toggle_mode(true);
|
|
|
select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_SELECT));
|
|
@@ -5610,21 +5614,24 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
hb->add_child(memnew(VSeparator));
|
|
|
|
|
|
- move_button = memnew(ToolButton);
|
|
|
+ move_button = memnew(Button);
|
|
|
+ move_button->set_flat(true);
|
|
|
hb->add_child(move_button);
|
|
|
move_button->set_toggle_mode(true);
|
|
|
move_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_MOVE));
|
|
|
move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), KEY_W));
|
|
|
move_button->set_tooltip(TTR("Move Mode"));
|
|
|
|
|
|
- rotate_button = memnew(ToolButton);
|
|
|
+ rotate_button = memnew(Button);
|
|
|
+ rotate_button->set_flat(true);
|
|
|
hb->add_child(rotate_button);
|
|
|
rotate_button->set_toggle_mode(true);
|
|
|
rotate_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_ROTATE));
|
|
|
rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), KEY_E));
|
|
|
rotate_button->set_tooltip(TTR("Rotate Mode"));
|
|
|
|
|
|
- scale_button = memnew(ToolButton);
|
|
|
+ scale_button = memnew(Button);
|
|
|
+ scale_button->set_flat(true);
|
|
|
hb->add_child(scale_button);
|
|
|
scale_button->set_toggle_mode(true);
|
|
|
scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_SCALE));
|
|
@@ -5633,26 +5640,30 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
hb->add_child(memnew(VSeparator));
|
|
|
|
|
|
- list_select_button = memnew(ToolButton);
|
|
|
+ list_select_button = memnew(Button);
|
|
|
+ list_select_button->set_flat(true);
|
|
|
hb->add_child(list_select_button);
|
|
|
list_select_button->set_toggle_mode(true);
|
|
|
list_select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_LIST_SELECT));
|
|
|
list_select_button->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode)."));
|
|
|
|
|
|
- pivot_button = memnew(ToolButton);
|
|
|
+ pivot_button = memnew(Button);
|
|
|
+ pivot_button->set_flat(true);
|
|
|
hb->add_child(pivot_button);
|
|
|
pivot_button->set_toggle_mode(true);
|
|
|
pivot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_EDIT_PIVOT));
|
|
|
pivot_button->set_tooltip(TTR("Click to change object's rotation pivot."));
|
|
|
|
|
|
- pan_button = memnew(ToolButton);
|
|
|
+ pan_button = memnew(Button);
|
|
|
+ pan_button->set_flat(true);
|
|
|
hb->add_child(pan_button);
|
|
|
pan_button->set_toggle_mode(true);
|
|
|
pan_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_PAN));
|
|
|
pan_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/pan_mode", TTR("Pan Mode"), KEY_G));
|
|
|
pan_button->set_tooltip(TTR("Pan Mode"));
|
|
|
|
|
|
- ruler_button = memnew(ToolButton);
|
|
|
+ ruler_button = memnew(Button);
|
|
|
+ ruler_button->set_flat(true);
|
|
|
hb->add_child(ruler_button);
|
|
|
ruler_button->set_toggle_mode(true);
|
|
|
ruler_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_RULER));
|
|
@@ -5661,14 +5672,16 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
hb->add_child(memnew(VSeparator));
|
|
|
|
|
|
- smart_snap_button = memnew(ToolButton);
|
|
|
+ smart_snap_button = memnew(Button);
|
|
|
+ smart_snap_button->set_flat(true);
|
|
|
hb->add_child(smart_snap_button);
|
|
|
smart_snap_button->set_toggle_mode(true);
|
|
|
smart_snap_button->connect("toggled", callable_mp(this, &CanvasItemEditor::_button_toggle_smart_snap));
|
|
|
smart_snap_button->set_tooltip(TTR("Toggle smart snapping."));
|
|
|
smart_snap_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/use_smart_snap", TTR("Use Smart Snap"), KEY_MASK_SHIFT | KEY_S));
|
|
|
|
|
|
- grid_snap_button = memnew(ToolButton);
|
|
|
+ grid_snap_button = memnew(Button);
|
|
|
+ grid_snap_button->set_flat(true);
|
|
|
hb->add_child(grid_snap_button);
|
|
|
grid_snap_button->set_toggle_mode(true);
|
|
|
grid_snap_button->connect("toggled", callable_mp(this, &CanvasItemEditor::_button_toggle_grid_snap));
|
|
@@ -5707,23 +5720,27 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
hb->add_child(memnew(VSeparator));
|
|
|
|
|
|
- lock_button = memnew(ToolButton);
|
|
|
+ lock_button = memnew(Button);
|
|
|
+ lock_button->set_flat(true);
|
|
|
hb->add_child(lock_button);
|
|
|
|
|
|
lock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback), varray(LOCK_SELECTED));
|
|
|
lock_button->set_tooltip(TTR("Lock the selected object in place (can't be moved)."));
|
|
|
|
|
|
- unlock_button = memnew(ToolButton);
|
|
|
+ unlock_button = memnew(Button);
|
|
|
+ unlock_button->set_flat(true);
|
|
|
hb->add_child(unlock_button);
|
|
|
unlock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback), varray(UNLOCK_SELECTED));
|
|
|
unlock_button->set_tooltip(TTR("Unlock the selected object (can be moved)."));
|
|
|
|
|
|
- group_button = memnew(ToolButton);
|
|
|
+ group_button = memnew(Button);
|
|
|
+ group_button->set_flat(true);
|
|
|
hb->add_child(group_button);
|
|
|
group_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback), varray(GROUP_SELECTED));
|
|
|
group_button->set_tooltip(TTR("Makes sure the object's children are not selectable."));
|
|
|
|
|
|
- ungroup_button = memnew(ToolButton);
|
|
|
+ ungroup_button = memnew(Button);
|
|
|
+ ungroup_button->set_flat(true);
|
|
|
hb->add_child(ungroup_button);
|
|
|
ungroup_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback), varray(UNGROUP_SELECTED));
|
|
|
ungroup_button->set_tooltip(TTR("Restores the object's children's ability to be selected."));
|
|
@@ -5748,7 +5765,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
|
|
|
hb->add_child(memnew(VSeparator));
|
|
|
|
|
|
- override_camera_button = memnew(ToolButton);
|
|
|
+ override_camera_button = memnew(Button);
|
|
|
+ override_camera_button->set_flat(true);
|
|
|
hb->add_child(override_camera_button);
|
|
|
override_camera_button->connect("toggled", callable_mp(this, &CanvasItemEditor::_button_override_camera));
|
|
|
override_camera_button->set_toggle_mode(true);
|
|
@@ -5795,7 +5813,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
|
|
|
anchors_popup->set_name("Anchors");
|
|
|
anchors_popup->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_popup_callback));
|
|
|
|
|
|
- anchor_mode_button = memnew(ToolButton);
|
|
|
+ anchor_mode_button = memnew(Button);
|
|
|
+ anchor_mode_button->set_flat(true);
|
|
|
hb->add_child(anchor_mode_button);
|
|
|
anchor_mode_button->set_toggle_mode(true);
|
|
|
anchor_mode_button->hide();
|