Fix Manage Environments dialog scroll position and widen dialog

Reset horizontal scroll to leftmost position on open so variable names
are always visible first. Increase dialog width from 1100 to 1200px.
This commit is contained in:
Pavel Baksy 2026-06-02 11:11:08 +02:00
parent 048dcadaa2
commit 77fdb86991
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@
<template class="EnvironmentsDialog" parent="AdwDialog">
<property name="title">Manage Environments</property>
<property name="content-width">1100</property>
<property name="content-width">1200</property>
<property name="content-height">600</property>
<property name="follows-content-size">false</property>
@ -18,7 +18,7 @@
</child>
<property name="content">
<object class="GtkScrolledWindow">
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="vexpand">true</property>
<child>
<object class="AdwClamp">

View File

@ -34,6 +34,7 @@ class EnvironmentsDialog(Adw.Dialog):
table_container = Gtk.Template.Child()
add_environment_button = Gtk.Template.Child()
scrolled_window = Gtk.Template.Child()
__gsignals__ = {
'environments-updated': (GObject.SIGNAL_RUN_FIRST, None, ()),
@ -48,6 +49,10 @@ class EnvironmentsDialog(Adw.Dialog):
self.header_row = None
self.data_rows = []
self._populate_table()
self.connect('map', self._scroll_to_start)
def _scroll_to_start(self, widget):
self.scrolled_window.get_hadjustment().set_value(0)
def _populate_table(self):
"""Populate the transposed environment-variable table."""