Skip to content

CodeEditor Widget Styling#1874

Merged
danmar merged 2 commits into
cppcheck-opensource:masterfrom
scottfurry:EditStyle
Jun 8, 2019
Merged

CodeEditor Widget Styling#1874
danmar merged 2 commits into
cppcheck-opensource:masterfrom
scottfurry:EditStyle

Conversation

@scottfurry

Copy link
Copy Markdown
Contributor

With profileration of Qt5 styling methods, problems with presentation
can occur when using cppcheck-gui and user choosen themes. With a dark
theme, a highlighted line in the CodeEditor appears with white text on
a light background or dark colors on a dark background.

Commit makes changes to enforce a default style on the Code Editor widget.
Mechanism is provided, if desired, where a user defined styling can
be provided to CodeEditor widget.

With profileration of Qt5 styling methods, problems with presentation
can occur when using cppcheck-gui and user choosen themes. With a dark
theme, a highlighted line in the CodeEditor appears with white text on
a light background or dark colors on a dark background.

Commit makes changes to enforce a default style on the Code Editor widget.
Mechanism is provided, if desired, where a user defined styling can
be provided to CodeEditor widget.
@danmar

danmar commented Jun 7, 2019

Copy link
Copy Markdown
Collaborator

lgtm. I'm not sure how this works but I'm all for following the theme. I'm rerunning the appveyor right now, maybe the fail was interrmittent..

@scottfurry

Copy link
Copy Markdown
Contributor Author

I didn't get any warnings/errors during build on Linux. However, thinking about this, I wonder if there might be an issue on Windows platform and the usage of rule-of-five language used in gui/codeeditorstyle.h file. If appveyor continues to not build this, I may have to go back to clean out or better define the default copy/move constructors and operator= functions.

This isn't any real magic. The style applied for CodeEditor widget is still as originally coded. It's just encapsulated in a class with public access. The next step would be populating the CodeEditorStyle class with either a dark theme or user choices. I didn't think it was appropriate to over-think/over-work styling. There are choices that need to be made about level of effort and implementation.

With profileration of Qt5 styling methods, problems with presentation
can occur when using cppcheck-gui and user choosen themes. With a dark
theme, a highlighted line in the CodeEditor appears with white text on
a light background or dark colors on a dark background.

Commit makes changes to enforce a default style on the Code Editor widget.
Mechanism is provided, if desired, where a user defined styling can
be provided to CodeEditor widget.

2nd commit - remove declarations in gui/codeeditorstyle.h to possibly
resolve appveyor window builds.
@danmar danmar merged commit 32f4549 into cppcheck-opensource:master Jun 8, 2019
@scottfurry scottfurry deleted the EditStyle branch June 8, 2019 13:48
@danmar

danmar commented Jun 12, 2019

Copy link
Copy Markdown
Collaborator

The next step would be populating the CodeEditorStyle class with either a dark theme or user choices. I didn't think it was appropriate to over-think/over-work styling. There are choices that need to be made about level of effort and implementation.

I like it.

But well.. I have a very little knowledge about how this should be implemented.

I don't want that we "over-work" the styling. And some quick and ugly hack is not wanted neither.

If you are willing to work on this I would like to give you freedom to make the choices that you think are appropriate.

danmar pushed a commit that referenced this pull request Jun 23, 2019
Building on #1874, commit adds user controls to choose
or edit style in cppcheck-gui ONLY. Commit does not
address CodeEditor style usage in triage app at this time.

Code Editor style can be altered from the added "Code Editor"
tab in the user preferences. The user has the option to select
default light, default dark, or to customize.

If user leaves the style set to light or dark defaults, this
will be reflected in the choices shown in the preferences
dialog.

User choice for Code Editor Style is saved in the cppcheck-gui
preferences under the heading "EditorStyle".
jubnzv pushed a commit to jubnzv/cppcheck that referenced this pull request Nov 13, 2019
…-opensource#1913)

Building on cppcheck-opensource#1874, commit adds user controls to choose
or edit style in cppcheck-gui ONLY. Commit does not
address CodeEditor style usage in triage app at this time.

Code Editor style can be altered from the added "Code Editor"
tab in the user preferences. The user has the option to select
default light, default dark, or to customize.

If user leaves the style set to light or dark defaults, this
will be reflected in the choices shown in the preferences
dialog.

User choice for Code Editor Style is saved in the cppcheck-gui
preferences under the heading "EditorStyle".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants