Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/io.github.dubstar_04.design.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<li>Add Preview for Extend Command (EX)</li>
<li>Improve character spacing for ArcText Command (ArcText)</li>
<li>Improve mouse wheel zoom precision</li>
<li>Fix handling of Insert entities with no block defined</li>
<li>Fix Zoom All with invalid scale value</li>
<li>Add support for user-defined hatch patterns</li>
Comment on lines +73 to +75
</ul>
</description>
</release>
Expand Down
11 changes: 9 additions & 2 deletions src/Design/Properties/propertiesWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export const PropertiesWindow = GObject.registerClass({
onValueChanged(property, value) {
const selectedType = this.getFilterValue();
DesignCore.PropertyManager.setEntityProperties(property, value, selectedType);
// Rebuild the widget list so readOnly() callbacks are re-evaluated for all properties
this.onTypeChanged();
}
Comment on lines 83 to 88

/** Get the currently selected filter value */
Expand Down Expand Up @@ -143,9 +145,9 @@ export const PropertiesWindow = GObject.registerClass({
}

case Property.Type.BOOLEAN:
suffixWidget = new Gtk.Switch({ valign: Gtk.Align.CENTER, state: value });
suffixWidget = new Gtk.Switch({ valign: Gtk.Align.CENTER, active: value });
suffixWidget.connect('notify::active', () => {
this.onValueChanged(`${property}`, suffixWidget.state);
this.onValueChanged(`${property}`, suffixWidget.active);
});
break;

Expand Down Expand Up @@ -192,6 +194,11 @@ export const PropertiesWindow = GObject.registerClass({
break;
}

// Apply readOnly state to the widget (supports static boolean or entity-parameterized callable)
const propEntity = DesignCore.PropertyManager.getEntityForProperty(selectedType, property);
const isReadOnly = typeof definition?.readOnly === 'function' ? definition.readOnly(propEntity) : !!definition?.readOnly;
Comment on lines +198 to +199
suffixWidget.set_sensitive(!isReadOnly);

// Get a formatted version of the property name
const formattedName = this.formatDisplayName(property);
const propRow = new Adw.ActionRow({ title: formattedName });
Expand Down
Loading