forked from 1b-agent/opencadstudio-upstream
feat(dyn-input): TAB-editable distance/angle/coordinate fields
Dinamik giriş artık cursor yanında düzenlenebilir kutular gösteriyor. TAB ile kutular arası geçilir, bir kutuya yazınca o kutu kilitlenir (değer sabitlenir), diğerleri cursor'ı takip etmeye devam eder, Enter ile çözülen nokta komuta point-pick olarak iletilir. - DocumentTab.dyn_fields / dyn_active state; DynComponent + DynFieldEntry - sync_dyn_fields komutun dyn_field() + base noktasına göre kutu kümesini türetir: nokta+base → [d, açı], nokta+base yok → [X, Y], radius → [d], açı → [açı] - klavye yönlendirme: rakam/./-/+ aktif kutuya, TAB sonraki kutuya, Enter try_dyn_commit, Backspace kilidi açar - dyn_capturing iken command-line text alanı on_input'suz bırakılıyor ki focus'u ve tuşları çalmasın; girişler global key aboneliğinden geliyor (numpad dahil text alanı üzerinden yakalanıyor) - çoklu-kutu overlay render: aktif kutu vurgulu, kilitli kutu farklı kenar rengi Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
1fc73ba8b0
commit
4abde6001a
6 files changed
+377
-103
No files matched your search
+12
-5
@@ -226,7 +226,7 @@ impl CommandLine {
|
||||
matches
|
||||
}
|
||||
|
||||
pub fn view(&self, show_autocomplete: bool) -> Element<'_, Message> {
|
||||
pub fn view(&self, show_autocomplete: bool, dyn_capturing: bool) -> Element<'_, Message> {
|
||||
// Only the most recent entries pushed within the last few
|
||||
// seconds show on the overlay. The dropdown button keeps the
|
||||
// full backlog reachable when the user actually wants it.
|
||||
@@ -248,10 +248,17 @@ impl CommandLine {
|
||||
col.push(container(text(&entry.text).size(11).color(color)).padding([1, 8]))
|
||||
});
|
||||
let prompt = container(text("Command:").size(11).color(PROMPT_COLOR)).padding([5, 8]);
|
||||
let input = text_input("", &self.input)
|
||||
.id(cmd_input_id())
|
||||
.on_input(Message::CommandInput)
|
||||
.on_submit(Message::CommandSubmit)
|
||||
// While dynamic input is capturing keystrokes, the command-line
|
||||
// text field is left without an `on_input` handler so it can't
|
||||
// grab focus or swallow numeric keys — those flow through the
|
||||
// global key subscription into the dynamic-input fields instead.
|
||||
let mut input = text_input("", &self.input).id(cmd_input_id());
|
||||
if !dyn_capturing {
|
||||
input = input
|
||||
.on_input(Message::CommandInput)
|
||||
.on_submit(Message::CommandSubmit);
|
||||
}
|
||||
let input = input
|
||||
.style(|_: &Theme, _| text_input::Style {
|
||||
background: Background::Color(INPUT_BG),
|
||||
border: Border {
|
||||
|
||||
Reference in new issue
Block a user