Merge pull request #869 from vangel76/fix-864-track-matte-mode
Track Matte: picking a mode without a matte layer takes the layer above (#864)
This commit is contained in:
@@ -314,6 +314,11 @@ fn field(ui: &mut Ui, rect: Rect, text: &mut String, hint: &str, t: &Tokens, sea
|
||||
|
||||
/// Dropdown-looking control ("Full ▾").
|
||||
pub fn dropdown(ui: &mut Ui, rect: Rect, text: &str, t: &Tokens, id: egui::Id) -> Response {
|
||||
dropdown_tip(ui, rect, text, None, t, id)
|
||||
}
|
||||
|
||||
/// [`dropdown`] with a tooltip `tip` (shown always; it replaces the elided text's tooltip).
|
||||
pub fn dropdown_tip(ui: &mut Ui, rect: Rect, text: &str, tip: Option<&str>, t: &Tokens, id: egui::Id) -> Response {
|
||||
let resp = ui.interact(rect, id, Sense::click());
|
||||
ui.painter().rect_filled(rect, 3.0, if resp.hovered() { t.hover } else { t.field_bg });
|
||||
ui.painter().rect_stroke(rect, 3.0, Stroke::new(1.0, t.field_border), StrokeKind::Inside);
|
||||
@@ -335,6 +340,9 @@ pub fn dropdown(ui: &mut Ui, rect: Rect, text: &str, t: &Tokens, id: egui::Id) -
|
||||
};
|
||||
ui.painter().text(pos2(rect.min.x + 7.0, rect.center().y), Align2::LEFT_CENTER, shown, Tokens::ui(11.5), t.text);
|
||||
icons::paint(ui.painter(), Rect::from_center_size(pos2(rect.max.x - 9.0, rect.center().y), vec2(8.0, 8.0)), Icon::ChevronDown, t.text_dim);
|
||||
if let Some(tip) = tip {
|
||||
return resp.on_hover_text(tip.to_string());
|
||||
}
|
||||
if text.chars().count() > 0 && !fits(text) {
|
||||
return resp.on_hover_text(text.to_string());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user