Git · rows draw their focus ring; row actions show while the keyboard is on them
This commit is contained in:
6 files changed
+21
-1
No files matched your search
@@ -198,6 +198,8 @@ impl RenderOnce for BlameView {
|
|||||||
.role(Role::Button)
|
.role(Role::Button)
|
||||||
.aria_label(said)
|
.aria_label(said)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
.hover(|gutter| gutter.bg(colors.hover))
|
.hover(|gutter| gutter.bg(colors.hover))
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ impl ChangesList {
|
|||||||
.aria_label(file.path.clone())
|
.aria_label(file.path.clone())
|
||||||
.aria_selected(picked)
|
.aria_selected(picked)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.when(picked, |row| row.bg(colors.selection))
|
.when(picked, |row| row.bg(colors.selection))
|
||||||
.flex()
|
.flex()
|
||||||
@@ -214,6 +216,9 @@ impl ChangesList {
|
|||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
|
.id("actions")
|
||||||
|
.focusable()
|
||||||
|
.in_focus(|actions| actions.opacity(1.))
|
||||||
.flex()
|
.flex()
|
||||||
.opacity(0.)
|
.opacity(0.)
|
||||||
.group_hover(group, |actions| actions.opacity(1.))
|
.group_hover(group, |actions| actions.opacity(1.))
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ impl RenderOnce for CommitItem {
|
|||||||
.aria_label(spoken)
|
.aria_label(spoken)
|
||||||
.aria_selected(self.selected)
|
.aria_selected(self.selected)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.flex_1()
|
.flex_1()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ impl RenderOnce for FileHistory {
|
|||||||
.aria_label(commit.subject.clone())
|
.aria_label(commit.subject.clone())
|
||||||
.aria_selected(picked)
|
.aria_selected(picked)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.flex()
|
.flex()
|
||||||
.gap_3()
|
.gap_3()
|
||||||
|
|||||||
+6
-1
@@ -227,6 +227,8 @@ pub(super) fn listed(
|
|||||||
.aria_label(pick.spoken)
|
.aria_label(pick.spoken)
|
||||||
.aria_selected(pick.selected)
|
.aria_selected(pick.selected)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
.when(pick.selected, |row| row.bg(colors.selection))
|
.when(pick.selected, |row| row.bg(colors.selection))
|
||||||
@@ -280,9 +282,12 @@ pub(super) fn listed(
|
|||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
// On hover the actions take the words' place.
|
// Hover or keyboard focus shows the actions.
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
|
.id("actions")
|
||||||
|
.focusable()
|
||||||
|
.in_focus(|actions| actions.opacity(1.))
|
||||||
.absolute()
|
.absolute()
|
||||||
.top_0p5()
|
.top_0p5()
|
||||||
.right_1()
|
.right_1()
|
||||||
|
|||||||
@@ -234,6 +234,8 @@ impl RenderOnce for DiffViewer {
|
|||||||
.aria_label(spoken(line))
|
.aria_label(spoken(line))
|
||||||
.aria_selected(picked)
|
.aria_selected(picked)
|
||||||
.tab_index(0)
|
.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
.on_mouse_down(MouseButton::Left, |_, window, _| {
|
.on_mouse_down(MouseButton::Left, |_, window, _| {
|
||||||
@@ -365,6 +367,8 @@ impl RenderOnce for DiffViewer {
|
|||||||
.text_color(colors.fg_subtle)
|
.text_color(colors.fg_subtle)
|
||||||
.when_some(open, |row, open| {
|
.when_some(open, |row, open| {
|
||||||
row.tab_index(0)
|
row.tab_index(0)
|
||||||
|
.border_1()
|
||||||
|
.border_color(gpui::transparent_black())
|
||||||
.focus_ring(cx)
|
.focus_ring(cx)
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
.hover(|row| row.text_color(colors.fg))
|
.hover(|row| row.text_color(colors.fg))
|
||||||
|
|||||||
Reference in new issue
Block a user