fix(panel): give GPU icons the same CSS styling as other sensors - #575
Closed
MatrixNeoKozak wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #565: in the top bar, the GPU icon's value text was shifted ~8px to the right of every other sensor's, and the icon itself rendered visually out of line.
Root cause: hot-sensor keys for GPUs are numbered (
_gpu#1_utilization_,_gpu#2_...), so_defaultIcon()built the style classvitals-panel-icon-gpu#1. That class contains a#and cannot match any CSS rule, so the GPU icon was the only panel icon without a.vitals-panel-icon-*rule in stylesheet.css. Every other sensor type definespadding: 0plus a small right margin there; with the rule missing, GNOME Shell's generic.system-status-iconpadding applied to the GPU icon, pushing its value text right and making the icon look smaller/misaligned.Fix: normalize the style class in
_defaultIcon()exactly like_sensorIconPath()already does (gpu#N->gpu), so all GPUs share one matchablevitals-panel-icon-gpuclass, and add the corresponding CSS rule following the existing per-sensor convention. No behavior change for non-GPU sensors.Why
This change resolves the target issue or improvement.
How to test
Verify that the project builds/runs correctly and the specific bug/improvement is addressed.
Fixes #565