debugger: Prevent pane context menu from showing on secondary mouse click in list entries (#30781)
This PR prevents the debug panel pane context menu from showing when you click your secondary mouse button in **stackframe**, **breakpoint** and **module** list entries. Release Notes: - N/A
This commit is contained in:
parent
33b60bc16d
commit
9be1e9aab1
3 changed files with 27 additions and 2 deletions
|
@ -21,8 +21,8 @@ use project::{
|
||||||
use ui::{
|
use ui::{
|
||||||
App, Clickable, Color, Context, Div, Icon, IconButton, IconName, Indicator, InteractiveElement,
|
App, Clickable, Color, Context, Div, Icon, IconButton, IconName, Indicator, InteractiveElement,
|
||||||
IntoElement, Label, LabelCommon, LabelSize, ListItem, ParentElement, Render, RenderOnce,
|
IntoElement, Label, LabelCommon, LabelSize, ListItem, ParentElement, Render, RenderOnce,
|
||||||
Scrollbar, ScrollbarState, SharedString, StatefulInteractiveElement, Styled, Window, div,
|
Scrollbar, ScrollbarState, SharedString, StatefulInteractiveElement, Styled, Tooltip, Window,
|
||||||
h_flex, px, v_flex,
|
div, h_flex, px, v_flex,
|
||||||
};
|
};
|
||||||
use util::{ResultExt, maybe};
|
use util::{ResultExt, maybe};
|
||||||
use workspace::Workspace;
|
use workspace::Workspace;
|
||||||
|
@ -259,6 +259,11 @@ impl LineBreakpoint {
|
||||||
dir, name, line
|
dir, name, line
|
||||||
)))
|
)))
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
|
.tooltip(Tooltip::text(if breakpoint.state.is_enabled() {
|
||||||
|
"Disable Breakpoint"
|
||||||
|
} else {
|
||||||
|
"Enable Breakpoint"
|
||||||
|
}))
|
||||||
.on_click({
|
.on_click({
|
||||||
let weak = weak.clone();
|
let weak = weak.clone();
|
||||||
let path = path.clone();
|
let path = path.clone();
|
||||||
|
@ -290,6 +295,9 @@ impl LineBreakpoint {
|
||||||
)))
|
)))
|
||||||
.start_slot(indicator)
|
.start_slot(indicator)
|
||||||
.rounded()
|
.rounded()
|
||||||
|
.on_secondary_mouse_down(|_, _, cx| {
|
||||||
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
.end_hover_slot(
|
.end_hover_slot(
|
||||||
IconButton::new(
|
IconButton::new(
|
||||||
SharedString::from(format!(
|
SharedString::from(format!(
|
||||||
|
@ -423,12 +431,20 @@ impl ExceptionBreakpoint {
|
||||||
self.id
|
self.id
|
||||||
)))
|
)))
|
||||||
.rounded()
|
.rounded()
|
||||||
|
.on_secondary_mouse_down(|_, _, cx| {
|
||||||
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
.start_slot(
|
.start_slot(
|
||||||
div()
|
div()
|
||||||
.id(SharedString::from(format!(
|
.id(SharedString::from(format!(
|
||||||
"exception-breakpoint-ui-item-{}-click-handler",
|
"exception-breakpoint-ui-item-{}-click-handler",
|
||||||
self.id
|
self.id
|
||||||
)))
|
)))
|
||||||
|
.tooltip(Tooltip::text(if self.is_enabled {
|
||||||
|
"Disable Exception Breakpoint"
|
||||||
|
} else {
|
||||||
|
"Enable Exception Breakpoint"
|
||||||
|
}))
|
||||||
.on_click(move |_, _, cx| {
|
.on_click(move |_, _, cx| {
|
||||||
list.update(cx, |this, cx| {
|
list.update(cx, |this, cx| {
|
||||||
this.session.update(cx, |this, cx| {
|
this.session.update(cx, |this, cx| {
|
||||||
|
|
|
@ -129,6 +129,9 @@ impl ModuleList {
|
||||||
.w_full()
|
.w_full()
|
||||||
.group("")
|
.group("")
|
||||||
.id(("module-list", ix))
|
.id(("module-list", ix))
|
||||||
|
.on_any_mouse_down(|_, _, cx| {
|
||||||
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
.when(module.path.is_some(), |this| {
|
.when(module.path.is_some(), |this| {
|
||||||
this.on_click({
|
this.on_click({
|
||||||
let path = module
|
let path = module
|
||||||
|
|
|
@ -393,6 +393,9 @@ impl StackFrameList {
|
||||||
.when(is_selected_frame, |this| {
|
.when(is_selected_frame, |this| {
|
||||||
this.bg(cx.theme().colors().element_hover)
|
this.bg(cx.theme().colors().element_hover)
|
||||||
})
|
})
|
||||||
|
.on_any_mouse_down(|_, _, cx| {
|
||||||
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
.on_click(cx.listener(move |this, _, window, cx| {
|
.on_click(cx.listener(move |this, _, window, cx| {
|
||||||
this.selected_ix = Some(ix);
|
this.selected_ix = Some(ix);
|
||||||
this.activate_selected_entry(window, cx);
|
this.activate_selected_entry(window, cx);
|
||||||
|
@ -480,6 +483,9 @@ impl StackFrameList {
|
||||||
.when(is_selected, |this| {
|
.when(is_selected, |this| {
|
||||||
this.bg(cx.theme().colors().element_hover)
|
this.bg(cx.theme().colors().element_hover)
|
||||||
})
|
})
|
||||||
|
.on_any_mouse_down(|_, _, cx| {
|
||||||
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
.on_click(cx.listener(move |this, _, window, cx| {
|
.on_click(cx.listener(move |this, _, window, cx| {
|
||||||
this.selected_ix = Some(ix);
|
this.selected_ix = Some(ix);
|
||||||
this.activate_selected_entry(window, cx);
|
this.activate_selected_entry(window, cx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue