Text-Editor: Default-Stile + Stil-Picker im Dialog
User-Wunsch: vorgespeicherte Stile (Heading, Paragraph Helvetica/Georgia) direkt im Editor anwendbar. Backend (text_create.py): - _DEFAULT_STYLES: 7 sinnvolle Architektur-Defaults — Titel (0.40m bold), Heading 1 (0.30m bold), Heading 2 (0.20m bold), Paragraph Helvetica (0.15m), Paragraph Georgia (0.15m Georgia), Notiz (0.10m italic), Bildlegende (0.08m italic) - list_styles: seedet die Defaults beim ersten Zugriff falls noch keine Styles im Doc existieren (analog mass_style) - Bestehende save_style/delete_style/apply_style funktionieren weiter Backend (text_editor.py): - INIT-Payload erweitert um styles[] (Liste aller verfuegbaren Stile mit id/name/font/size/bold/italic/underline/align) Frontend (TextEditorApp.jsx): - Neuer Stil-Picker als erstes Dropdown in Toolbar-Row 1 (150px) - Optionen: "— Stil wählen —" + alle verfuegbaren Stile - onChange: applyStyle(style) — setzt Toolbar-State + appliziert via execCommand auf die aktuelle Selektion im WYSIWYG-Editor (oder als Default fuer kommendes Tippen wenn keine Selektion) - queryCommandState-Check fuer Bold/Italic/Underline damit nur toggled wird wenn nicht schon im gewuenschten State Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,14 @@ class TextEditorBridge(panel_base.BaseBridge):
|
||||
self._form_ref = form
|
||||
|
||||
def _on_ready(self):
|
||||
doc = Rhino.RhinoDoc.ActiveDoc
|
||||
styles = []
|
||||
try: styles = text_create.list_styles(doc)
|
||||
except Exception: pass
|
||||
self.send("INIT", {
|
||||
"settings": self._initial_settings,
|
||||
"fonts": self._fonts,
|
||||
"styles": styles,
|
||||
})
|
||||
|
||||
def handle(self, data):
|
||||
|
||||
Reference in New Issue
Block a user