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

Improve color support for themes #1319

Merged
merged 7 commits into from
Mar 7, 2019
Merged

Improve color support for themes #1319

merged 7 commits into from
Mar 7, 2019

Conversation

VictorLamoine
Copy link
Contributor

@VictorLamoine VictorLamoine commented Jan 2, 2019

This improves readability when using dark or other themes in RViz.

Before

White theme

before_white

Dark theme

before_dark

There are some other colors that might be improved but this fixes the main issues I have seen.


Does someone know where the color is set for the status tree and similar entries?
status tree

@VictorLamoine
Copy link
Contributor Author

Firendly 🐷

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading into the right direction. To fix the remaining colors, search for QColor in the source tree 😉

src/rviz/properties/property_tree_with_help.cpp Outdated Show resolved Hide resolved
@VictorLamoine
Copy link
Contributor Author

VictorLamoine commented Feb 18, 2019

I hard a hard time finding this color because it was not initialized.
This pull request is ready on my side.

After

White theme

screenshot_20190218_132219

Black theme

screenshot_20190218_132311

@VictorLamoine
Copy link
Contributor Author

VictorLamoine commented Feb 18, 2019

In the help panel:
screenshot_20190218_132630

This panel uses HTML so it's not easy to fix. We can force the color of the text in the tabs like this: (I have only done the first one on the screenshot below)
screenshot_20190218_133358

  <tr class="odd">
    <td class="key">M</td>
    <td><font color="black">Switch to the Move-Camera tool.</font></td>
  </tr>
  <tr class="even">

It's not very elegant but it works.

@VictorLamoine
Copy link
Contributor Author

@rhaschke can you have an other look?

@rhaschke
Copy link
Contributor

I will have another look, but probably not earlier than March 9th.

@rhaschke
Copy link
Contributor

rhaschke commented Mar 7, 2019

Dear @VictorLamoine,
I further tweaked the coloring and cleaned up the commit history in my own fork:
https://github.com/rhaschke/rviz/tree/colors_dark_theme

Could you please git-reset your branch to this one and verify that everything looks fine for you as well?
As you see from the images below, the panel title bars are not correctly colored on my side - probably due to a bug in the Adwaita-dark theme that I'm using for testing. On your side it looked good.

bright:
bright

dark:
dark

@VictorLamoine
Copy link
Contributor Author

Most likely you adwaita theme is incomplete!

RViz with Kubuntu breeze theme look nice:
screenshot_20190307_163336
screenshot_20190307_163628

@rhaschke rhaschke merged commit 7af4c17 into ros-visualization:melodic-devel Mar 7, 2019
@VictorLamoine VictorLamoine deleted the colors_dark_theme branch March 8, 2019 14:06
@PeterMitrano
Copy link

how do I use this?

@rhaschke
Copy link
Contributor

Just change your global desktop theme to a dark one.

@PeterMitrano
Copy link

PeterMitrano commented Jul 15, 2020

Hm.. I think I've done that. For instance, nautilus and jstest-gtk is in dark theme. But rviz is not (even after restarting). I am on ROS Melodic on Ubuntu 18.04
rviz version 1.13.12

@rhaschke
Copy link
Contributor

This might have run into a well-known Qt issue: In order to use gtk desktop themes, you need to install qt5-style-plugins and maybe
export QT_QPA_PLATFORMTHEME=gtk2

@PeterMitrano
Copy link

that did the trick -- and setting that variable seems nessecary. Thanks!

jacobperron pushed a commit to ros2/rviz that referenced this pull request Aug 20, 2020
* improve color support for themes

based on ros-visualization/rviz#1319

* fixup style issues

* try this again

* use Qt::ForegroundRole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants