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

[Backport release-3_40] [GUI] Replace Italic Font with Monospaced Font in Expression Fields of Attribute Table (#59139) #60143

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion src/gui/qgsfieldexpressionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member

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?

mCombo->lineEdit()->setFont( font );

if ( isExpression && !isValid )
Expand Down
Loading