Skip to content

Commit a813f28

Browse files
committed
gmoccapy: add icon for continuous jog, change alignment of jog increment button box
1 parent 97d256c commit a813f28

5 files changed

Lines changed: 28 additions & 11 deletions

File tree

264 Bytes
Loading
264 Bytes
Loading
264 Bytes
Loading

src/emc/usr_intf/gmoccapy/gmoccapy.glade

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@
207207
<property name="visible">True</property>
208208
<property name="can-focus">False</property>
209209
</object>
210+
<object class="GtkImage" id="img_continuous">
211+
<property name="visible">True</property>
212+
<property name="can-focus">False</property>
213+
</object>
210214
<object class="GtkImage" id="img_coolant_off">
211215
<property name="visible">True</property>
212216
<property name="can-focus">False</property>
@@ -1445,6 +1449,7 @@ uncomment selection</property>
14451449
<object class="GtkNotebook" id="ntb_jog_JA">
14461450
<property name="visible">True</property>
14471451
<property name="can-focus">True</property>
1452+
<property name="vexpand">True</property>
14481453
<property name="show-tabs">False</property>
14491454
<property name="show-border">False</property>
14501455
<child>
@@ -1671,8 +1676,10 @@ uncomment selection</property>
16711676
<property name="width-request">110</property>
16721677
<property name="visible">True</property>
16731678
<property name="can-focus">False</property>
1679+
<property name="margin-start">5</property>
16741680
<property name="orientation">vertical</property>
16751681
<property name="spacing">3</property>
1682+
<property name="layout-style">expand</property>
16761683
<child>
16771684
<placeholder/>
16781685
</child>

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,16 @@ def __init__(self, argv):
146146
min-height: 18px;
147147
padding:1px;
148148
}
149-
/* #__jog_incr_buttons *:checked {
150-
background: rgba(230,230,50,0.8);
149+
/* #jog_incr_buttons *:checked {
150+
background: rgba(255,129,22,0.6);
151151
} */
152-
#jog_incr_buttons *:active, #jog_buttons *:active {
153-
background: rgba(230,230,50,0.8);
154-
}
155152
#eb_program_label, #eb_blockheight_label {
156153
background: rgba(0,0,0,1);
157154
}
155+
#jog_incr_buttons *{
156+
padding-left: 3px;
157+
padding-right: 3px;
158+
}
158159
progress, trough {
159160
min-height: 5px;
160161
}
@@ -805,11 +806,14 @@ def _get_space_label(self, name):
805806
lbl.show()
806807
return lbl
807808

808-
def _new_button_with_predefined_image(self, name, size, image = None, image_name = None):
809-
btn = Gtk.Button()
809+
def _new_button_with_predefined_image(self, name, size, image = None, image_name = None, radio_button = False):
810+
if radio_button:
811+
btn = Gtk.RadioButton()
812+
else:
813+
btn = Gtk.Button()
814+
btn.set_halign(Gtk.Align.CENTER)
815+
btn.set_valign(Gtk.Align.CENTER)
810816
btn.set_size_request(*size)
811-
btn.set_halign(Gtk.Align.CENTER)
812-
btn.set_valign(Gtk.Align.CENTER)
813817
btn.set_property("name", name)
814818
try:
815819
if image:
@@ -1157,9 +1161,14 @@ def _make_jog_increments(self):
11571161
# We use the pressed signal, not the toggled, otherwise two signals will be emitted
11581162
# One from the released button and one from the pressed button
11591163
# we make a list of the buttons to later add the hardware pins to them
1160-
label = _("Continuous")
1161-
rbt = Gtk.RadioButton(label = label)
1164+
rbt = self._new_button_with_predefined_image(
1165+
name=_("Continuous"),
1166+
size=(-1,-1),
1167+
image=self.widgets.img_continuous,
1168+
radio_button=True
1169+
)
11621170
rbt.set_property("name","rbt_0")
1171+
rbt.set_tooltip_text(_("Continuous jog"))
11631172
rbt.connect("pressed", self._jog_increment_changed)
11641173
self.widgets.vbtb_jog_incr.pack_start(rbt, True, True, 0)
11651174
rbt.set_property("draw_indicator", False)
@@ -4921,6 +4930,7 @@ def _set_icon_theme(self, name):
49214930
# jog
49224931
("img_rabbit_jog", "jog_speed_fast", 32),
49234932
("img_turtle_jog", "jog_speed_slow", 32),
4933+
("img_continuous", "jog_continuous", 24),
49244934
# fullscreen
49254935
("img_fullsize_preview0_open", "fullscreen_open", 48),
49264936
("img_fullsize_preview0_close", "fullscreen_close", 48),

0 commit comments

Comments
 (0)