feat: add an option to enable navigation buttons
This commit is contained in:
@@ -54,6 +54,22 @@ impl Default for ThemeSettings {
|
||||
}
|
||||
}
|
||||
|
||||
/// Tab bar chrome.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct TabBarSettings {
|
||||
/// Hide the previous and next tab buttons.
|
||||
pub hide_navigation_buttons: bool,
|
||||
}
|
||||
|
||||
impl Default for TabBarSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
hide_navigation_buttons: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct GraspServersSettings {
|
||||
@@ -126,6 +142,7 @@ pub struct CreateRepositorySettings {
|
||||
pub struct Settings {
|
||||
pub appearance: AppearanceMode,
|
||||
pub theme: ThemeSettings,
|
||||
pub tab_bar: TabBarSettings,
|
||||
pub grasp_servers: GraspServersSettings,
|
||||
pub local_repos: LocalReposSettings,
|
||||
pub checkouts: CheckoutsSettings,
|
||||
|
||||
@@ -24,6 +24,12 @@ impl SettingsStore {
|
||||
cx.global::<GlobalSettingsStore>().0.clone()
|
||||
}
|
||||
|
||||
/// Retrieve the global settings store if one has been installed.
|
||||
pub fn try_global(cx: &App) -> Option<Entity<Self>> {
|
||||
cx.try_global::<GlobalSettingsStore>()
|
||||
.map(|store| store.0.clone())
|
||||
}
|
||||
|
||||
pub fn set_global(entity: Entity<Self>, cx: &mut App) {
|
||||
cx.set_global(GlobalSettingsStore(entity));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user