Skip to content

[BUG] Progress bar style Light/Dark modes #132

Description

@Mecanik

Description

With the default style included, we get this progress bar:

Image

As you can see, there is spacing where the chunk starts, which is not ideal. The problematic CSS is this line:

border: 0.9em solid #eff0f1;

This line:

  • Adds a very thick (0.9em ≈ 14–16px) solid white border
  • That border is inside the widget’s geometry, shrinking the usable area for the progress chunk
  • It visually shifts the fill by that amount (especially the left margin)

If you remove the border, the rgba(...) background becomes visible, which results in this:

Image

Proposed rewrite, to eliminate issues and have a modern style:

Light:

QProgressBar:horizontal,
QProgressBar:vertical {
    background-color: #eff0f1;
    border: 1px solid #eff0f1;
    border-radius: 3px;
    padding: 0px;
}

/* Horizontal progress bar */
QProgressBar:horizontal {
    height: 6px;
    min-width: 96px;
    text-align: center;
    margin: 2px 0;
}

/* Vertical progress bar */
QProgressBar:vertical {
    width: 6px;
    min-height: 96px;
    text-align: center;
    margin: 0 2px 4px 2px;
}

/* The filled chunk */
QProgressBar::chunk:horizontal,
QProgressBar::chunk:vertical {
    background-color: #3daef3;
    border-radius: 3px;
}

Light Result:

Image

Dark:

QProgressBar:horizontal,
QProgressBar:vertical {
    background-color: #626568;
    border: 1px solid #31363b;
    border-radius: 3px;
    padding: 0px;
}

QProgressBar:horizontal {
    height: 6px;
    min-width: 96px;
    text-align: center;
    margin: 2px 0;
}

QProgressBar:vertical {
    width: 6px;
    min-height: 96px;
    text-align: center;
    margin: 0 2px 4px 2px;
}

QProgressBar::chunk:horizontal,
QProgressBar::chunk:vertical {
    background-color: #3daee9;
    border-radius: 3px;
}

Dark Result:

Image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions