跳到正文

Splitter

创建可调整大小的面板,分隔手柄支持指针和键盘操作。

正在加载交互演示…

#导入

从 quickgui 导入 Splitter。

use quickgui::*;

#用法

let splitter = Splitter::new("workspace", &state);
splitter.root().flex_row()

#结构

  • Splitter::root
  • Splitter::pane
  • Splitter::handle

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

Splitter

查看源码
pub fn new(root_id: impl Into<ElementId>, state: &SplitterState) -> Self
root_idpub const fn root_id(self) -> ElementId—

Configures root id for this part.

pub const fn root_id(self) -> ElementId
查看源码
statepub const fn state(self) -> SplitterState—

Configures state for this part.

pub const fn state(self) -> SplitterState
查看源码
pane_idpub fn pane_id(self, index: usize) -> ElementId—

Configures pane id for this part.

pub fn pane_id(self, index: usize) -> ElementId
查看源码
handle_idpub fn handle_id(self, index: usize) -> ElementId—

Configures handle id for this part.

pub fn handle_id(self, index: usize) -> ElementId
查看源码
panepub fn pane(self, index: usize) -> Option<SplitterPane>—

Describe one pane.

pub fn pane(self, index: usize) -> Option<SplitterPane>
查看源码
handlepub fn handle(self, index: usize) -> Option<SplitterHandle>—

Describe the handle that sits after pane `index`.

pub fn handle(self, index: usize) -> Option<SplitterHandle>
查看源码

Splitter::root_with

查看源码
pub fn root_with(self, root: Element) -> Element

Decorate an application-owned root without adding appearance. The root becomes a flex container on the split axis because pane order along that axis is the behavior itself. Colors, gaps, borders, and padding stay caller-owned.

Splitter::root

查看源码
pub fn root(self) -> Element

Create the unstyled root part. Use [`Self::root_with`] to supply an existing element.