Skip to content

Commit

Permalink
Update minimum distance field on offset change
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesoncalum committed Dec 15, 2023
1 parent 3e01f4b commit 786a9a8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/inspector/models/abstractinspectormodel.h
Expand Up @@ -137,6 +137,7 @@ class AbstractInspectorModel : public QObject, public async::Asyncable

void init();

Q_INVOKABLE virtual void loadProperties() = 0;
Q_INVOKABLE virtual void requestResetToDefaults();

QString title() const;
Expand All @@ -154,7 +155,6 @@ class AbstractInspectorModel : public QObject, public async::Asyncable
virtual bool isEmpty() const;

virtual void createProperties() = 0;
virtual void loadProperties() = 0;
virtual void resetProperties() = 0;

virtual void requestElements();
Expand Down
Expand Up @@ -45,6 +45,8 @@ class AppearanceSettingsModel : public AbstractInspectorModel
public:
explicit AppearanceSettingsModel(QObject* parent, IElementRepositoryService* repository);

Q_INVOKABLE void loadProperties() override;

Q_INVOKABLE void pushBackwardsInOrder();
Q_INVOKABLE void pushForwardsInOrder();
Q_INVOKABLE void pushToBackInOrder();
Expand All @@ -54,7 +56,6 @@ class AppearanceSettingsModel : public AbstractInspectorModel

void createProperties() override;
void requestElements() override;
void loadProperties() override;
void resetProperties() override;

PropertyItem* leadingSpace() const;
Expand Down
Expand Up @@ -75,6 +75,12 @@ Column {
navigationPanel: root.navigationPanel
navigationRowStart: verticalSpacingSection.navigationRowEnd + 1

onOffsetValuesChanged: {
if (model) {
model.loadProperties()
}
}

onSnapToGridToggled: function(snap) {
if (model) {
model.isSnappedToGrid = snap
Expand Down
Expand Up @@ -39,6 +39,7 @@ Column {
property int navigationRowStart: 0
property int navigationRowEnd: configureGridButton.navigation.row

signal offsetValuesChanged()
signal snapToGridToggled(var snap)
signal configureGridRequested()

Expand All @@ -52,6 +53,14 @@ Column {

navigationPanel: root.navigationPanel
navigationRowStart: root.navigationRowStart

verticalOffsetControl.onValueEditingFinished: {
root.offsetValuesChanged()
}

horizontalOffsetControl.onValueEditingFinished: {
root.offsetValuesChanged()
}
}

CheckBox {
Expand Down

0 comments on commit 786a9a8

Please sign in to comment.