Skip to content

Commit

Permalink
Minor interface improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed Apr 22, 2024
1 parent ad08f8c commit 09c9d93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
File renamed without changes
6 changes: 3 additions & 3 deletions gelectrical/interface/mainwindow.glade
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
<property name="halign">start</property>
<property name="label" translatable="yes">Wire</property>
<property name="use-underline">True</property>
<property name="icon-name">wire-symbolic</property>
<property name="icon-name">wiredraw-symbolic</property>
<signal name="clicked" handler="on_draw_drawwire" swapped="no"/>
<accelerator key="w" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
</object>
Expand Down Expand Up @@ -435,8 +435,8 @@ Cross reference elements allows connecting different parts of the scheme within/
<property name="use-underline">True</property>
<property name="icon-name">zoom-in-symbolic</property>
<signal name="clicked" handler="on_draw_zoomin" swapped="no"/>
<accelerator key="KP_Add" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
<accelerator key="plus" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
<accelerator key="KP_Add" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
</object>
<packing>
<property name="expand">False</property>
Expand Down Expand Up @@ -469,8 +469,8 @@ Cross reference elements allows connecting different parts of the scheme within/
<property name="use-underline">True</property>
<property name="icon-name">zoom-out-symbolic</property>
<signal name="clicked" handler="on_draw_zoomout" swapped="no"/>
<accelerator key="minus" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
<accelerator key="KP_Subtract" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
<accelerator key="minus" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
</object>
<packing>
<property name="expand">False</property>
Expand Down
20 changes: 14 additions & 6 deletions gelectrical/view/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ def update(self, fields, caption, get_field, set_field):
self.set_field = set_field

# Add item name

self.name_row = Gtk.ListBoxRow()
if caption:
self.name_row = Gtk.ListBoxRow()
self.name_widget = Gtk.Label('<b>' + self.caption + '</b>', xalign=0)
self.name_widget.set_use_markup(True)
self.name_widget.props.margin_top = 6
self.name_widget.props.margin_bottom = 6
self.name_row.add(self.name_widget)
self.listbox.add(self.name_row)
self.field_rows.append((self.name_row, None))
else:
self.name_widget = Gtk.Separator()
self.name_row.props.margin_top = 6
self.name_row.props.margin_bottom = 6
self.name_row.props.margin_start = 6
self.name_row.props.margin_end = 6
self.name_row.add(self.name_widget)
self.listbox.add(self.name_row)
self.field_rows.append((self.name_row, None))

# Callbacks
def activate_callback(widget, get_field, set_field, code):
Expand Down Expand Up @@ -280,6 +285,8 @@ def show_image_tooltip_callback(combo, x, y, keyboard_mode, tooltip):
if field[self.enable_code]:
row = Gtk.ListBoxRow()
row.set_tooltip_markup(field['tooltip'])
row.props.margin_start = 6
row.props.margin_end = 6
data_widget = None
# Create widgets
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
Expand Down Expand Up @@ -645,6 +652,7 @@ def __init__(self, parent, window_caption, fields_dict, status_enable, status_in
action_area = self.dialog_window.get_action_area()

self.notebook = Gtk.Notebook()
self.notebook.props.show_border = True
content_area.pack_start(self.notebook, True, True, 0)
action_area.props.margin_top = 12
action_area.props.margin_bottom = 6
Expand Down

0 comments on commit 09c9d93

Please sign in to comment.