fix(ui): 列を揃えて離した行を消す - #21
Merged
Merged
Conversation
3 つ直した。 画面に出る文字を英語にした。egui の既定フォントは Hack と Ubuntu-Light で、 日本語のグリフを 1 文字も持たない。実機では接続の表示も見出しも但し書きも 豆腐になっていた。UI に出るのは ui だけでなく timeline の警告と hid_source の エラーと config の警告も含むので、そちらも英語にした。 列の割り付けを egui に任せるのをやめた。allocate_ui_with_layout は要求した幅では なく実際に使った矩形のぶんだけ cursor を進めるので、名前の欄に固定幅を渡しても 同時押しの行で F の列が右にずれていた。等幅の 1 行に組んで桁を揃える。 離した区間の行を既定で出さないようにした。その行は持続 F しか持たず、読む行数 だけが倍になる。入力と入力の間合いは押下 F の差で読める。frametap.toml の show_released で戻せる。 方向名を numpad 表記にした。矢印は化けていなかったが、等幅の幅が保証されない。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更内容
frametap.tomlのshow_releasedで戻せるD↑がDP8、L↑がLS8になるなぜ
文字化け
egui の既定フォントは Hack と Ubuntu-Light と NotoEmoji で、日本語のグリフを 1 文字も持たない。
Cargo.tomlのeframeはdefault_fontsだけを有効にしている。接続の表示も見出しも但し書きも豆腐になっていた。画面に出るのは
uiの文字列だけではない。Timeline::scale_warningとhid_sourceのエラーとconfigの警告も、そのまま画面に出る。4 つとも英語にした。日本語のフォントを足す手もあったが採らなかった。Windows 10 以降で日本語のフォントは省略できる構成要素になっていて、入っていない環境がある。exe に埋め込むと 7MB が 12MB になる。この画面に日本語が要る理由が無い。
列がずれる
allocate_ui_with_layoutに名前の欄の幅を渡していたが、egui は要求した幅ではなく実際に使った矩形のぶんだけ cursor を進める。名前が長い行ほど後ろの 2 欄が右へずれる。割り付けを egui に任せるのをやめた。3 つの欄を等幅の 1 行に組む。名前を左詰め 20 文字、F を右詰め 6 文字ずつにする。20 文字は同時押し 4 つ (
L1 R1 DP8 Crossで 15 文字) が収まる幅になる。離した区間の行
その行は持続 F しか持たない。名前も押下 F も空欄になる。画面の行数が倍になり、読む対象が半分に薄まる。
間合いは押下 F の差で読める。どちらも試行の起点からの差なので、引けば空いた F が出る。
消さずに設定で残したのは、この判断が使ってみないと確かめられないため。
show_released = trueで戻る。方向名
矢印は化けていなかった。実機のスクリーンショットで
D↑は出ている。ただし等幅フォントで↑の送り幅が 1 文字ぶんである保証が無く、1 行を等幅で組む以上そこで桁が崩れる。numpad 表記なら ASCII で収まる。接頭辞を 2 文字にしたのは、左スティックを
LにするとL1が shoulder のL1と衝突するため。検証
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo test(107 件)cargo coupling --check --min-grade=B --max-circular=0 ./srcは Grade A (35%)桁が揃うことは
row_textの単体テストで押さえた。名前が 1 つの行と 3 つの行で、文字列の長さと F の位置が同じになる。画面の見え方そのものは Windows でしか確かめられない。実機で見るまで未検証になる。
Closes #20