mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
refactor(ui): define the panel resize-handle width once
The tab sidebar and the right panel each declared their own RESIZE_HANDLE_WIDTH = 8. Two edges the same window drags, two numbers that only happened to agree — the same shape as the target fade that had already drifted apart. One constant now, named where the panel lives.
This commit is contained in:
@@ -20,7 +20,9 @@ use crate::ui::scrollbar::with_vertical_scrollbar;
|
||||
pub(crate) const MIN_WIDTH: f32 = 216.;
|
||||
pub(crate) const MAX_WIDTH_RATIO: f32 = 0.5;
|
||||
|
||||
const RESIZE_HANDLE_WIDTH: f32 = 8.;
|
||||
/// How wide a panel edge is to grab. Both edges a window can drag — the tab
|
||||
/// sidebar's and this panel's — are the same target, so they are one number.
|
||||
pub(crate) const RESIZE_HANDLE_WIDTH: f32 = 8.;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct RightPanelState {
|
||||
|
||||
@@ -18,6 +18,7 @@ use crate::ui::app::{TITLE_BAR_HEIGHT, Tty7App};
|
||||
use crate::ui::hints::tab_badge_label;
|
||||
use crate::ui::i18n::{L10nKey, t};
|
||||
use crate::ui::reorder::{self, Reorder, Surface};
|
||||
use crate::ui::right_panel::RESIZE_HANDLE_WIDTH;
|
||||
use crate::ui::tab_strip::{DragTab, REORDER_SLIDE_MS};
|
||||
|
||||
const MIN_SIDEBAR_WIDTH: f32 = 180.;
|
||||
@@ -25,8 +26,6 @@ const MIN_SIDEBAR_WIDTH: f32 = 180.;
|
||||
const GRAB_HANDLE_W: f32 = 48.;
|
||||
const MAX_SIDEBAR_WIDTH_RATIO: f32 = 0.5;
|
||||
|
||||
const RESIZE_HANDLE_WIDTH: f32 = 8.;
|
||||
|
||||
const ROW_GAP: f32 = 2.;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
Reference in New Issue
Block a user