Fix document and toolbar tab styling
This commit is contained in:
1 parent
1227fab860
commit
71a4f3061b
3 files changed
+4
-8
No files matched your search
@@ -298,13 +298,13 @@ pub fn tabs(app: &mut SolveApp, ui: &mut egui::Ui, r: Rect, x0: f32, x1: f32) {
|
|||||||
let response = ui.interact(home, ui.id().with("home_tab"), Sense::click());
|
let response = ui.interact(home, ui.id().with("home_tab"), Sense::click());
|
||||||
ui.painter().rect_filled(
|
ui.painter().rect_filled(
|
||||||
home,
|
home,
|
||||||
5.0,
|
egui::CornerRadius { nw: 5, ne: 5, sw: 0, se: 0 },
|
||||||
if app.home.open {
|
if app.home.open {
|
||||||
t.toolbar
|
t.toolbar
|
||||||
} else if response.hovered() {
|
} else if response.hovered() {
|
||||||
t.hover
|
t.hover
|
||||||
} else {
|
} else {
|
||||||
Color32::from_white_alpha(10)
|
t.app_bar
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
ui.painter().text(home.center(), Align2::CENTER_CENTER, "Home", FontId::proportional(13.0), if app.home.open { t.text } else { t.app_bar_text });
|
ui.painter().text(home.center(), Align2::CENTER_CENTER, "Home", FontId::proportional(13.0), if app.home.open { t.text } else { t.app_bar_text });
|
||||||
@@ -338,7 +338,7 @@ pub fn tabs(app: &mut SolveApp, ui: &mut egui::Ui, r: Rect, x0: f32, x1: f32) {
|
|||||||
} else if resp.hovered() {
|
} else if resp.hovered() {
|
||||||
Color32::from_white_alpha(28)
|
Color32::from_white_alpha(28)
|
||||||
} else {
|
} else {
|
||||||
Color32::from_white_alpha(10)
|
t.app_bar
|
||||||
};
|
};
|
||||||
ui.painter().rect_filled(tr, egui::CornerRadius { nw: 5, ne: 5, sw: 0, se: 0 }, fill);
|
ui.painter().rect_filled(tr, egui::CornerRadius { nw: 5, ne: 5, sw: 0, se: 0 }, fill);
|
||||||
let ink = if active { t.text } else { t.app_bar_text };
|
let ink = if active { t.text } else { t.app_bar_text };
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ pub fn is_dark() -> bool {
|
|||||||
pub struct Tokens {
|
pub struct Tokens {
|
||||||
pub app_bar: Color32,
|
pub app_bar: Color32,
|
||||||
pub toolbar: Color32,
|
pub toolbar: Color32,
|
||||||
pub tab_active: Color32,
|
|
||||||
pub panel: Color32,
|
pub panel: Color32,
|
||||||
pub panel_header: Color32,
|
pub panel_header: Color32,
|
||||||
pub border: Color32,
|
pub border: Color32,
|
||||||
@@ -132,7 +131,6 @@ impl Tokens {
|
|||||||
Tokens {
|
Tokens {
|
||||||
app_bar: Color32::from_rgb(52, 56, 64),
|
app_bar: Color32::from_rgb(52, 56, 64),
|
||||||
toolbar: Color32::from_rgb(246, 247, 249),
|
toolbar: Color32::from_rgb(246, 247, 249),
|
||||||
tab_active: Color32::from_rgb(255, 255, 255),
|
|
||||||
panel: Color32::from_rgb(250, 251, 252),
|
panel: Color32::from_rgb(250, 251, 252),
|
||||||
panel_header: Color32::from_rgb(236, 238, 242),
|
panel_header: Color32::from_rgb(236, 238, 242),
|
||||||
border: Color32::from_rgb(208, 212, 220),
|
border: Color32::from_rgb(208, 212, 220),
|
||||||
@@ -212,7 +210,6 @@ impl Tokens {
|
|||||||
let mut t = Tokens::light();
|
let mut t = Tokens::light();
|
||||||
t.app_bar = Color32::from_rgb(28, 31, 38);
|
t.app_bar = Color32::from_rgb(28, 31, 38);
|
||||||
t.toolbar = Color32::from_rgb(37, 41, 49);
|
t.toolbar = Color32::from_rgb(37, 41, 49);
|
||||||
t.tab_active = Color32::from_rgb(46, 52, 64);
|
|
||||||
t.panel = Color32::from_rgb(39, 43, 52);
|
t.panel = Color32::from_rgb(39, 43, 52);
|
||||||
t.panel_header = Color32::from_rgb(47, 52, 62);
|
t.panel_header = Color32::from_rgb(47, 52, 62);
|
||||||
t.border = Color32::from_rgb(63, 69, 82);
|
t.border = Color32::from_rgb(63, 69, 82);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ pub fn promoted(tab: &str, panel: &str) -> usize {
|
|||||||
|
|
||||||
pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {
|
pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||||
let t = Tokens::get();
|
let t = Tokens::get();
|
||||||
egui::Panel::top("sc_appbar").exact_size(34.0).frame(egui::Frame::NONE.fill(t.app_bar)).show(ui, |ui| {
|
egui::Panel::top("sc_appbar").exact_size(34.0).show_separator_line(false).frame(egui::Frame::NONE.fill(t.app_bar)).show(ui, |ui| {
|
||||||
let r = ui.max_rect();
|
let r = ui.max_rect();
|
||||||
// The bar is the window's title bar: its empty space moves the window.
|
// The bar is the window's title bar: its empty space moves the window.
|
||||||
if app.custom_titlebar || app.integrated_titlebar {
|
if app.custom_titlebar || app.integrated_titlebar {
|
||||||
@@ -305,7 +305,6 @@ pub fn toolbar(app: &mut SolveApp, ui: &mut egui::Ui) {
|
|||||||
let active = app.ui.tab == tab;
|
let active = app.ui.tab == tab;
|
||||||
let resp = ui.interact(tr, ui.id().with(("tab", tab)), Sense::click());
|
let resp = ui.interact(tr, ui.id().with(("tab", tab)), Sense::click());
|
||||||
if active {
|
if active {
|
||||||
painter.rect_filled(tr, egui::CornerRadius { nw: 4, ne: 4, sw: 0, se: 0 }, t.tab_active);
|
|
||||||
let c = if tab == "SKETCH" { t.sketch_accent } else { t.accent };
|
let c = if tab == "SKETCH" { t.sketch_accent } else { t.accent };
|
||||||
painter.line_segment([pos2(tr.left() + 4.0, tr.bottom() - 1.0), pos2(tr.right() - 4.0, tr.bottom() - 1.0)], Stroke::new(2.0, c));
|
painter.line_segment([pos2(tr.left() + 4.0, tr.bottom() - 1.0), pos2(tr.right() - 4.0, tr.bottom() - 1.0)], Stroke::new(2.0, c));
|
||||||
} else if resp.hovered() {
|
} else if resp.hovered() {
|
||||||
|
|||||||
Reference in new issue
Block a user