wip: segmented control
This commit is contained in:
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use gpui::{
|
||||
AppContext, InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled,
|
||||
div, img, prelude::FluentBuilder,
|
||||
div, img, linear_gradient, prelude::FluentBuilder,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@@ -284,10 +284,7 @@ impl gpui::Render for PullRequestView {
|
||||
) -> impl gpui::IntoElement {
|
||||
div().size_full().child(match &self.pull_request_query {
|
||||
| Some(q) => match read_query(q, cx) {
|
||||
| QueryStatus::Loaded(pr) => match &self.diff_view {
|
||||
| Some(v) => v.clone().into_any_element(),
|
||||
| None => self.pr_content(pr, cx),
|
||||
},
|
||||
| QueryStatus::Loaded(pr) => self.pr_content(pr, cx),
|
||||
|
||||
| QueryStatus::Err(e) => div()
|
||||
.size_full()
|
||||
@@ -331,17 +328,29 @@ impl gpui::RenderOnce for Toolbar {
|
||||
.border_b_1()
|
||||
.border_color(theme.colors.border_muted)
|
||||
.child(
|
||||
toolbar_button("pr-review-btn")
|
||||
.leading(font_icon(FontIcon::Eye))
|
||||
.mr_1(),
|
||||
div()
|
||||
.flex()
|
||||
.flex_row()
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.border_t_1()
|
||||
.border_color(theme.colors.border_strong)
|
||||
.rounded_sm()
|
||||
.child(
|
||||
div()
|
||||
.px_2()
|
||||
.py_1()
|
||||
.bg(theme.colors.surface_elevated)
|
||||
.child(font_icon(FontIcon::MessageCircleMore).size_3p5()),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.px_2()
|
||||
.py_1()
|
||||
.bg(theme.colors.surface_elevated)
|
||||
.child(font_icon(FontIcon::FileBracesCorner).size_3p5()),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
toolbar_button("pr-review-btn")
|
||||
.leading(font_icon(FontIcon::RefreshCw))
|
||||
.mr_1(),
|
||||
)
|
||||
.child(divider().bg(theme.colors.border).mr_1())
|
||||
.child(toolbar_button("pr-review-btn").leading(font_icon(FontIcon::Star)))
|
||||
.child(div().flex_1())
|
||||
.child(
|
||||
toolbar_button("pr-close-btn")
|
||||
|
||||
Reference in New Issue
Block a user