Skip to content

Commit ce8a5d7

Browse files
committed
Update colour scheme and clean up after changes introduced in #10777
1 parent 2104176 commit ce8a5d7

File tree

5 files changed

+20
-32
lines changed

5 files changed

+20
-32
lines changed

crates/viewer/re_dataframe_ui/src/filter_ui.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::sync::Arc;
2-
31
use egui::{Frame, Margin, Style, text::LayoutJob};
42

53
use re_ui::{SyntaxHighlighting, UiExt as _, syntax_highlighting::SyntaxHighlightedBuilder};
@@ -164,13 +162,10 @@ impl Filter {
164162
.stroke(ui.tokens().table_filter_frame_stroke)
165163
.corner_radius(2.0)
166164
.show(ui, |ui| {
167-
let widget_text = SyntaxHighlightedBuilder::new(Arc::clone(ui.style()))
165+
let widget_text = SyntaxHighlightedBuilder::new(ui.style())
168166
.append(&self.column_name)
169167
.append(&" ")
170-
.append(&SyntaxHighlightFilterOperation {
171-
ui,
172-
filter_operation: &self.operation,
173-
})
168+
.append(&self.operation)
174169
.into_widget_text();
175170

176171
let text_response = ui.add(
@@ -249,35 +244,27 @@ impl Filter {
249244
}
250245
}
251246

252-
//TODO(#10777): this wrapper will no longer be needed with the updated `SyntaxHighlighting` trait
253-
struct SyntaxHighlightFilterOperation<'a> {
254-
ui: &'a mut egui::Ui,
255-
filter_operation: &'a FilterOperation,
256-
}
257-
258-
impl SyntaxHighlighting for SyntaxHighlightFilterOperation<'_> {
247+
impl SyntaxHighlighting for FilterOperation {
259248
fn syntax_highlight_into(&self, style: &Style, job: &mut LayoutJob) {
249+
let tokens = re_ui::design_tokens_of_visuals(&style.visuals);
250+
260251
let normal_text_format = egui::TextFormat::simple(
261252
egui::TextStyle::Body.resolve(style),
262253
egui::Color32::PLACEHOLDER,
263254
);
264255
let operator_text_format = egui::TextFormat::simple(
265256
egui::TextStyle::Body.resolve(style),
266-
self.ui.tokens().table_filter_operator_text_color,
257+
tokens.table_filter_operator_text_color,
267258
);
268259
let rhs_text_format = egui::TextFormat::simple(
269260
egui::TextStyle::Body.resolve(style),
270-
self.ui.tokens().table_filter_rhs_text_color,
261+
tokens.table_filter_rhs_text_color,
271262
);
272263

273-
job.append(
274-
self.filter_operation.operator_text(),
275-
0.0,
276-
operator_text_format,
277-
);
264+
job.append(self.operator_text(), 0.0, operator_text_format);
278265

279266
job.append(" ", 0.0, normal_text_format.clone());
280-
let rhs_text = self.filter_operation.rhs_text();
267+
let rhs_text = self.rhs_text();
281268
job.append(
282269
if rhs_text.is_empty() {
283270
"…"
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

crates/viewer/re_ui/data/dark_theme.ron

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,16 @@
280280
"color": "#818EF8"
281281
},
282282

283-
//TODO(#10777): reuse the same color schema as the one introduced for arrow syntax highlighting
283+
// TODO(ab, katya): review these
284284
"table_filter_frame_stroke": {
285285
"color": "{Gray.400}",
286286
"width": 1
287287
},
288288
"table_filter_operator_text_color": {
289-
"color": "{Blue.525}",
289+
"color": "#818EF8",
290290
},
291291
"table_filter_rhs_text_color": {
292-
"color": "{Purple.525}",
292+
"color": "#4ACB94",
293293
}
294294
},
295295

crates/viewer/re_ui/data/light_theme.ron

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
"color": "{Gray.250}"
270270
},
271271

272+
// TODO(ab, lucas, katya): review these
272273
"code_index": {
273274
"color": "#BF68AF"
274275
},
@@ -279,16 +280,16 @@
279280
"color": "#7782EA"
280281
},
281282

282-
//TODO(#10777): reuse the same color schema as the one introduced for arrow syntax highlighting
283+
// TODO(ab, katya): review these
283284
"table_filter_frame_stroke": {
284285
"color": "{Gray.400}",
285286
"width": 1
286287
},
287288
"table_filter_operator_text_color": {
288-
"color": "{Blue.525}",
289+
"color": "#7782EA",
289290
},
290291
"table_filter_rhs_text_color": {
291-
"color": "{Purple.525}",
292+
"color": "#32AA79",
292293
}
293294
},
294295

0 commit comments

Comments
 (0)