1+ from gi .repository import Pango
2+
3+ # reduce size of v-buttons
4+ self .widgets ["vbtb_main" ].set_size_request (78 , - 1 )
5+ self .widgets ["lbl_time" ].hide ()
6+ self .widgets ["vbtb_main" ].set_layout (Gtk .ButtonBoxStyle .EXPAND )
7+ vbuttons = self .widgets ["vbtb_main" ].get_children ()
8+ for v in vbuttons :
9+ v .set_size_request (60 , 56 )
10+
11+ # change layout of h-button boxes to allow smaller spacing & resize buttons
12+ hbuttonboxes = [ "hbtb_main" , "hbtb_MDI" , "hbtb_auto" , "hbtb_ref" ,
13+ "hbtb_touch_off" , "hbtb_setup" , "hbtb_edit" , "hbtb_tool" ,
14+ "hbtb_load_file" , "hbtb_ref_joints" ]
15+ for b in hbuttonboxes :
16+ self .widgets [b ].set_layout (Gtk .ButtonBoxStyle .EXPAND )
17+ children = self .widgets [b ].get_children ()
18+ for c in children :
19+ c .set_size_request (60 , 56 )
20+ if type (c ) is Gtk .Button :
21+ btn_child = c .get_children ()[0 ]
22+ if type (btn_child ) is Gtk .Label :
23+ # btn_child.set_ellipsize(Pango.EllipsizeMode.END)
24+ btn_child .set_line_wrap (True )
25+ btn_child .set_line_wrap_mode (Pango .WrapMode .WORD_CHAR )
26+
27+ # optimize space in jog box
28+ self .widgets ["vbtb_jog_incr" ].hide ()
29+ self .widgets ["vbx_jog" ].set_size_request (- 1 , - 1 )
30+
31+ # second row for gremlin buttons
32+ self .widgets ["box_gremlin_buttons" ].remove (self .widgets ["tbtn_view_dimension" ])
33+ self .widgets ["box_gremlin_buttons" ].remove (self .widgets ["tbtn_view_tool_path" ])
34+ self .widgets ["box_gremlin_buttons" ].remove (self .widgets ["btn_delete_view" ])
35+ self .widgets ["btn_zoom_out" ].set_margin_end (0 )
36+ hbox_gremlin_buttons_2 = Gtk .Box (orientation = Gtk .Orientation .HORIZONTAL )
37+ hbox_gremlin_buttons_2 .show ()
38+ hbox_gremlin_buttons_2 .pack_end (self .widgets ["btn_delete_view" ], False , False , 0 )
39+ hbox_gremlin_buttons_2 .pack_end (self .widgets ["tbtn_view_tool_path" ], False , False , 0 )
40+ hbox_gremlin_buttons_2 .pack_end (self .widgets ["tbtn_view_dimension" ], False , False , 0 )
41+ self .widgets ["vbox15" ].pack_end (hbox_gremlin_buttons_2 , False , False , 3 )
42+
43+ # reorder settings page
44+ self .widgets ["vbox_window" ].remove (self .widgets ["frm_ntb_preview" ]) # "On Touch off"
45+ self .widgets ["vbox_window" ].remove (self .widgets ["frm_keyboard" ])
46+ self .widgets ["vbox_dro_settings" ].remove (self .widgets ["frm_preview" ])
47+ self .widgets ["vbox_file" ].remove (self .widgets ["frm_message_position" ])
48+ self .widgets ["vbox_file" ].remove (self .widgets ["frm_themes" ])
49+ self .widgets ["vbox21" ].remove (self .widgets ["frm_unlock" ])
50+ self .widgets ["vbox_window" ].pack_start (self .widgets ["frm_preview" ], False , False , 3 )
51+ self .widgets ["vbox_dro_settings" ].pack_start (self .widgets ["frm_ntb_preview" ], False , False , 3 )
52+ vbox_c1 = Gtk .Box (orientation = Gtk .Orientation .VERTICAL )
53+ vbox_c2 = Gtk .Box (orientation = Gtk .Orientation .VERTICAL )
54+ hbox_setup_appearance_2 = Gtk .Box (orientation = Gtk .Orientation .HORIZONTAL )
55+ hbox_setup_appearance_2 .pack_start (vbox_c1 , False , False , 3 )
56+ hbox_setup_appearance_2 .pack_start (vbox_c2 , False , False , 3 )
57+ hbox_setup_appearance_2 .show ()
58+ vbox_c1 .pack_start (self .widgets ["frm_keyboard" ], False , False , 3 )
59+ vbox_c1 .pack_start (self .widgets ["frm_message_position" ], False , False , 3 )
60+ vbox_c2 .pack_start (self .widgets ["frm_themes" ], False , False , 3 )
61+ vbox_c2 .pack_start (self .widgets ["frm_unlock" ], False , False , 3 )
62+ vbox_c1 .show ()
63+ vbox_c2 .show ()
64+ label = Gtk .Label (label = _ ("Appearance" ) + " 2" )
65+ self .widgets ["ntb_setup" ].insert_page (hbox_setup_appearance_2 , label , 1 )
66+
67+ # reorder info box (feed rate, rapid override, spindle and cooling)
68+ self .widgets ["box_info" ].remove (self .widgets ["grid_search" ])
69+ self .widgets ["box_info" ].remove (self .widgets ["ntb_info" ])
70+ self .widgets ["ntb_info" ].remove (self .widgets ["hbox_main_info" ])
71+ self .widgets ["hbox_main_info" ].remove (self .widgets ["box_tool_and_code_info" ])
72+
73+ box_info = Gtk .Box (orientation = Gtk .Orientation .VERTICAL )
74+ box_info .show ()
75+ box_info .pack_start (self .widgets ["box_tool_and_code_info" ], False , False , 0 )
76+ box_info .pack_end (self .widgets ["hbox_main_info" ], False , False , 0 )
77+ self .widgets ["ntb_user_tabs" ].append_page (box_info , Gtk .Label ("Info" ))
78+
79+ # enable user tab button to access info box
80+ self .widgets .tbtn_user_tabs .set_sensitive (True )
81+ self .user_tabs_enabled = True
82+
83+ # change default values (not necessary with correct pref file)
84+ self .xpos = 20
85+ self .ypos = 20
86+ self .width = 770
87+ self .height = 580
88+ self .widgets .adj_x_pos .set_value (self .xpos )
89+ self .widgets .adj_y_pos .set_value (self .ypos )
90+ self .widgets .adj_width .set_value (self .width )
91+ self .widgets .adj_height .set_value (self .height )
0 commit comments