Skip to content

Commit 64a202a

Browse files
committed
main_and_subについてもドキュメントを追加
1 parent b3257cb commit 64a202a

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

json/howToMake.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
```json
4646
"design": {
4747
"label": {
48+
"type": "text",
4849
"text": "@#/&_"
4950
},
5051
"color": "normal"
@@ -53,10 +54,11 @@
5354

5455
`"label"`はキーに表示されるラベルです。ラベルに指定できる値は次の通りです。
5556

56-
| 項目 | 説明 |
57+
| type | 説明 |
5758
| ----------------- | ------------------------------------------------------------ |
58-
| text: str | 指定した文字をラベルとして表示します。 |
59-
| system_image: str | 指定した画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
59+
| text | `"text"`に指定した文字をラベルとして表示します。 |
60+
| main_and_sub | `"main"`に指定した1文字を1行目に大きめに、`"sub"`に指定した文字列を2行目に小さめに表示します。 |
61+
| system_image | `"system_image"`に指定した画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
6062

6163
<img src="../resource/symbols.png" style="zoom:15%;" />
6264

python/howToMake.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ design = KeyDesign(
4646
| オブジェクト | 初期化の引数 | 説明 |
4747
| ---------------- | --------------- | ------------------------------------------------------------ |
4848
| TextLabel | text: str | 指定した文字をラベルとして表示します。 |
49+
| MainAndSubLabel | main: str, sub: str | `main`に指定した1文字を1行目に大きめに、`sub`に指定した文字を2行目に小さめに表示します。 |
4950
| SystemImageLabel | identifier: str | 指定した名前の画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
5051

5152
<img src="../resource/symbols.png" style="zoom:15%;" />

python/source/design.py

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ class SystemImageLabel(KeyLabel):
2323
def __init__(self, identifier: str):
2424
self.system_image = identifier
2525

26+
class MainAndSubLabel(KeyLabel):
27+
def __init__(self, main: str, sub: str):
28+
self.type = "main_and_sub"
29+
self.main = main
30+
self.sub = sub
31+
2632

2733
class KeyDesign:
2834
def __init__(self, label: KeyLabel, color: KeyColor):

python/test/test_design.py

+11
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ def test_SystemImageLabel(self):
4343
}
4444
self.assertEqual(expected_json, to_json(label))
4545

46+
def test_MainAndSubLabel(self):
47+
"""test method for SystemImageLabel
48+
"""
49+
label = MainAndSubLabel(main="A", sub="BC")
50+
expected_json = {
51+
"type": "main_and_sub",
52+
"main": "A",
53+
"sub": "BC"
54+
}
55+
self.assertEqual(expected_json, to_json(label))
56+
4657
def test_KeyDesign(self):
4758
"""test method for KeyDesign
4859
"""

swift/howToMake.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ design: .init(label: .text("@#/&_"), color: .normal)
3838
| 項目 | 説明 |
3939
| -------------------- | ------------------------------------------------------------ |
4040
| .text(String) | 指定した文字をラベルとして表示します。 |
41+
| .mainAndSub(String, String) | 1つ目に指定した1文字を1行目に大きめに、2つ目に指定した文字を2行目に小さめに表示します。 |
4142
| .systemImage(String) | 指定した名前の画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
4243

4344
<img src="../resource/symbols.png" style="zoom:15%;" />

0 commit comments

Comments
 (0)