wip: segmented control
This commit is contained in:
1
src/asset/font_icon/file_braces_corner.svg
Normal file
1
src/asset/font_icon/file_braces_corner.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-braces-corner-icon lucide-file-braces-corner"><path d="M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1"/><path d="M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1"/></svg>
|
||||||
|
After Width: | Height: | Size: 562 B |
1
src/asset/font_icon/message_circle_more.svg
Normal file
1
src/asset/font_icon/message_circle_more.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-circle-more-icon lucide-message-circle-more"><path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/><path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/></svg>
|
||||||
|
After Width: | Height: | Size: 462 B |
@@ -43,6 +43,8 @@ define_font_icons!(
|
|||||||
Eye,
|
Eye,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
Star,
|
Star,
|
||||||
|
MessageCircleMore,
|
||||||
|
FileBracesCorner,
|
||||||
);
|
);
|
||||||
|
|
||||||
#[derive(gpui::IntoElement)]
|
#[derive(gpui::IntoElement)]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AppContext, InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled,
|
AppContext, InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled,
|
||||||
div, img, prelude::FluentBuilder,
|
div, img, linear_gradient, prelude::FluentBuilder,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -284,10 +284,7 @@ impl gpui::Render for PullRequestView {
|
|||||||
) -> impl gpui::IntoElement {
|
) -> impl gpui::IntoElement {
|
||||||
div().size_full().child(match &self.pull_request_query {
|
div().size_full().child(match &self.pull_request_query {
|
||||||
| Some(q) => match read_query(q, cx) {
|
| Some(q) => match read_query(q, cx) {
|
||||||
| QueryStatus::Loaded(pr) => match &self.diff_view {
|
| QueryStatus::Loaded(pr) => self.pr_content(pr, cx),
|
||||||
| Some(v) => v.clone().into_any_element(),
|
|
||||||
| None => self.pr_content(pr, cx),
|
|
||||||
},
|
|
||||||
|
|
||||||
| QueryStatus::Err(e) => div()
|
| QueryStatus::Err(e) => div()
|
||||||
.size_full()
|
.size_full()
|
||||||
@@ -331,17 +328,29 @@ impl gpui::RenderOnce for Toolbar {
|
|||||||
.border_b_1()
|
.border_b_1()
|
||||||
.border_color(theme.colors.border_muted)
|
.border_color(theme.colors.border_muted)
|
||||||
.child(
|
.child(
|
||||||
toolbar_button("pr-review-btn")
|
div()
|
||||||
.leading(font_icon(FontIcon::Eye))
|
.flex()
|
||||||
.mr_1(),
|
.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(
|
.child(
|
||||||
toolbar_button("pr-review-btn")
|
div()
|
||||||
.leading(font_icon(FontIcon::RefreshCw))
|
.px_2()
|
||||||
.mr_1(),
|
.py_1()
|
||||||
|
.bg(theme.colors.surface_elevated)
|
||||||
|
.child(font_icon(FontIcon::FileBracesCorner).size_3p5()),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.child(divider().bg(theme.colors.border).mr_1())
|
|
||||||
.child(toolbar_button("pr-review-btn").leading(font_icon(FontIcon::Star)))
|
|
||||||
.child(div().flex_1())
|
.child(div().flex_1())
|
||||||
.child(
|
.child(
|
||||||
toolbar_button("pr-close-btn")
|
toolbar_button("pr-close-btn")
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ pub(crate) fn latte() -> Theme {
|
|||||||
colors: ThemeColors {
|
colors: ThemeColors {
|
||||||
background: hex(0xeff1f5),
|
background: hex(0xeff1f5),
|
||||||
surface: hex(0xe6e9ef),
|
surface: hex(0xe6e9ef),
|
||||||
surface_elevated: hex(0xdce0e8),
|
surface_elevated: hex(0xeff1f5),
|
||||||
surface_chrome: hex(0xdce0e8),
|
surface_chrome: hex(0xdce0e8),
|
||||||
surface_hover: hex(0xdce0e8),
|
surface_hover: hex(0xdce0e8),
|
||||||
surface_active: hex(0xccd0da),
|
surface_active: hex(0xccd0da),
|
||||||
@@ -152,7 +152,7 @@ pub(crate) fn mocha() -> Theme {
|
|||||||
colors: ThemeColors {
|
colors: ThemeColors {
|
||||||
background: hex(0x1e1e2e),
|
background: hex(0x1e1e2e),
|
||||||
surface: hex(0x181825),
|
surface: hex(0x181825),
|
||||||
surface_elevated: hex(0x313244),
|
surface_elevated: hex(0x45475a),
|
||||||
surface_chrome: hex(0x11111b),
|
surface_chrome: hex(0x11111b),
|
||||||
surface_hover: hex(0x313244),
|
surface_hover: hex(0x313244),
|
||||||
surface_active: hex(0x45475a),
|
surface_active: hex(0x45475a),
|
||||||
|
|||||||
Reference in New Issue
Block a user