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

Request: Text color in progress bar #58

Open
luigifab opened this issue Jan 19, 2022 · 3 comments
Open

Request: Text color in progress bar #58

luigifab opened this issue Jan 19, 2022 · 3 comments
Labels
help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience

Comments

@luigifab
Copy link
Contributor

luigifab commented Jan 19, 2022

What should be patched?

Perhaps for good reasons, GTK has moved the progress text outside the progress bar.
(the double text color still works with progress bars in treeviews)

I suggest to add something like: GTK_PROGRESS_TEXT_INSIDE=1.
When this environment variable exists:

  • add the progress text inside the progress bar,
  • add a new CSS class to the progress bar,
  • and allow the text to get two colors.

How? I don't know, I found how to put the text inside the progress bar, and how to add a CSS class to the progress bar. But for the colors... Draft.

Screenshots

Ambiance theme with Ubuntu 11.10 - GTK 3.2:
image

Ambiance theme with Ubuntu 13.04 - GTK 3.6:
image

Ambiance theme with Ubuntu 13.10 - GTK 3.8:
image

My theme with GTK 3.24 (without any GTK changes):
image

Commits

The old method, GTK 3.6: gtk_progress_bar_paint_text
The new method (not sure), GTK 3.24: gtk_progress_bar_render_text

For progress bar in treeview, the method (not sure), GTK 3.24: gtk_cell_renderer_progress_render

@luigifab luigifab added help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience labels Jan 19, 2022
@luigifab
Copy link
Contributor Author

luigifab commented Jun 8, 2023

I tried some ideas (appearance__progress_text.patch).

I think the idea is simple:

  • draw the text for "left part"
  • draw the text for "right part"
  • draw texts at the same position
  • next, texts must be clipped (according the position of the progress bar)

For now, the patch doesn't calculate clip position/size correctly...

@lah7
Copy link
Owner

lah7 commented Jun 8, 2023

You may be interested in the code for this patch that was going to introduce this classic style of progress bar to the MATE shut down / log out dialog:

@luigifab
Copy link
Contributor Author

luigifab commented Oct 14, 2023

Yolo! done for gtk3! horizontal! vertical! ltr! rtl!

image image

for gtk3: automatic width/height without min-width/height from css theme + position of the text, currently text node is added here: progressbar trough progress text, but text is displayed before the progress bar, not on it!

for gtk4: nothing works, the text is displayed under the progress bar, I tried to move it like with gtk3, but the text is not rendered any more...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Any C programmers out there? patch feature request A "nice to have" patch to complement the classic experience
Projects
None yet
Development

No branches or pull requests

2 participants