Refactor Git panel styling & status colors for consistency (#26951)

Closes #26847

Release Notes:

- Updated Git panel background to use panel_background instead of
ElevationIndex::Surface.bg(cx) for consistency with other panels.
- Removed redundant GitStatusColors struct from status.rs and refactored
to use existing theme colors.
- Adjusted Color enum mappings in color.rs to reference
version_control_* colors instead of status() for better alignment with
the theme system.
- Cleaned up unused or redundant code.
This commit is contained in:
Jakub Čermák 2025-03-19 15:26:36 +01:00 committed by GitHub
parent 2230f3b09d
commit 584a70ca5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 28 deletions

View file

@ -58,6 +58,16 @@ pub enum Color {
Selected,
/// A color used to indicate a successful operation or status.
Success,
/// A version control color used to indicate a newly added file or content in version control.
VersionControlAdded,
/// A version control color used to indicate conflicting changes that need resolution.
VersionControlConflict,
/// A version control color used to indicate a file or content that has been deleted in version control.
VersionControlDeleted,
/// A version control color used to indicate files or content that is being ignored by version control.
VersionControlIgnored,
/// A version control color used to indicate modified files or content in version control.
VersionControlModified,
/// A color used to indicate a warning condition.
Warning,
}
@ -84,6 +94,11 @@ impl Color {
Color::Error => cx.theme().status().error,
Color::Selected => cx.theme().colors().text_accent,
Color::Success => cx.theme().status().success,
Color::VersionControlAdded => cx.theme().colors().version_control_added,
Color::VersionControlConflict => cx.theme().colors().version_control_conflict,
Color::VersionControlDeleted => cx.theme().colors().version_control_deleted,
Color::VersionControlIgnored => cx.theme().colors().version_control_ignored,
Color::VersionControlModified => cx.theme().colors().version_control_modified,
Color::Warning => cx.theme().status().warning,
Color::Custom(color) => *color,
}