@@ -138,15 +138,15 @@ def __init__(self, label_text, tooltip=None, obj_name=None):
138
138
if tooltip is not None : self .setToolTip (tooltip )
139
139
if obj_name is not None : self .setObjectName (obj_name )
140
140
141
- class CustomSpinBox (QtGui .QSpinBox ):
141
+ class CustomSpinBox (QtGui .QDoubleSpinBox ):
142
142
def __init__ (self , init_values = (0. , 100. , 0. , 1. ), tooltip = None , suffix = None , obj_name = None ):
143
143
super (CustomSpinBox , self ).__init__ ()
144
144
145
145
if any ([isinstance (n , float ) for n in init_values ]):
146
- self .input = QtGui . QDoubleSpinBox ( )
146
+ self .setDecimals ( 2 )
147
147
init_values = [float (n ) for n in init_values ]
148
148
else :
149
- self .input = QtGui . QSpinBox ( )
149
+ self .setDecimals ( 0 )
150
150
151
151
# - Init
152
152
spb_min , spb_max , spb_value , spb_step = init_values
@@ -173,7 +173,7 @@ def __init__(self, label_text, init_values=(0., 100., 0., 1.), tooltip=None, suf
173
173
input_obj_name , lbl_obj_name = obj_name
174
174
175
175
# - Widgets
176
- self .label = CustomLabel (label_text , tooltip , lbl_obj_name )
176
+ self .label = CustomLabel (label_text , tooltip , lbl_obj_name )
177
177
self .input = CustomSpinBox (init_values , tooltip , suffix , input_obj_name )
178
178
179
179
# - Layout
@@ -871,35 +871,34 @@ def __init__(self):
871
871
self .lay_controls = TRFlowLayout (spacing = 10 )
872
872
873
873
tooltip_button = "Scale X"
874
- self .spb_scale_x = CustomSpinLabel ('scale_x' , (- 999. , 999 , 0 , 1 ), tooltip_button , ' %' , ('spn_panel_inf' , 'lbl_panel' ))
874
+ self .spb_scale_x = CustomSpinLabel ('scale_x' , (- 999. , 999. , 100. , 1. ), tooltip_button , ' %' , ('spn_panel_inf' , 'lbl_panel' ))
875
875
self .lay_controls .addWidget (self .spb_scale_x )
876
876
877
877
tooltip_button = "Scale Y"
878
- self .spb_scale_y = CustomSpinLabel ('scale_y' , (- 999. , 999 , 0 , 1 ), tooltip_button , ' %' , ('spn_panel_inf' , 'lbl_panel' ))
878
+ self .spb_scale_y = CustomSpinLabel ('scale_y' , (- 999. , 999. , 100. , 1. ), tooltip_button , ' %' , ('spn_panel_inf' , 'lbl_panel' ))
879
879
self .lay_controls .addWidget (self .spb_scale_y )
880
880
881
881
tooltip_button = "Translate X"
882
- self .spb_translate_x = CustomSpinLabel ('translate_x' , (- 999. , 999 , 0 , 1 ), tooltip_button , ' u' , ('spn_panel_inf' , 'lbl_panel' ))
882
+ self .spb_translate_x = CustomSpinLabel ('translate_x' , (- 999. , 999 , 0. , 1. ), tooltip_button , ' u' , ('spn_panel_inf' , 'lbl_panel' ))
883
883
self .lay_controls .addWidget (self .spb_translate_x )
884
884
885
885
tooltip_button = "Translate Y"
886
- self .spb_translate_y = CustomSpinLabel ('translate_y' , (- 999. , 999 , 0 , 1 ), tooltip_button , ' u' , ('spn_panel_inf' , 'lbl_panel' ))
886
+ self .spb_translate_y = CustomSpinLabel ('translate_y' , (- 999. , 999. , 0. , 1. ), tooltip_button , ' u' , ('spn_panel_inf' , 'lbl_panel' ))
887
887
self .lay_controls .addWidget (self .spb_translate_y )
888
888
889
889
tooltip_button = "Skew/Slant"
890
- self .spb_shear = CustomSpinLabel ('skew' , (- 90. , 90 , 0 , 1 ), tooltip_button , ' °' , ('spn_panel_inf' , 'lbl_panel' ))
890
+ self .spb_shear = CustomSpinLabel ('skew' , (- 90. , 90. , 0. , 1. ), tooltip_button , ' °' , ('spn_panel_inf' , 'lbl_panel' ))
891
891
self .lay_controls .addWidget (self .spb_shear )
892
892
893
893
tooltip_button = "Rotate"
894
- self .spb_rotate = CustomSpinLabel ('rotate' , (- 360. , 360 , 0 , 1 ), tooltip_button , ' °' , ('spn_panel_inf' , 'lbl_panel' ))
894
+ self .spb_rotate = CustomSpinLabel ('rotate' , (- 360. , 360. , 0. , 1. ), tooltip_button , ' °' , ('spn_panel_inf' , 'lbl_panel' ))
895
895
self .lay_controls .addWidget (self .spb_rotate )
896
896
897
897
self .lay_box .addLayout (self .lay_controls )
898
898
899
899
box_transform .setLayout (self .lay_box )
900
900
self .lay_main .addWidget (box_transform )
901
901
902
- self .reset ()
903
902
self .setLayout (self .lay_main )
904
903
905
904
def reset (self ):
0 commit comments