diff --git a/bottles/frontend/windows/envvars.py b/bottles/frontend/windows/envvars.py index 736c77afbdd..0102afb9a86 100644 --- a/bottles/frontend/windows/envvars.py +++ b/bottles/frontend/windows/envvars.py @@ -17,9 +17,12 @@ from gi.repository import Gtk, GLib, Adw +from bottles.backend.logger import Logger from bottles.frontend.utils.gtk import GtkUtils from bottles.frontend.utils.sh import ShUtils +logging = Logger() + @Gtk.Template(resource_path="/com/usebottles/bottles/env-var-entry.ui") class EnvVarEntry(Adw.EntryRow): @@ -44,6 +47,19 @@ def __init__(self, parent, env, **kwargs): self.connect("apply", self.__save) self.btn_remove.connect("clicked", self.__remove) + row_wg = self.get_child().get_first_child().get_next_sibling() + child_wg = row_wg.get_first_child() if row_wg else None + while isinstance(child_wg, Gtk.Label): + child_wg.set_visible(False) + child_wg = child_wg.get_next_sibling() + + if isinstance(child_wg, Gtk.Text): + child_wg.set_valign(Gtk.Align.CENTER) + else: + logging.error( + "EnvVarEntry could not find text widget. Did AdwEntryRow change it's widget tree?" + ) + def __save(self, *_args): """ Change the env var value according to the