Rebuilt from the exact zed-industries/zed @ 8c74db00c4053d6c0a9037863d7bd048658da4ca tree (previous orphan was based on a stale/wrong fetch). Same 3-file patch: - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36 lines
956 B
Rust
36 lines
956 B
Rust
use gpui::actions;
|
|
use ui::prelude::*;
|
|
|
|
actions!(
|
|
panel,
|
|
[
|
|
/// Navigates to the next tab in the panel.
|
|
NextPanelTab,
|
|
/// Navigates to the previous tab in the panel.
|
|
PreviousPanelTab
|
|
]
|
|
);
|
|
|
|
pub trait PanelHeader: workspace::Panel {}
|
|
|
|
/// Implement this trait to enable a panel to have tabs.
|
|
pub trait PanelTabs: PanelHeader {
|
|
/// Returns the index of the currently selected tab.
|
|
fn selected_tab(&self, cx: &mut App) -> usize;
|
|
/// Selects the tab at the given index.
|
|
fn select_tab(&self, cx: &mut App, index: usize);
|
|
/// Moves to the next tab.
|
|
fn next_tab(&self, _: NextPanelTab, cx: &mut App) -> Self;
|
|
/// Moves to the previous tab.
|
|
fn previous_tab(&self, _: PreviousPanelTab, cx: &mut App) -> Self;
|
|
}
|
|
|
|
#[derive(IntoElement)]
|
|
pub struct PanelTab {}
|
|
|
|
impl RenderOnce for PanelTab {
|
|
fn render(self, _window: &mut Window, _cx: &mut App) -> impl IntoElement {
|
|
div()
|
|
}
|
|
}
|