GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
cce-ui: Remove ccec config path and fix child widget font propagation
src/color.rs | 1 -
src/layout.rs | 6 +++---
src/widget/container/paginator.rs | 2 +-
src/widget/display/graph.rs | 1 -
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/color.rs b/src/color.rs
index ed89b5e..9037d00 100644
--- a/src/color.rs
+++ b/src/color.rs
@@ -77,7 +77,6 @@ pub fn node_drag_color() -> [f32; 4] {
fn read_config() -> Option<String> {
let paths = [
"/home/lsgalante/.config/cce/config.json",
- "/home/lsgalante/.config/ccec/config.json",
];
for path in &paths {
if let Ok(content) = std::fs::read_to_string(path) {
diff --git a/src/layout.rs b/src/layout.rs
index 62efe1d..0c909bd 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -5,7 +5,6 @@ use std::sync::RwLock;
fn read_config() -> Option<String> {
let paths = [
"/home/lsgalante/.config/cce/config.json",
- "/home/lsgalante/.config/ccec/config.json",
];
for path in &paths {
if let Ok(content) = std::fs::read_to_string(path) {
@@ -1871,14 +1870,15 @@ pub fn render_widget<T: Element + 'static>(pc: &mut dyn RenderTarget, w: &mut T,
}
}
let font_opt = w.widget_font();
- for (label, bounds) in w.text_labels_with_bounds(ctx) {
+ for (label, font, bounds) in w.text_labels_with_font_and_bounds(ctx) {
let color_f32 = [
label.color[0] as f32 / 255.0,
label.color[1] as f32 / 255.0,
label.color[2] as f32 / 255.0,
1.0,
];
- if let Some(ref font) = font_opt {
+ let active_font = font.or_else(|| font_opt.clone());
+ if let Some(ref font) = active_font {
pc.text_with_font_and_bounds(&label.text, label.x, label.y, label.font_size, color_f32, font, bounds);
} else {
pc.text_with_bounds(&label.text, label.x, label.y, label.font_size, color_f32, bounds);
diff --git a/src/widget/container/paginator.rs b/src/widget/container/paginator.rs
index cc279fa..134ddcf 100644
--- a/src/widget/container/paginator.rs
+++ b/src/widget/container/paginator.rs
@@ -1176,7 +1176,7 @@ mod tests {
#[test]
fn test_paginator_rotated_tabs() {
- // Force initialization from ccec/config.toml so Once won't overwrite our test values
+ // Force initialization from cce/config.json so Once won't overwrite our test values
let orig_margin_x = crate::layout::paginator_tab_margin_x();
let orig_margin_y = crate::layout::paginator_tab_margin_y();
let orig_padding_x = crate::layout::paginator_tab_padding_x();
diff --git a/src/widget/display/graph.rs b/src/widget/display/graph.rs
index b28e8e3..0afff61 100644
--- a/src/widget/display/graph.rs
+++ b/src/widget/display/graph.rs
@@ -197,7 +197,6 @@ fn read_zoom_bindings() -> (String, String) {
let mut zoom_out_val = "-".to_string();
let paths = [
"/home/lsgalante/.config/cce/config.json",
- "/home/lsgalante/.config/ccec/config.json",
];
for path in &paths {
if let Ok(content) = std::fs::read_to_string(path) {