Add setting to hide onboarding banners (#29709)
Closes #28637 aka #29219. Release Notes: - Added `workspace.title_bar.show_onboarding_banner` preference to hide onboarding banners. - Relocated `workspace.show_user_picture` preference to `workspace.title_bar.show_user_picture`.
This commit is contained in:
parent
c92b2e31e1
commit
bd11bb5409
4 changed files with 21 additions and 11 deletions
|
@ -208,7 +208,10 @@ impl Render for TitleBar {
|
|||
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()),
|
||||
)
|
||||
.child(self.render_collaborator_list(window, cx))
|
||||
.child(self.banner.clone())
|
||||
.when(
|
||||
TitleBarSettings::get_global(cx).show_onboarding_banner,
|
||||
|title_bar| title_bar.child(self.banner.clone()),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
|
@ -723,7 +726,7 @@ impl TitleBar {
|
|||
h_flex()
|
||||
.gap_0p5()
|
||||
.children(
|
||||
workspace::WorkspaceSettings::get_global(cx)
|
||||
TitleBarSettings::get_global(cx)
|
||||
.show_user_picture
|
||||
.then(|| Avatar::new(user.avatar_uri.clone())),
|
||||
)
|
||||
|
|
|
@ -6,6 +6,8 @@ use settings::{Settings, SettingsSources};
|
|||
#[derive(Deserialize, Debug, Clone, Copy, PartialEq)]
|
||||
pub struct TitleBarSettings {
|
||||
pub show_branch_icon: bool,
|
||||
pub show_onboarding_banner: bool,
|
||||
pub show_user_picture: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
|
||||
|
@ -14,6 +16,14 @@ pub struct TitleBarSettingsContent {
|
|||
///
|
||||
/// Default: false
|
||||
pub show_branch_icon: Option<bool>,
|
||||
/// Whether to show onboarding banners in the title bar.
|
||||
///
|
||||
/// Default: true
|
||||
pub show_onboarding_banner: Option<bool>,
|
||||
/// Whether to show user avatar in the title bar.
|
||||
///
|
||||
/// Default: true
|
||||
pub show_user_picture: Option<bool>,
|
||||
}
|
||||
|
||||
impl Settings for TitleBarSettings {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue