Tint navigation tabs for visual distinction

This commit is contained in:
Dandaedre 2026-11-03 15:49:01 +01:00
parent e56934f6b7
commit 5256936bf4
3 changed files with 45 additions and 9 deletions

View File

@ -65,6 +65,27 @@ struct App {
replace_profile: bool,
resolution_dir: Option<PathBuf>,
}
fn navigation_tab(ui: &mut egui::Ui, label: &str, selected: bool) -> egui::Response {
let fill = if selected {
Color32::from_rgb(87, 68, 181)
} else {
Color32::from_rgb(43, 38, 66)
};
let text = if selected {
Color32::WHITE
} else {
Color32::from_rgb(196, 188, 235)
};
ui.add(
egui::Button::new(RichText::new(label).color(text))
.selected(selected)
.fill(fill)
.stroke(egui::Stroke::new(1.0_f32, Color32::from_rgb(74, 63, 116)))
.corner_radius(4.0),
)
}
impl Default for App {
fn default() -> Self {
Self {
@ -699,10 +720,16 @@ impl App {
ui.horizontal(|ui| {
ui.strong("Rundown converter");
ui.separator();
ui.selectable_value(&mut self.tab, Tab::Setup, "Setup");
ui.selectable_value(&mut self.tab, Tab::Review, "Review");
ui.selectable_value(&mut self.tab, Tab::Results, "Results");
ui.selectable_value(&mut self.tab, Tab::Details, "Details");
for (tab, label) in [
(Tab::Setup, "Setup"),
(Tab::Review, "Review"),
(Tab::Results, "Results"),
(Tab::Details, "Details"),
] {
if navigation_tab(ui, label, self.tab == tab).clicked() {
self.tab = tab;
}
}
});
});
egui::TopBottomPanel::bottom("action").show(ctx, |ui| {

View File

@ -406,12 +406,18 @@ impl App {
});
}
ui.horizontal_wrapped(|ui| {
ui.selectable_value(
&mut self.review_view,
ReviewView::Rows,
if navigation_tab(
ui,
"Schedule & corrections",
);
ui.selectable_value(&mut self.review_view, ReviewView::Columns, "Columns");
self.review_view == ReviewView::Rows,
)
.clicked()
{
self.review_view = ReviewView::Rows;
}
if navigation_tab(ui, "Columns", self.review_view == ReviewView::Columns).clicked() {
self.review_view = ReviewView::Columns;
}
if ui.button("Save resolutions…").clicked() {
self.resolutions_open = true;
}

View File

@ -55,6 +55,9 @@ cells marked as times display as `HH:MM:SS` in samples and the inspector; the
original stored value remains available in the inspector.
Review has two views:
The main navigation and Review view tabs use a subtle purple tint so they remain
visually distinct from labels and ordinary actions; the active tab uses the stronger accent.
- **Schedule & corrections** combines the schedule preview and row editing in one
table. Start/end/duration, titles, colored issues and row types are visible
together. Click anywhere on a source row or inferred gap to select it; a subtle tint marks