Merge pull request #15269 from ianb96/context_menu_improvements
Context Menu Improvements
This commit is contained in:
commit
0fcc28b6f3
12 changed files with 193 additions and 68 deletions
|
|
@ -189,7 +189,7 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
|
|||
update();
|
||||
}
|
||||
|
||||
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
|
||||
if (mb->is_pressed() && (mb->get_button_index() == BUTTON_LEFT || (select_with_rmb && mb->get_button_index() == BUTTON_RIGHT))) {
|
||||
|
||||
// clicks
|
||||
Point2 pos(mb->get_position().x, mb->get_position().y);
|
||||
|
|
@ -920,6 +920,14 @@ int Tabs::get_tabs_rearrange_group() const {
|
|||
return tabs_rearrange_group;
|
||||
}
|
||||
|
||||
void Tabs::set_select_with_rmb(bool p_enabled) {
|
||||
select_with_rmb = p_enabled;
|
||||
}
|
||||
|
||||
bool Tabs::get_select_with_rmb() const {
|
||||
return select_with_rmb;
|
||||
}
|
||||
|
||||
void Tabs::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_gui_input"), &Tabs::_gui_input);
|
||||
|
|
@ -950,6 +958,9 @@ void Tabs::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("set_tabs_rearrange_group", "group_id"), &Tabs::set_tabs_rearrange_group);
|
||||
ClassDB::bind_method(D_METHOD("get_tabs_rearrange_group"), &Tabs::get_tabs_rearrange_group);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_select_with_rmb", "enabled"), &Tabs::set_select_with_rmb);
|
||||
ClassDB::bind_method(D_METHOD("get_select_with_rmb"), &Tabs::get_select_with_rmb);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("tab_changed", PropertyInfo(Variant::INT, "tab")));
|
||||
ADD_SIGNAL(MethodInfo("right_button_pressed", PropertyInfo(Variant::INT, "tab")));
|
||||
ADD_SIGNAL(MethodInfo("tab_close", PropertyInfo(Variant::INT, "tab")));
|
||||
|
|
@ -988,6 +999,8 @@ Tabs::Tabs() {
|
|||
offset = 0;
|
||||
max_drawn_tab = 0;
|
||||
|
||||
select_with_rmb = false;
|
||||
|
||||
min_width = 0;
|
||||
scrolling_enabled = true;
|
||||
buttons_visible = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue