-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Backport release-3_40] [GUI] Replace Italic Font with Monospaced Font in Expression Fields of Attribute Table (#59139) #60143
base: release-3_40
Are you sure you want to change the base?
Conversation
… the attribute table. Related to issue qgis#44638 (qgis#59139) * [gui] Remove italics and use monospaced font for expression fields in attribute tableThis commit modifies QgsFieldExpressionWidget to ensure that expression fields in the attribute table are displayed using a regular monospaced font instead of the default italics. This improves readability and ensures consistency between different parts of the interface.- Updated QgsFieldExpressionWidget::updateLineEditStyle() to set font to non-italic and apply monospaced family.- Addressed issue reported in qgis#44638 regarding the readability challenges caused by italicized font in expression fields.Related issue: qgis#44638 * [gui] Reformat code to match standard style
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
hey @nirvn , could you please take a look at my PR for the QGIS 3.40 backport? Let me know if there’s anything else you need. Thank you! |
@@ -392,7 +392,8 @@ void QgsFieldExpressionWidget::updateLineEditStyle( const QString &expression ) | |||
currentField( &isExpression, &isValid ); | |||
} | |||
QFont font = mCombo->lineEdit()->font(); | |||
font.setItalic( isExpression ); | |||
font.setFamily( ( QgsCodeEditor::getMonospaceFont() ).family() ); | |||
font.setItalic( false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for the monospace font, but do we want to set italic to false also for expressions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea in the original issue was to replicate what is currently seen in the Expression Dialog where italic isn't used. To me, there isn't any benefit using italic in an expression as it can only make it harder to read and easier to misplace the cursor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think visualizing if something is a filed or expression is good, but there may be better options.
In the backport here, I'd leave it as italics.
In master we could try bold for fields and regular for expressions?
Pinging @nirvn, who also has issues with the monospace change in master... |
This PR backports the changes from #59139 to the release-3_40 branch to resolve Issue #44638. The update replaces italic fonts with a monospaced font in the expression fields of the attribute table, enhancing readability and ensuring visual consistency across the interface.