Fix edit icon and move Add Variable button inside table as last row
This commit is contained in:
parent
f4e8f0cca9
commit
f91c9f318a
@ -77,41 +77,6 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<!-- Add Variable Button at Bottom -->
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="orientation">horizontal</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<property name="margin-start">12</property>
|
|
||||||
<property name="margin-top">6</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="orientation">horizontal</property>
|
|
||||||
<property name="width-request">150</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="add_variable_button">
|
|
||||||
<property name="icon-name">list-add-symbolic</property>
|
|
||||||
<property name="tooltip-text">Add variable</property>
|
|
||||||
<signal name="clicked" handler="on_add_variable_clicked"/>
|
|
||||||
<style>
|
|
||||||
<class name="flat"/>
|
|
||||||
<class name="circular"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@ -31,7 +31,6 @@ class EnvironmentsDialog(Adw.Dialog):
|
|||||||
__gtype_name__ = 'EnvironmentsDialog'
|
__gtype_name__ = 'EnvironmentsDialog'
|
||||||
|
|
||||||
table_container = Gtk.Template.Child()
|
table_container = Gtk.Template.Child()
|
||||||
add_variable_button = Gtk.Template.Child()
|
|
||||||
add_environment_button = Gtk.Template.Child()
|
add_environment_button = Gtk.Template.Child()
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
@ -87,7 +86,36 @@ class EnvironmentsDialog(Adw.Dialog):
|
|||||||
self.table_container.append(row)
|
self.table_container.append(row)
|
||||||
self.data_rows.append(row)
|
self.data_rows.append(row)
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
# Add "Add Variable" button row at the bottom
|
||||||
|
add_var_row = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
|
||||||
|
add_var_row.set_margin_start(12)
|
||||||
|
add_var_row.set_margin_end(12)
|
||||||
|
add_var_row.set_margin_top(6)
|
||||||
|
add_var_row.set_margin_bottom(6)
|
||||||
|
|
||||||
|
# Variable cell with add button
|
||||||
|
var_cell = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
|
||||||
|
var_cell.set_size_request(150, -1)
|
||||||
|
if self.size_group:
|
||||||
|
self.size_group.add_widget(var_cell)
|
||||||
|
|
||||||
|
add_variable_button = Gtk.Button()
|
||||||
|
add_variable_button.set_icon_name("list-add-symbolic")
|
||||||
|
add_variable_button.set_tooltip_text("Add variable")
|
||||||
|
add_variable_button.connect('clicked', self.on_add_variable_clicked)
|
||||||
|
add_variable_button.add_css_class("flat")
|
||||||
|
add_variable_button.add_css_class("circular")
|
||||||
|
|
||||||
|
var_cell.append(add_variable_button)
|
||||||
|
add_var_row.append(var_cell)
|
||||||
|
|
||||||
|
# Empty space for value columns
|
||||||
|
empty_space = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||||
|
empty_space.set_hexpand(True)
|
||||||
|
add_var_row.append(empty_space)
|
||||||
|
|
||||||
|
self.table_container.append(add_var_row)
|
||||||
|
|
||||||
def on_add_variable_clicked(self, button):
|
def on_add_variable_clicked(self, button):
|
||||||
"""Add new variable."""
|
"""Add new variable."""
|
||||||
dialog = Adw.AlertDialog()
|
dialog = Adw.AlertDialog()
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="edit_button">
|
<object class="GtkButton" id="edit_button">
|
||||||
<property name="icon-name">edit-symbolic</property>
|
<property name="icon-name">accessories-text-editor-symbolic</property>
|
||||||
<property name="tooltip-text">Edit environment</property>
|
<property name="tooltip-text">Edit environment</property>
|
||||||
<signal name="clicked" handler="on_edit_clicked"/>
|
<signal name="clicked" handler="on_edit_clicked"/>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user