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

BatteryDashWidget not showing coloured images #42

Closed
bit-pirate opened this issue Aug 21, 2013 · 6 comments
Closed

BatteryDashWidget not showing coloured images #42

bit-pirate opened this issue Aug 21, 2013 · 6 comments
Assignees
Labels

Comments

@bit-pirate
Copy link
Contributor

We use the BatteryDashWidget in both the create and kobuki dashboards. When the battery is running low (below 50%), the widget should be showing orange or red battery icons. However, only a slightly lighter grey image is shown.

I took a look at both the dashboard and the widget code, but couldn't find an obvious bug. Any idea what is causing this?

@ablasdel
Copy link
Contributor

Unless I am mistaken the colors come on at 40% for orange and 20% for red don't they?

take that with a grain of salt as I am not at a computer currently.

I'll take a look at it tomorrow to make sure nothing is going wrong.

@bit-pirate
Copy link
Contributor Author

Yes, that is what I expected, but they are not shown. I'll wait for your test result.

@ghost ghost assigned ablasdel Aug 21, 2013
@bit-pirate
Copy link
Contributor Author

Something goes wrong with the SVGs, since the PNGs work fine. Furthermore, colour is shown, but somehow a grey overlay is added (I added a red rectangle added in the free, white space). Not sure, what is adding this grey overlay though.

@bit-pirate
Copy link
Contributor Author

OK, I finally figured this out. Two problems were involved:

First, disabling the QToolButton

class BatteryDashWidget(IconToolButton):
    [...]
    def __init__(self, name='Battery', icons=None, charge_icons=None, icon_paths=None):
        [...]
        self.setEnabled(False)

replaces the icon with a grey scale version by default. I applied the fix from this post: http://qt-project.org/forums/viewthread/4669

Second, something got messed up when I applied the green colour to the "charge bars". It was shown correctly in Inkscape, but not rendered correctly inside Qt. I ended up modifying the xml directly, since I'm not too familiar with Inkscape.

So finally I have coloured icons again. Yay! :-)

@ablasdel
Copy link
Contributor

This is really interesting and I hadn't noticed this issue before. You have quite an impressive eye for detail.

bit-pirate added a commit to bit-pirate/rqt_robot_plugins that referenced this issue Aug 22, 2013
@bit-pirate
Copy link
Contributor Author

What do you think about this new version?

bit-pirate added a commit to bit-pirate/rqt_robot_plugins that referenced this issue Aug 27, 2013
bit-pirate added a commit to bit-pirate/rqt_robot_plugins that referenced this issue Aug 27, 2013
ablasdel pushed a commit that referenced this issue Aug 27, 2013
rewrites BatterDashWidget to fix #42 (squashed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants