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:
parent
048dcadaa2
commit
77fdb86991
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<template class="EnvironmentsDialog" parent="AdwDialog">
|
<template class="EnvironmentsDialog" parent="AdwDialog">
|
||||||
<property name="title">Manage Environments</property>
|
<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="content-height">600</property>
|
||||||
<property name="follows-content-size">false</property>
|
<property name="follows-content-size">false</property>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</child>
|
</child>
|
||||||
|
|
||||||
<property name="content">
|
<property name="content">
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkScrolledWindow" id="scrolled_window">
|
||||||
<property name="vexpand">true</property>
|
<property name="vexpand">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwClamp">
|
<object class="AdwClamp">
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class EnvironmentsDialog(Adw.Dialog):
|
|||||||
|
|
||||||
table_container = Gtk.Template.Child()
|
table_container = Gtk.Template.Child()
|
||||||
add_environment_button = Gtk.Template.Child()
|
add_environment_button = Gtk.Template.Child()
|
||||||
|
scrolled_window = Gtk.Template.Child()
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'environments-updated': (GObject.SIGNAL_RUN_FIRST, None, ()),
|
'environments-updated': (GObject.SIGNAL_RUN_FIRST, None, ()),
|
||||||
@ -48,6 +49,10 @@ class EnvironmentsDialog(Adw.Dialog):
|
|||||||
self.header_row = None
|
self.header_row = None
|
||||||
self.data_rows = []
|
self.data_rows = []
|
||||||
self._populate_table()
|
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):
|
def _populate_table(self):
|
||||||
"""Populate the transposed environment-variable table."""
|
"""Populate the transposed environment-variable table."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user