[Enhancement] Little tweak on driver name
srlemke opened this issue · comments
Hello!
It's me again to annoy :)
I think the default 'print' of the driver name when the option to also show the car name becomes a little overwhelming (a lot of chars packed together), in order to improve that I did that little tweak in the code and the result is in the screenshot above, do you think that could be implemented?
I'm not creating a pull request because I do not really develop in python as you will see in the diff bellow:
diff --git a/tinypedal/widget/relative.py b/tinypedal/widget/relative.py
index 90ab8b1..8512ed5 100644
--- a/tinypedal/widget/relative.py
+++ b/tinypedal/widget/relative.py
@@ -21,7 +21,6 @@ Relative Widget
"""
import random
-
from PySide2.QtCore import Qt, Slot
from PySide2.QtGui import QFont, QFontMetrics
from PySide2.QtWidgets import (
@@ -456,7 +455,7 @@ class Draw(Widget):
elif self.wcfg["driver_name_mode"] == 1:
text = name[1] # vehicle name
elif name[1]:
- text = f"{name[0]} [{name[1]}]" # combined name
+ text = f"{name[0] : <25} {name[1]}" # combined name
else:
text = ""
if self.wcfg["driver_name_uppercase"]:
But I think you will get the idea :)
(the hard-coded '25' is the chars for driver name only, so currently in the settings I have 55.
(maybe when the user selects driver name ' 2' - combined, he could also have the option to set the 'car name length' )
and something like this:
-
text = f"{name[0] : <$driver_name_length} {name[1] $car_name_length}" # combined name
thanks!
Hi, great suggestion. I'll add your code shortly. Also if you don't mind, I would add your name to the contributor list, as you have helped massively on various stuff so far, lemme know, thanks.
Edit: after some thoughts, I decide to add a new vehicle name column, I think this is better in the long run and keep the setting more easier for user to understand.
Edit: here is the changes a32f5c8
Hello, you certainly can add me to the contributor list if you believe it's a fit.
The new implementation is really great!
There seems to a small bug with the option:
Font Color Vehicle name
As changing the color in the GUI does not apply on the widget.
I did not mind going into the code to find the exact issue as I believe that is probably trivial fix.
Hi, no problem.
The Font Color XXXX
is mostly a placeholder, because this font color from all non-player vehicles is overridden by show_lap_difference
option, which overrides this color with font_color_same_lap
, font_color_laps_ahead
, font_color_laps_behind
options.
This seems to be fully implemented them, thanks!