1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Split into files

This commit is contained in:
Emil Ernerfeldt
2023-04-26 20:44:27 +02:00
parent e9928c8766
commit fa69d7a22b
6 changed files with 696 additions and 688 deletions

View File

@@ -4,7 +4,7 @@ use egui::{Id, Key, NumExt, Pos2, Rect, Response, Sense, TextStyle, Ui, WidgetTe
mod branch;
pub use branch::{Branch, Grid, Layout, Linear, LinearDir, Tabs};
pub use branch::{Branch, Grid, GridLoc, Layout, Linear, LinearDir, Tabs};
// ----------------------------------------------------------------------------
// Types required for state
@@ -88,32 +88,6 @@ impl<Leaf> Node<Leaf> {
}
}
/// Where in a grid?
#[derive(
Clone,
Copy,
Debug,
Default,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
serde::Serialize,
serde::Deserialize,
)]
pub struct GridLoc {
// Row first for sorting
pub row: usize,
pub col: usize,
}
impl GridLoc {
pub fn from_col_row(col: usize, row: usize) -> Self {
Self { col, row }
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LayoutInsertion {
Tabs(usize),
@@ -692,7 +666,7 @@ fn sizes_from_shares(shares: &[f32], available_size: f32, gap_width: f32) -> Vec
// ----------------------------------------------------------------------------
// ui
struct DropContext {
pub struct DropContext {
enabled: bool,
dragged_node_id: Option<NodeId>,
mouse_pos: Option<Pos2>,