ltk/widget/tab_strip/
theme.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: LGPL-2.1-only
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>

use std::time::Duration;

/// Part of the width between the leading and trailing buttons kept clear of tabs and buttons.
pub( crate ) const RESERVE:          f32 = 0.075;
/// Widest a tab gets, as a part of the screen's width.
pub( crate ) const MAX_TAB_FRACTION: f32 = 0.20;
pub( crate ) const MIN_TAB_WIDTH:    f32 = 90.0;
pub( crate ) const GAP:              f32 = 4.0;
/// How far a strip scrolls on each frame a dragged tab is held against its edge.
pub( crate ) const EDGE_SCROLL:      f32 = 8.0;

pub( crate ) const SLIDE:      Duration = Duration::from_millis( 180 );
/// How long the other tabs keep their width after one closes, so the next close button lands under the pointer.
pub( crate ) const CLOSE_HOLD: Duration = Duration::from_millis( 1000 );

pub( crate ) const LABEL_SIZE:      f32 = 13.0;
pub( crate ) const ICON_SIZE:       f32 = 16.0;
pub( crate ) const CLOSE_SIZE:      f32 = 28.0;
pub( crate ) const CLOSE_ICON_SIZE: f32 = 16.0;
pub( crate ) const TAB_CLOSE_ICON:  f32 = 10.0;
pub( crate ) const BUTTON_SIZE:     f32 = 40.0;
pub( crate ) const BUTTON_ICON:     f32 = 22.0;
pub( crate ) const TAB_RADIUS:      f32 = 8.0;
pub( crate ) const EDGE_WIDTH:      f32 = 1.5;

pub( crate ) const BAR_TITLE_SIZE: f32 = 16.0;
pub( crate ) const BAR_ICON_SIZE:  f32 = 20.0;

pub( crate ) const COLUMNS:     usize = 2;
pub( crate ) const CARD_RADIUS: f32   = 16.0;
pub( crate ) const BODY_WIDTH:  f32   = 760.0;

pub( crate ) const TAB_ID:  &str = "ltk-tab";
pub( crate ) const CARD_ID: &str = "ltk-tab-card";

pub( crate ) const CLOSE_ICON: &str = "navigation/close-small";
pub( crate ) const BACK_ICON:  &str = "general/left";