Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text formatting QML and enable/disable #31647

Closed
wants to merge 2 commits into from

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Sep 9, 2019

Fixes #31428 and #31427

@elpaso elpaso added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 9, 2019
@elpaso
Copy link
Contributor Author

elpaso commented Sep 9, 2019

@nyalldawson I'm not totally sure about the fix in case of DD properties for the background, mind having a look?

@nyalldawson
Copy link
Collaborator

#31428 is deliberate, in that we also need these properties to be editable if data defined enable buffer is used.


if ( textStyleElem.firstChildElement( QStringLiteral( "dd_properties" ) ).isNull() )
QDomElement ddElem = textStyleElem.firstChildElement( QStringLiteral( "dd_properties" ) );
if ( ddElem.isNull() )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm - this doesn't look right. We'd still want to restore these even when data defined properties are present. What's the logic here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties are present. What's the logic here?

I said it wasn't clear to me :)

The question is what is the current (broken) logic ?

In case of missing DD and issue #31427, the QML is read twice:
First time here:
https://github.com/qgis/QGIS/blob/master/src/core/qgstextrenderer.cpp#L1934
which gets the correct config
and second time here:
https://github.com/qgis/QGIS/blob/master/src/core/qgstextrenderer.cpp#L1939
which gets the wrong config

The DD getter also seems to be duplicated:
here is checked intially https://github.com/qgis/QGIS/blob/master/src/core/qgstextrenderer.cpp#L1937
and here is checked again: https://github.com/qgis/QGIS/blob/master/src/core/qgstextrenderer.cpp#L1946
I moved the getter before to simplify the code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - got an alternate fix coming through. Seems it was a copy/paste error on my behalf originally.

@elpaso
Copy link
Contributor Author

elpaso commented Sep 10, 2019

#31428 is deliberate, in that we also need these properties to be editable if data defined enable buffer is used.

Ok, I've committed some more complex logic to handle frame enabled but I have some doubts about the UX/UI: is the the DD is an override of the main checkbox?
If it is, I suppose it overrides the checkbox completely, so why the checkbox is automatically checked whenever I set a DD?

Anyway I think we should make this clearer to the user.

@elpaso elpaso closed this Sep 13, 2019
@elpaso elpaso deleted the text-formatting-bugs branch September 13, 2019 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Text formats" dialog shows modifiable buffer properties while the "draw text buffer" is unchecked
2 participants