Enable Filter and Makeup cards in Effects tab across all camera models
This commit is contained in:
1 file changed
+45
-17
@@ -560,9 +560,8 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Card 3: `Makeup` (`ImageBeauty.qml`) (Link 2 / Link 2C only)
|
||||
// Card 3: `Makeup` (`ImageBeauty.qml`)
|
||||
// ------------------------------------------------------------------------
|
||||
if ctrl.model() != CameraModel::Link {
|
||||
ui.add_space(10.0_f32);
|
||||
ins_card(ui, theme, |ui| {
|
||||
if ins_switch_row(ui, "Makeup & Retouch", None, &mut state.makeup_enabled, true, theme) {
|
||||
@@ -576,12 +575,10 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Card 4: `Filter` (`ImageFilter.qml`) (Link 2 / Link 2C only)
|
||||
// Card 4: `Filter` (`ImageFilter.qml`)
|
||||
// ------------------------------------------------------------------------
|
||||
if ctrl.model() != CameraModel::Link {
|
||||
ui.add_space(10.0_f32);
|
||||
ins_card(ui, theme, |ui| {
|
||||
ins_section_header(ui, "Filter", theme, None);
|
||||
@@ -605,7 +602,8 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
let mut col = 0;
|
||||
for (mode, label) in FILTERS {
|
||||
let is_active = state.filter_mode == mode;
|
||||
let (rect, response) = ui.allocate_exact_size(Vec2::new(52.0_f32, 68.0_f32), Sense::click());
|
||||
let (rect, response) =
|
||||
ui.allocate_exact_size(Vec2::new(52.0_f32, 68.0_f32), Sense::click());
|
||||
let thumb_rect = Rect::from_min_size(rect.min, Vec2::new(52.0_f32, 50.0_f32));
|
||||
|
||||
let stroke = if is_active {
|
||||
@@ -617,15 +615,42 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
};
|
||||
|
||||
let (c1, c2) = match mode {
|
||||
FilterMode::None => (Color32::from_rgb(80, 80, 80), Color32::from_rgb(60, 60, 60)),
|
||||
FilterMode::Style1 => (Color32::from_rgb(255, 60, 180), Color32::from_rgb(0, 220, 255)),
|
||||
FilterMode::Style2 => (Color32::from_rgb(210, 160, 100), Color32::from_rgb(140, 90, 50)),
|
||||
FilterMode::Amber => (Color32::from_rgb(255, 170, 40), Color32::from_rgb(180, 90, 20)),
|
||||
FilterMode::Film1 => (Color32::from_rgb(255, 230, 150), Color32::from_rgb(100, 180, 240)),
|
||||
FilterMode::Fresh => (Color32::from_rgb(130, 230, 200), Color32::from_rgb(70, 160, 200)),
|
||||
FilterMode::Film2 => (Color32::from_rgb(255, 190, 180), Color32::from_rgb(200, 130, 150)),
|
||||
FilterMode::Cool => (Color32::from_rgb(80, 160, 255), Color32::from_rgb(40, 80, 180)),
|
||||
FilterMode::Warm => (Color32::from_rgb(255, 140, 60), Color32::from_rgb(200, 70, 30)),
|
||||
FilterMode::None => (
|
||||
Color32::from_rgb(80, 80, 80),
|
||||
Color32::from_rgb(60, 60, 60),
|
||||
),
|
||||
FilterMode::Style1 => (
|
||||
Color32::from_rgb(255, 60, 180),
|
||||
Color32::from_rgb(0, 220, 255),
|
||||
),
|
||||
FilterMode::Style2 => (
|
||||
Color32::from_rgb(210, 160, 100),
|
||||
Color32::from_rgb(140, 90, 50),
|
||||
),
|
||||
FilterMode::Amber => (
|
||||
Color32::from_rgb(255, 170, 40),
|
||||
Color32::from_rgb(180, 90, 20),
|
||||
),
|
||||
FilterMode::Film1 => (
|
||||
Color32::from_rgb(255, 230, 150),
|
||||
Color32::from_rgb(100, 180, 240),
|
||||
),
|
||||
FilterMode::Fresh => (
|
||||
Color32::from_rgb(130, 230, 200),
|
||||
Color32::from_rgb(70, 160, 200),
|
||||
),
|
||||
FilterMode::Film2 => (
|
||||
Color32::from_rgb(255, 190, 180),
|
||||
Color32::from_rgb(200, 130, 150),
|
||||
),
|
||||
FilterMode::Cool => (
|
||||
Color32::from_rgb(80, 160, 255),
|
||||
Color32::from_rgb(40, 80, 180),
|
||||
),
|
||||
FilterMode::Warm => (
|
||||
Color32::from_rgb(255, 140, 60),
|
||||
Color32::from_rgb(200, 70, 30),
|
||||
),
|
||||
};
|
||||
|
||||
ui.painter().rect_filled(thumb_rect, Rounding::same(6.0_f32), c1);
|
||||
@@ -641,7 +666,11 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
Align2::CENTER_CENTER,
|
||||
label,
|
||||
FontId::proportional(10.5_f32),
|
||||
if is_active { theme.brand_green } else { theme.text02 },
|
||||
if is_active {
|
||||
theme.brand_green
|
||||
} else {
|
||||
theme.text02
|
||||
},
|
||||
);
|
||||
|
||||
if response.clicked() {
|
||||
@@ -656,7 +685,6 @@ fn render_effects_tab<T: UvcControlTransport>(
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in new issue
Block a user