Skip to content

[Problem] Inconsistent styles for background color in python console #1094

@wohltat

Description

@wohltat

Is there an existing issue for this?

  • I have searched the existing issues

Version

0.21 (Development)

Full version info

[code]
OS: Manjaro Linux (GNOME/gnome-xorg)
Word size of FreeCAD: 64-bit
Version: 2024.1006.0.14555 (Git shallow) AppImage
Build type: Release
Branch: (HEAD detached at 20241003stable)
Hash: a9810d509a6f112b5ac03d4d4831b67e6bffd5b7
Python 3.11.9, Qt 5.15.13, Coin 4.0.1, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * Launcher
  * OpticsWorkbench 1.2.2
  * ShortCuts
[/code]

Subproject(s) affected?

None

Problem description

This situation looks a little messy and not documented enough.
When using overlays, there are five different places that the background color for the python console / report panel are defined. Only one of them is accessible via the UI.

It follows an example of those colors and where they are defined.

Image


black: python console, docked focussed+non focussed, overlay focussed
Preferences --> Python --> Editor --> Display Items --> Background
Seems to have no effect at first when it's set to #000000 black. If that value is set to something else the other following styles take effect.
When #000000 is picked, the preview color is not representative and not used anywhere as far as i can see.
Although it is listed under "Editor" it doesn't effect the color of the text editor, only the python console.


magenta: python console, overlay + focussed
.local/share/FreeCAD/Gui/Stylesheets/overlay/Dark-custom.qss:15

Gui--PropertyEditor--PropertyEditor QLabel {
  background : #6e006e;
}

This seems falsely mapped. There is no indication for it being used for the console panel. Also it is used for a lot of other UI elements as well.


green: python console, overlay + not focussed
.local/share/FreeCAD/Gui/Stylesheets/overlay/Dark-custom.qss:39

Gui--OverlayTabWidget::pane {
  background-color: rgba(0,100,0,150)
}
Shared overlay background color of all panels.

blue: python console, docked (not overlay) + not focussed
.local/share/FreeCAD/Gui/Stylesheets/Dark-blue-custom.qss:346

/* fix for Python Console (probably there is a smarter way to arrive to it) */
QDockWidget > QFrame {
    background-color: #0000f0;
    border: 1px solid #333333;
}

turquise: python console docked + focussed
.local/share/FreeCAD/Gui/Stylesheets/Dark-blue-custom.qss:1042

/*==================================================================================================
Text/Python editor (macros, etc...)
==================================================================================================*/
QPlainTextEdit,
QPlainTextEdit:focus {
    background-color: #007878;
    selection-color: #cbd8e6;
    selection-background-color: #2053c0;
    border: 1px solid #333333;
    border-radius: 3px;
    margin: 4px;
}

Also used for the text editor / python file editor.

Anything else?

Gui.zip
from ~/.local/share/FreeCAD/

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions