Skip to content

Commit

Permalink
Right clicking the color in layers now restores default.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewBlanchard committed Jun 15, 2023
1 parent c4b0915 commit fb150f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/user_interface/gui/windows/layer_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl LayerList {
cur_color.unwrap_or(Color::default()).into();
let orig_color = color_array.clone();
ui.set_min_width(24.);
ui.color_edit_button_rgba_unmultiplied(&mut color_array);
let response = ui.color_edit_button_rgba_unmultiplied(&mut color_array);

if color_array != orig_color {
let active_layer = v.get_active_layer();
Expand All @@ -195,6 +195,12 @@ impl LayerList {

v.set_active_layer(active_layer);
}

if response.clicked_by(egui::PointerButton::Secondary) {
v.begin_modification("Changed layer color.", true);
v.get_active_layer_mut().color = None;
v.end_modification();
}
}

let layer_name = v.with_glyph(|g| g.layers[layer].name.clone());
Expand Down

0 comments on commit fb150f3

Please sign in to comment.