fix(properties): close color picker when a panel dropdown opens (#235)
The Properties panel color picker is a custom bool-driven dropdown, while Layer/Linetype/Lineweight are combo_boxes. Combo_boxes close each other on blur, but nothing closed the color picker — so opening the Layer dropdown while the color picker was open left both showing and overlapping. Give every panel combo_box an on_open handler that collapses the color picker, so at most one panel dropdown is open at a time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
1614fd9ab2
commit
d6e5b38847
3 changed files with 18 additions and 0 deletions
|
|
@ -1435,6 +1435,10 @@ pub enum Message {
|
||||||
PropAttrCommit(String),
|
PropAttrCommit(String),
|
||||||
/// Toggle the inline color picker dropdown open/closed.
|
/// Toggle the inline color picker dropdown open/closed.
|
||||||
PropColorPickerToggle,
|
PropColorPickerToggle,
|
||||||
|
/// Collapse the inline color picker dropdown. Fired when another
|
||||||
|
/// properties-panel dropdown (a combo_box) opens, so at most one panel
|
||||||
|
/// dropdown is open at a time and they can't overlap. (#235)
|
||||||
|
PropColorPickerClose,
|
||||||
/// Toggle the full ACI colour palette expansion.
|
/// Toggle the full ACI colour palette expansion.
|
||||||
PropColorPaletteToggle,
|
PropColorPaletteToggle,
|
||||||
/// Enter the model-space editing mode inside the given viewport (MSPACE).
|
/// Enter the model-space editing mode inside the given viewport (MSPACE).
|
||||||
|
|
|
||||||
|
|
@ -2123,6 +2123,13 @@ impl OpenCADStudio {
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Message::PropColorPickerClose => {
|
||||||
|
let i = self.active_tab;
|
||||||
|
self.tabs[i].properties.color_picker_open = false;
|
||||||
|
self.tabs[i].properties.color_palette_open = false;
|
||||||
|
Task::none()
|
||||||
|
}
|
||||||
|
|
||||||
Message::PropColorPaletteToggle => {
|
Message::PropColorPaletteToggle => {
|
||||||
self.tabs[self.active_tab].properties.color_palette_open =
|
self.tabs[self.active_tab].properties.color_palette_open =
|
||||||
!self.tabs[self.active_tab].properties.color_palette_open;
|
!self.tabs[self.active_tab].properties.color_palette_open;
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,7 @@ impl PropertiesPanel {
|
||||||
.size(FONT_SZ)
|
.size(FONT_SZ)
|
||||||
.padding([2, 6])
|
.padding([2, 6])
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
};
|
};
|
||||||
|
|
@ -387,6 +388,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
@ -489,6 +491,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
@ -509,6 +512,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
@ -542,6 +546,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
@ -574,6 +579,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
@ -655,6 +661,7 @@ impl PropertiesPanel {
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
})
|
})
|
||||||
.input_style(combo_input_style)
|
.input_style(combo_input_style)
|
||||||
|
.on_open(Message::PropColorPickerClose)
|
||||||
.width(Length::Fill);
|
.width(Length::Fill);
|
||||||
|
|
||||||
prop_row_widget(label, combo.into())
|
prop_row_widget(label, combo.into())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue