Tweak welcome design

Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
Nate Butler
2023-03-08 17:14:15 -05:00
co-authored by Mikayla Maki
parent cc33f83e4e
commit 344f59adf7
3 changed files with 53 additions and 20 deletions
+14
View File
@@ -855,6 +855,7 @@ pub struct FeedbackStyle {
#[derive(Clone, Deserialize, Default)]
pub struct WelcomeStyle {
pub page_width: f32,
pub logo: IconStyle,
pub logo_subheading: ContainedText,
pub checkbox: CheckboxStyle,
pub button: Interactive<ContainedText>,
@@ -863,6 +864,19 @@ pub struct WelcomeStyle {
pub checkbox_group: ContainerStyle,
}
#[derive(Clone, Deserialize, Default)]
pub struct IconStyle {
pub color: Color,
pub icon: String,
pub dimensions: Dimensions,
}
#[derive(Clone, Deserialize, Default)]
pub struct Dimensions {
pub width: f32,
pub height: f32,
}
#[derive(Clone, Deserialize, Default)]
pub struct CheckboxStyle {
pub check_icon: String,
+12 -5
View File
@@ -3,7 +3,7 @@ mod base_keymap_picker;
use std::borrow::Cow;
use gpui::{
elements::{Empty, Flex, Image, Label, MouseEventHandler, ParentElement, Svg},
elements::{Empty, Flex, Label, MouseEventHandler, ParentElement, Svg},
Action, Element, ElementBox, Entity, MouseButton, MutableAppContext, RenderContext,
Subscription, View, ViewContext,
};
@@ -56,10 +56,11 @@ impl View for WelcomePage {
.with_children([
Flex::column()
.with_children([
Image::new("images/zed-logo-90x90.png")
Svg::new(theme.welcome.logo.icon.clone())
.with_color(theme.welcome.logo.color)
.constrained()
.with_width(90.)
.with_height(90.)
.with_width(theme.welcome.logo.dimensions.width)
.with_height(theme.welcome.logo.dimensions.height)
.aligned()
.contained()
.aligned()
@@ -75,8 +76,10 @@ impl View for WelcomePage {
])
.contained()
.with_style(theme.welcome.heading_group)
.constrained()
.with_width(width)
.boxed(),
Flex::row()
Flex::column()
.with_children([
self.render_cta_button(
"Choose a theme",
@@ -99,6 +102,8 @@ impl View for WelcomePage {
])
.contained()
.with_style(theme.welcome.button_group)
.constrained()
.with_width(width)
.boxed(),
Flex::column()
.with_children([
@@ -119,6 +124,8 @@ impl View for WelcomePage {
])
.contained()
.with_style(theme.welcome.checkbox_group)
.constrained()
.with_width(width)
.boxed(),
])
.constrained()