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 services;
|
||||||
mod shell;
|
mod shell;
|
||||||
mod shortcuts;
|
mod shortcuts;
|
||||||
@@ -18,6 +19,8 @@ use gpui_component_assets::Assets;
|
|||||||
use shell::ElyShell;
|
use shell::ElyShell;
|
||||||
use shortcuts::bind_shortcuts;
|
use shortcuts::bind_shortcuts;
|
||||||
|
|
||||||
|
use crate::brand::PRODUCT_NAME;
|
||||||
|
|
||||||
actions!(
|
actions!(
|
||||||
ely_app,
|
ely_app,
|
||||||
[
|
[
|
||||||
@@ -56,11 +59,11 @@ fn main() {
|
|||||||
cx.on_action(open_private_window);
|
cx.on_action(open_private_window);
|
||||||
cx.set_menus(vec![
|
cx.set_menus(vec![
|
||||||
Menu {
|
Menu {
|
||||||
name: "ELY Browser".into(),
|
name: PRODUCT_NAME.into(),
|
||||||
items: vec![
|
items: vec![
|
||||||
MenuItem::os_submenu("Services", SystemMenuType::Services),
|
MenuItem::os_submenu("Services", SystemMenuType::Services),
|
||||||
MenuItem::separator(),
|
MenuItem::separator(),
|
||||||
MenuItem::action("Quit ELY Browser", Quit),
|
MenuItem::action(format!("Quit {PRODUCT_NAME}"), Quit),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
Menu {
|
Menu {
|
||||||
@@ -140,7 +143,7 @@ enum BrowserWindowMode {
|
|||||||
impl BrowserWindowMode {
|
impl BrowserWindowMode {
|
||||||
fn title(self) -> &'static str {
|
fn title(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::Standard => "ELY Browser",
|
Self::Standard => PRODUCT_NAME,
|
||||||
Self::Private => "ELY Browser - Private",
|
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::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
||||||
use gpui_component::{IconName, StyledExt, scroll::ScrollableElement};
|
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};
|
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 APP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
const BUILD_REVISION: &str = env!("ELY_BUILD_REVISION");
|
const BUILD_REVISION: &str = env!("ELY_BUILD_REVISION");
|
||||||
const WORKSPACE_LICENSE: &str = env!("ELY_WORKSPACE_LICENSE");
|
const WORKSPACE_LICENSE: &str = env!("ELY_WORKSPACE_LICENSE");
|
||||||
@@ -46,7 +46,7 @@ fn render_about_header() -> AnyElement {
|
|||||||
.text_color(rgb(colors::INK))
|
.text_color(rgb(colors::INK))
|
||||||
.child(format!("About {PRODUCT_NAME}")),
|
.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(
|
.child(
|
||||||
div()
|
div()
|
||||||
@@ -71,7 +71,14 @@ fn render_about_rows(snapshot: &BrowserSnapshot) -> AnyElement {
|
|||||||
.overflow_y_scrollbar()
|
.overflow_y_scrollbar()
|
||||||
.border_t_1()
|
.border_t_1()
|
||||||
.border_color(rgb(colors::HAIRLINE))
|
.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::Info, "Version", APP_VERSION, "Cargo package version"))
|
||||||
.child(about_row(IconName::GitHub, "Build", BUILD_REVISION, "Git revision"))
|
.child(about_row(IconName::GitHub, "Build", BUILD_REVISION, "Git revision"))
|
||||||
.child(about_row(
|
.child(about_row(
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ use gpui_component::{
|
|||||||
scroll::ScrollableElement,
|
scroll::ScrollableElement,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use crate::brand::SYNC_SERVICE_NAME;
|
||||||
|
|
||||||
use super::{ElyShell, render_canvas_surface};
|
use super::{ElyShell, render_canvas_surface};
|
||||||
|
|
||||||
impl ElyShell {
|
impl ElyShell {
|
||||||
@@ -63,7 +65,10 @@ fn render_sync_header(snapshot: &BrowserSnapshot) -> AnyElement {
|
|||||||
.font_semibold()
|
.font_semibold()
|
||||||
.text_color(rgb(colors::MUTED))
|
.text_color(rgb(colors::MUTED))
|
||||||
.child(IconName::Globe)
|
.child(IconName::Globe)
|
||||||
.child(connection_label(snapshot.sync_status.connection())),
|
.child(format!(
|
||||||
|
"{SYNC_SERVICE_NAME}: {}",
|
||||||
|
connection_label(snapshot.sync_status.connection())
|
||||||
|
)),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ use ely_design_system::colors;
|
|||||||
use gpui::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
use gpui::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
||||||
use gpui_component::{IconName, StyledExt, scroll::ScrollableElement};
|
use gpui_component::{IconName, StyledExt, scroll::ScrollableElement};
|
||||||
|
|
||||||
|
use crate::brand::SYNC_SERVICE_NAME;
|
||||||
|
|
||||||
use super::{ElyShell, render_canvas_surface};
|
use super::{ElyShell, render_canvas_surface};
|
||||||
|
|
||||||
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
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(
|
.child(div().text_xs().truncate().text_color(rgb(colors::MUTED)).child(
|
||||||
format!(
|
format!(
|
||||||
"{} target through Elydora Cloud release APIs",
|
"{} target through {SYNC_SERVICE_NAME} release APIs",
|
||||||
release_target()
|
release_target()
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
|||||||
Reference in New Issue
Block a user