Centralize app brand identity
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
pub(crate) const PRODUCT_NAME: &str = "ELY Browser";
|
||||
pub(crate) const FORMAL_PRODUCT_NAME: &str = "ELY Browser by Elydora";
|
||||
pub(crate) const COMPANY_NAME: &str = "Elydora";
|
||||
pub(crate) const SYNC_SERVICE_NAME: &str = "Elydora Cloud";
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{COMPANY_NAME, FORMAL_PRODUCT_NAME, PRODUCT_NAME, SYNC_SERVICE_NAME};
|
||||
|
||||
#[test]
|
||||
fn brand_identity_matches_prd_names() {
|
||||
assert_eq!(PRODUCT_NAME, "ELY Browser");
|
||||
assert_eq!(FORMAL_PRODUCT_NAME, "ELY Browser by Elydora");
|
||||
assert_eq!(COMPANY_NAME, "Elydora");
|
||||
assert_eq!(SYNC_SERVICE_NAME, "Elydora Cloud");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
mod brand;
|
||||
mod services;
|
||||
mod shell;
|
||||
mod shortcuts;
|
||||
@@ -18,6 +19,8 @@ use gpui_component_assets::Assets;
|
||||
use shell::ElyShell;
|
||||
use shortcuts::bind_shortcuts;
|
||||
|
||||
use crate::brand::PRODUCT_NAME;
|
||||
|
||||
actions!(
|
||||
ely_app,
|
||||
[
|
||||
@@ -56,11 +59,11 @@ fn main() {
|
||||
cx.on_action(open_private_window);
|
||||
cx.set_menus(vec![
|
||||
Menu {
|
||||
name: "ELY Browser".into(),
|
||||
name: PRODUCT_NAME.into(),
|
||||
items: vec![
|
||||
MenuItem::os_submenu("Services", SystemMenuType::Services),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Quit ELY Browser", Quit),
|
||||
MenuItem::action(format!("Quit {PRODUCT_NAME}"), Quit),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
@@ -140,7 +143,7 @@ enum BrowserWindowMode {
|
||||
impl BrowserWindowMode {
|
||||
fn title(self) -> &'static str {
|
||||
match self {
|
||||
Self::Standard => "ELY Browser",
|
||||
Self::Standard => PRODUCT_NAME,
|
||||
Self::Private => "ELY Browser - Private",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ use ely_design_system::colors;
|
||||
use gpui::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
||||
use gpui_component::{IconName, StyledExt, scroll::ScrollableElement};
|
||||
|
||||
use crate::brand::{COMPANY_NAME, FORMAL_PRODUCT_NAME, PRODUCT_NAME, SYNC_SERVICE_NAME};
|
||||
|
||||
use super::{ElyShell, render_canvas_surface};
|
||||
|
||||
const PRODUCT_NAME: &str = "ELY Browser";
|
||||
const COMPANY_NAME: &str = "Elydora";
|
||||
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
const BUILD_REVISION: &str = env!("ELY_BUILD_REVISION");
|
||||
const WORKSPACE_LICENSE: &str = env!("ELY_WORKSPACE_LICENSE");
|
||||
@@ -46,7 +46,7 @@ fn render_about_header() -> AnyElement {
|
||||
.text_color(rgb(colors::INK))
|
||||
.child(format!("About {PRODUCT_NAME}")),
|
||||
)
|
||||
.child(div().text_sm().text_color(rgb(colors::MUTED)).child(COMPANY_NAME)),
|
||||
.child(div().text_sm().text_color(rgb(colors::MUTED)).child(FORMAL_PRODUCT_NAME)),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
@@ -71,7 +71,14 @@ fn render_about_rows(snapshot: &BrowserSnapshot) -> AnyElement {
|
||||
.overflow_y_scrollbar()
|
||||
.border_t_1()
|
||||
.border_color(rgb(colors::HAIRLINE))
|
||||
.child(about_row(IconName::Building2, "Product", PRODUCT_NAME, COMPANY_NAME))
|
||||
.child(about_row(
|
||||
IconName::Building2,
|
||||
"Product",
|
||||
FORMAL_PRODUCT_NAME,
|
||||
"Native Rust desktop browser",
|
||||
))
|
||||
.child(about_row(IconName::Building2, "Publisher", COMPANY_NAME, "Brand owner"))
|
||||
.child(about_row(IconName::Globe, "Service", SYNC_SERVICE_NAME, "Sync and release service"))
|
||||
.child(about_row(IconName::Info, "Version", APP_VERSION, "Cargo package version"))
|
||||
.child(about_row(IconName::GitHub, "Build", BUILD_REVISION, "Git revision"))
|
||||
.child(about_row(
|
||||
|
||||
@@ -14,6 +14,8 @@ use gpui_component::{
|
||||
scroll::ScrollableElement,
|
||||
};
|
||||
|
||||
use crate::brand::SYNC_SERVICE_NAME;
|
||||
|
||||
use super::{ElyShell, render_canvas_surface};
|
||||
|
||||
impl ElyShell {
|
||||
@@ -63,7 +65,10 @@ fn render_sync_header(snapshot: &BrowserSnapshot) -> AnyElement {
|
||||
.font_semibold()
|
||||
.text_color(rgb(colors::MUTED))
|
||||
.child(IconName::Globe)
|
||||
.child(connection_label(snapshot.sync_status.connection())),
|
||||
.child(format!(
|
||||
"{SYNC_SERVICE_NAME}: {}",
|
||||
connection_label(snapshot.sync_status.connection())
|
||||
)),
|
||||
)
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ use ely_design_system::colors;
|
||||
use gpui::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
||||
use gpui_component::{IconName, StyledExt, scroll::ScrollableElement};
|
||||
|
||||
use crate::brand::SYNC_SERVICE_NAME;
|
||||
|
||||
use super::{ElyShell, render_canvas_surface};
|
||||
|
||||
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
@@ -99,7 +101,7 @@ fn render_updates_summary() -> AnyElement {
|
||||
)
|
||||
.child(div().text_xs().truncate().text_color(rgb(colors::MUTED)).child(
|
||||
format!(
|
||||
"{} target through Elydora Cloud release APIs",
|
||||
"{} target through {SYNC_SERVICE_NAME} release APIs",
|
||||
release_target()
|
||||
),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user