column: use simplified column string titles for now
even though we will replace this soon, it is still technically more correct than Timeline(1), etc
This commit is contained in:
@@ -249,7 +249,7 @@ pub fn render_nav(col: usize, app: &mut Damus, ui: &mut egui::Ui) -> RenderNavRe
|
|||||||
.returning(app.columns_mut().column_mut(col).router_mut().returning)
|
.returning(app.columns_mut().column_mut(col).router_mut().returning)
|
||||||
.id_source(egui::Id::new(col_id))
|
.id_source(egui::Id::new(col_id))
|
||||||
.show_mut(ui, |ui, render_type, nav| match render_type {
|
.show_mut(ui, |ui, render_type, nav| match render_type {
|
||||||
NavUiType::Title => NavTitle::new(nav.routes_arr()).show(ui),
|
NavUiType::Title => NavTitle::new(&app.columns, nav.routes_arr()).show(ui),
|
||||||
NavUiType::Body => render_nav_body(ui, app, nav.routes().last().expect("top"), col),
|
NavUiType::Body => render_nav_body(ui, app, nav.routes().last().expect("top"), col),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
app_style::{get_font_size, NotedeckTextStyle},
|
app_style::{get_font_size, NotedeckTextStyle},
|
||||||
|
column::Columns,
|
||||||
fonts::NamedFontFamily,
|
fonts::NamedFontFamily,
|
||||||
nav::RenderNavAction,
|
nav::RenderNavAction,
|
||||||
route::Route,
|
route::Route,
|
||||||
@@ -9,12 +10,13 @@ use crate::{
|
|||||||
use egui::{pos2, Color32, Stroke};
|
use egui::{pos2, Color32, Stroke};
|
||||||
|
|
||||||
pub struct NavTitle<'a> {
|
pub struct NavTitle<'a> {
|
||||||
|
columns: &'a Columns,
|
||||||
routes: &'a [Route],
|
routes: &'a [Route],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> NavTitle<'a> {
|
impl<'a> NavTitle<'a> {
|
||||||
pub fn new(routes: &'a [Route]) -> Self {
|
pub fn new(columns: &'a Columns, routes: &'a [Route]) -> Self {
|
||||||
NavTitle { routes }
|
NavTitle { columns, routes }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show(&mut self, ui: &mut egui::Ui) -> Option<RenderNavAction> {
|
pub fn show(&mut self, ui: &mut egui::Ui) -> Option<RenderNavAction> {
|
||||||
@@ -177,7 +179,7 @@ impl<'a> NavTitle<'a> {
|
|||||||
|
|
||||||
let title_galley = ui.fonts(|f| {
|
let title_galley = ui.fonts(|f| {
|
||||||
f.layout(
|
f.layout(
|
||||||
top.to_string(),
|
top.title(self.columns).to_string(),
|
||||||
font,
|
font,
|
||||||
ui.visuals().text_color(),
|
ui.visuals().text_color(),
|
||||||
max_title_width,
|
max_title_width,
|
||||||
|
|||||||
Reference in New Issue
Block a user