Merge pull request #608 from benleb/add-spacing-to-gps
decrease spacing in gps ui
This commit is contained in:
commit
6f8133b2b8
@ -65,6 +65,8 @@ class GPS(plugins.Plugin):
|
|||||||
lon_pos = (127, 56)
|
lon_pos = (127, 56)
|
||||||
alt_pos = (102, 71)
|
alt_pos = (102, 71)
|
||||||
|
|
||||||
|
label_spacing = 0
|
||||||
|
|
||||||
ui.add_element(
|
ui.add_element(
|
||||||
"latitude",
|
"latitude",
|
||||||
LabeledValue(
|
LabeledValue(
|
||||||
@ -74,6 +76,7 @@ class GPS(plugins.Plugin):
|
|||||||
position=lat_pos,
|
position=lat_pos,
|
||||||
label_font=fonts.Small,
|
label_font=fonts.Small,
|
||||||
text_font=fonts.Small,
|
text_font=fonts.Small,
|
||||||
|
label_spacing=label_spacing,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
ui.add_element(
|
ui.add_element(
|
||||||
@ -85,6 +88,7 @@ class GPS(plugins.Plugin):
|
|||||||
position=lon_pos,
|
position=lon_pos,
|
||||||
label_font=fonts.Small,
|
label_font=fonts.Small,
|
||||||
text_font=fonts.Small,
|
text_font=fonts.Small,
|
||||||
|
label_spacing=label_spacing,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
ui.add_element(
|
ui.add_element(
|
||||||
@ -96,14 +100,17 @@ class GPS(plugins.Plugin):
|
|||||||
position=alt_pos,
|
position=alt_pos,
|
||||||
label_font=fonts.Small,
|
label_font=fonts.Small,
|
||||||
text_font=fonts.Small,
|
text_font=fonts.Small,
|
||||||
|
label_spacing=label_spacing,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
def on_ui_update(self, ui):
|
def on_ui_update(self, ui):
|
||||||
|
if self.coordinates and all([
|
||||||
# avoid 0.000... measurements
|
# avoid 0.000... measurements
|
||||||
if self.coordinates and all(
|
self.coordinates["Latitude"], self.coordinates["Longitude"]
|
||||||
[self.coordinates["Latitude"], self.coordinates["Longitude"]]
|
]):
|
||||||
):
|
# last char is sometimes not completely drawn ¯\_(ツ)_/¯
|
||||||
ui.set("latitude", f"{self.coordinates['Latitude']:.4f}")
|
# using an ending-whitespace as workaround on each line
|
||||||
ui.set("longitude", f" {self.coordinates['Longitude']:.4f}")
|
ui.set("latitude", f"{self.coordinates['Latitude']:.4f} ")
|
||||||
ui.set("altitude", f" {self.coordinates['Altitude']:.1f}m")
|
ui.set("longitude", f" {self.coordinates['Longitude']:.4f} ")
|
||||||
|
ui.set("altitude", f" {self.coordinates['Altitude']:.1f}m ")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user