Commit Graph

3 Commits

Author SHA1 Message Date
jessequ fbfe167cdc fix: unify NumberBox drag behavior to prevent value jumps in limited mode
The limited drag mode used absolute mouse position to compute the
  value (min + xPercent * range), causing an immediate jump away from
  the property's current value at drag start. Unify both modes to use
  the relative offset formula (number + offset * step), with the
  limited mode only adding min/max clamping on top. Also removes the
  cursor-constraining logic that was specific to the old absolute mode.
2026-07-31 16:55:05 +08:00
jessequ 2e93156093 feat: add QFont type editor with FontBox and fix property name top-alignment
Add FontBox QML editor for QFont properties — collapsed display shows
  "family, size pt", expanded inline dropdown provides family ComboBox
  (populated from QFontDatabase), compact +/- size buttons, and
  Bold/Italic/Underline toggles.

  QFont is a Q_GADGET type classified as Object by parserType(), so it
  requires both a PropertyTypeCustomization_Font (overrides
  customizeHeaderRow to create the value editor, customizeChildren as
  no-op) and a mMetaTypeCustomizationMap entry — the Object branch of
  getCustomPropertyType() is extended to check this map first.

  Also fix property name column to always top-align (anchors.top +
  implicitHeight) so it stays fixed when inline editors like FontBox
  expand vertically, rather than drifting to row center.

  Files (8 changed):
  - resources/Qml/ValueEditor/FontBox.qml           (new)
  - source/src/Customization/PropertyTypeCustomization_Font.h  (new)
  - source/src/Customization/PropertyTypeCustomization_Font.cpp (new)
  - resources.qrc
  - source/src/QQuickDetailsViewBasicTypeEditor.cpp
  - source/src/QQuickDetailsViewMananger.cpp
  - source/src/QQuickDetailsViewLayoutBuilder.cpp
  - source/src/PropertyHandleImpl/IPropertyHandleImpl.cpp
2026-07-27 21:54:57 +08:00
Jesse Qu 5d2caba154 Add property-editor function. 2026-07-03 15:58:09 +08:00