Skip to content

Commit 68363a9

Browse files
committed
Release v0.2.0
1 parent b09b1a6 commit 68363a9

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "koreui"
7-
version = "0.1.4"
7+
version = "0.2.0"
88
description = "Dynamic GUI Generator from JSON Schema"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .kore import JsonSchemaForm
22
from .loader import load_schema
33

4-
__version__ = "0.1.4"
4+
__version__ = "0.2.0"
55

66
__all__ = ["JsonSchemaForm", "load_schema"]

src/kore.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -969,16 +969,17 @@ def __init__(self, schema: Dict[str, Any], resolver: SchemaResolver, validator:
969969
layout = QVBoxLayout(self)
970970

971971
# Add title/description if specified
972-
if "title" in schema:
973-
title_label = QLabel(schema["title"])
974-
title_label.setProperty("class", "title")
975-
layout.addWidget(title_label)
976-
977-
if "description" in schema:
978-
desc_label = QLabel(schema["description"])
979-
desc_label.setProperty("class", "description")
980-
desc_label.setWordWrap(True)
981-
layout.addWidget(desc_label)
972+
if path:
973+
if "title" in schema:
974+
title_label = QLabel(schema["title"])
975+
title_label.setProperty("class", "title")
976+
layout.addWidget(title_label)
977+
978+
if "description" in schema:
979+
desc_label = QLabel(schema["description"])
980+
desc_label.setProperty("class", "description")
981+
desc_label.setWordWrap(True)
982+
layout.addWidget(desc_label)
982983

983984
self.items_schema = schema.get("items", {})
984985
self.min_items = schema.get("minItems", 0)
@@ -1218,20 +1219,17 @@ def __init__(self, schema: Dict[str, Any], resolver: SchemaResolver, validator:
12181219

12191220
for prop_name, prop_schema in properties.items():
12201221
prop_path = f"{path}.{prop_name}" if path else prop_name
1221-
1222-
label_text = self._get_property_label(prop_name, prop_schema, prop_name in required)
1223-
label = QLabel(label_text)
1224-
1225-
if prop_name in required:
1226-
label.setProperty("class", "required")
1227-
1228-
if "description" in prop_schema:
1229-
desc_label = QLabel(prop_schema["description"])
1230-
desc_label.setStyleSheet("color: gray; font-size: 10px; font-style: italic; margin-bottom: 5px;")
1231-
desc_label.setWordWrap(True)
1232-
layout.addWidget(desc_label)
1233-
1234-
layout.addWidget(label)
1222+
if "title" in prop_schema or "description" in prop_schema:
1223+
show_label = False
1224+
else:
1225+
show_label = True
1226+
1227+
if show_label:
1228+
label_text = self._get_property_label(prop_name, prop_schema, prop_name in required)
1229+
label = QLabel(label_text)
1230+
if prop_name in required:
1231+
label.setProperty("class", "required")
1232+
layout.addWidget(label)
12351233

12361234
# Create widget for property with safe value provider
12371235
def make_value_provider():

0 commit comments

Comments
 (0)