def left_or_right_setting_changed(self, *args): ''' set left or right radio button active ''' is_left = settings.touchpad_get_left_handed() if is_left == "mouse": if settings.mouse_get_left_handed(): self.button_widgets["left_hand_radio"].set_active(True) self.button_widgets["left_hand_radio"].set_data( "changed-by-other-app", True) self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.button_widgets["right_hand_radio"].set_active(True) self.button_widgets["right_hand_radio"].set_data( "changed-by-other-app", True) self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: if is_left == "left": self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) self.button_widgets["%s_hand_radio" % is_left].set_active(True) self.button_widgets["%s_hand_radio" % is_left].set_data( "changed-by-other-app", True) self.image_widgets["custom"].queue_draw()
def left_or_right_setting_changed(self, *args): ''' set left or right radio button active ''' is_left = settings.touchpad_get_left_handed() if is_left == "mouse": if settings.mouse_get_left_handed(): self.button_widgets["left_hand_radio"].set_active(True) self.button_widgets["left_hand_radio"].set_data("changed-by-other-app", True) self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.button_widgets["right_hand_radio"].set_active(True) self.button_widgets["right_hand_radio"].set_data("changed-by-other-app", True) self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: if is_left == "left": self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) self.button_widgets["%s_hand_radio" % is_left].set_active(True) self.button_widgets["%s_hand_radio" % is_left].set_data("changed-by-other-app", True) self.image_widgets["custom"].queue_draw()
def __adjust_widget(self): ''' adjust widget ''' MID_SPACING = 10 RIGHT_BOX_WIDTH = TIP_BOX_WIDTH - 20 MAIN_AREA_WIDTH = 480 LABEL_WIDTH = 180 OPTION_LEFT_PADDING = WIDGET_SPACING + 16 TABLE_ROW_SPACING = 15 self.container_widgets["main_vbox"].pack_start(self.container_widgets["main_swindow"]) self.container_widgets["main_vbox"].pack_start(self.container_widgets["statusbar"], False, False) self.container_widgets["statusbar"].set_buttons([self.button_widgets["set_to_default"]]) self.container_widgets["main_swindow"].add_child(self.container_widgets["main_hbox"]) self.container_widgets["main_hbox"].set_spacing(MID_SPACING) self.container_widgets["main_hbox"].set_size_request(WINDOW_WIDTH-20, -1) self.container_widgets["main_hbox"].pack_start(self.alignment_widgets["left"]) self.container_widgets["main_hbox"].pack_start(self.alignment_widgets["right"], False, False) self.alignment_widgets["left"].add(self.container_widgets["left_vbox"]) self.alignment_widgets["right"].add(self.container_widgets["right_vbox"]) self.container_widgets["right_vbox"].set_size_request(RIGHT_BOX_WIDTH, -1) # set left padding self.alignment_widgets["left"].set(0.5, 0.5, 1.0, 1.0) self.alignment_widgets["left"].set_padding( TEXT_WINDOW_TOP_PADDING, 15, 0, TEXT_WINDOW_RIGHT_WIDGET_PADDING) # set right padding self.alignment_widgets["right"].set(0.0, 0.0, 1.0, 0.0) self.alignment_widgets["right"].set_padding(TEXT_WINDOW_TOP_PADDING, 0, 0, 60) self.container_widgets["left_vbox"].set_spacing(BETWEEN_SPACING) self.container_widgets["left_vbox"].pack_start( self.container_widgets["custom_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["pointer_speed_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["double_click_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["drag_threshold_main_vbox"], False, False) # set option label width label_widgets = self.label_widgets label_width = max(label_widgets["acceleration"].size_request()[0], label_widgets["sensitivity"].size_request()[0], label_widgets["click_rate"].size_request()[0], label_widgets["drag_threshold"].size_request()[0]) + 2 #label_widgets["acceleration"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["sensitivity"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["click_rate"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["drag_threshold"].set_size_request(label_width, WIDGET_HEIGHT) # custom self.alignment_widgets["custom_label"].add(self.container_widgets["custom_label_hbox"]) self.alignment_widgets["custom_button"].add(self.container_widgets["custom_button_hbox"]) # alignment set self.alignment_widgets["custom_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["custom_button"].set(0.0, 0.5, 1.0, 0.0) #self.alignment_widgets["custom_button"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING+OPTION_LEFT_PADDING-10, 0) self.alignment_widgets["custom_label"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING, 0) #self.alignment_widgets["custom_label"].set_size_request(-1, CONTAINNER_HEIGHT) self.alignment_widgets["custom_button"].set_size_request(-1, CONTAINNER_HEIGHT) self.container_widgets["custom_main_vbox"].pack_start( self.alignment_widgets["custom_label"], False, False) self.container_widgets["custom_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["custom_main_vbox"].pack_start( self.alignment_widgets["custom_button"]) # tips label self.container_widgets["custom_label_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["custom_label_hbox"].pack_start( self.image_widgets["custom"], False, False) self.container_widgets["custom_label_hbox"].pack_start( self.label_widgets["custom"], False, False) # radio button set is_left = settings.touchpad_get_left_handed() if is_left == "mouse": if settings.mouse_get_left_handed(): self.button_widgets["left_hand_radio"].set_active(True) self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.button_widgets["right_hand_radio"].set_active(True) self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: if is_left == "left": self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.image_widgets["custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) self.button_widgets["%s_hand_radio" % is_left].set_active(True) #self.container_widgets["custom_button_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["custom_button_hbox0"] = gtk.HBox(False) self.container_widgets["custom_button_hbox0"].set_spacing(WIDGET_SPACING) self.container_widgets["custom_button_hbox0"].pack_start( self.button_widgets["right_hand_radio"], False, False) self.container_widgets["custom_button_hbox0"].pack_start( self.button_widgets["left_hand_radio"], False, False) button_align = self.__make_align(self.container_widgets["custom_button_hbox0"], xalign=0.0) #button_align.set_size_request(HSCALEBAR_WIDTH+WIDGET_SPACING+label_width, CONTAINNER_HEIGHT) self.container_widgets["custom_button_hbox"].pack_start(self.__make_align(width=STANDARD_LINE-5), False, False) self.container_widgets["custom_button_hbox"].pack_start(button_align) # pointer speed self.alignment_widgets["pointer_speed_label"].add(self.container_widgets["pointer_speed_label_hbox"]) self.alignment_widgets["pointer_speed_table"].add(self.container_widgets["pointer_speed_table"]) # alignment set self.alignment_widgets["pointer_speed_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["pointer_speed_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["pointer_speed_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) #self.alignment_widgets["pointer_speed_label"].set_size_request(-1, CONTAINNER_HEIGHT) self.alignment_widgets["pointer_speed_label"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.alignment_widgets["pointer_speed_label"], False, False) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.alignment_widgets["pointer_speed_table"]) # tips lable self.container_widgets["pointer_speed_label_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["pointer_speed_label_hbox"].pack_start( self.image_widgets["speed"], False, False) self.container_widgets["pointer_speed_label_hbox"].pack_start( self.label_widgets["pointer_speed"], False, False) # motion acceleration # set original value self.scale_widgets["pointer_speed_accel"].set_value(settings.touchpad_get_motion_acceleration()) self.scale_widgets["pointer_speed_accel"].add_mark(self.adjust_widgets["pointer_speed_accel"].get_lower(), gtk.POS_BOTTOM, _("Slow")) self.scale_widgets["pointer_speed_accel"].add_mark(self.adjust_widgets["pointer_speed_accel"].get_upper(), gtk.POS_BOTTOM, _("Fast")) self.scale_widgets["pointer_speed_accel"].set_size_request(HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["pointer_speed_table"].set_size_request(MAIN_AREA_WIDTH, -1) self.container_widgets["pointer_speed_table"].set_col_spacings(WIDGET_SPACING) #self.container_widgets["pointer_speed_table"].set_row_spacing(0, TABLE_ROW_SPACING) acceleration_align = self.__make_align(self.label_widgets["acceleration"], xalign=1.0) acceleration_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["pointer_speed_table"].attach( acceleration_align, 0, 1, 0, 1, 4) self.container_widgets["pointer_speed_table"].attach( self.__make_align(self.scale_widgets["pointer_speed_accel"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) # motion threshold # set original value self.scale_widgets["pointer_speed_sensitiv"].set_value(settings.touchpad_get_motion_threshold()) self.scale_widgets["pointer_speed_sensitiv"].add_mark(self.adjust_widgets["pointer_speed_sensitiv"].get_lower(), gtk.POS_BOTTOM, _("Low")) self.scale_widgets["pointer_speed_sensitiv"].add_mark(self.adjust_widgets["pointer_speed_sensitiv"].get_upper(), gtk.POS_BOTTOM, _("High")) self.scale_widgets["pointer_speed_sensitiv"].set_size_request(HSCALEBAR_WIDTH, -1) # table attach sensitivity_align = self.__make_align(self.label_widgets["sensitivity"], xalign=1.0) sensitivity_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["pointer_speed_table"].attach( sensitivity_align, 0, 1, 1, 2, 4) self.container_widgets["pointer_speed_table"].attach( self.__make_align(self.scale_widgets["pointer_speed_sensitiv"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 1, 2, 4) # double click self.alignment_widgets["double_click_label"].add(self.container_widgets["double_click_label_hbox"]) self.alignment_widgets["double_click_table"].add(self.container_widgets["double_click_table"]) self.alignment_widgets["double_click_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["double_click_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["double_click_label"].set_size_request(-1, CONTAINNER_HEIGHT) #self.alignment_widgets["double_click_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) self.alignment_widgets["double_click_label"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["double_click_main_vbox"].pack_start( self.alignment_widgets["double_click_label"], False, False) self.container_widgets["double_click_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["double_click_main_vbox"].pack_start( self.alignment_widgets["double_click_table"]) # tips lable self.container_widgets["double_click_label_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["double_click_label_hbox"].pack_start( self.image_widgets["double"], False, False) self.container_widgets["double_click_label_hbox"].pack_start( self.label_widgets["double_click"], False, False) # double click rate # set original value self.scale_widgets["double_click_rate"].set_value(settings.touchpad_get_double_click()) self.scale_widgets["double_click_rate"].add_mark(self.adjust_widgets["double_click_rate"].get_lower(), gtk.POS_BOTTOM, _("Slow")) self.scale_widgets["double_click_rate"].add_mark(self.adjust_widgets["double_click_rate"].get_upper(), gtk.POS_BOTTOM, _("Fast")) self.scale_widgets["double_click_rate"].set_size_request(HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["double_click_table"].set_size_request(MAIN_AREA_WIDTH, -1) self.container_widgets["double_click_table"].set_col_spacings(WIDGET_SPACING) click_rate_align = self.__make_align(self.label_widgets["click_rate"], xalign=1.0) click_rate_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["double_click_table"].attach( click_rate_align, 0, 1, 0, 1, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.scale_widgets["double_click_rate"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.label_widgets["double_test"]), 1, 3, 1, 2, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.button_widgets["double_test"], height=-1), 3, 4, 0, 2, 0, 0, 0) self.button_widgets["double_test"].set_size_request( self.image_widgets["double_test_1"].get_pixbuf().get_width(), self.image_widgets["double_test_1"].get_pixbuf().get_height()) # drag threshold self.alignment_widgets["drag_threshold_label"].add(self.container_widgets["drag_threshold_label_hbox"]) self.alignment_widgets["drag_threshold_table"].add(self.container_widgets["drag_threshold_table"]) self.alignment_widgets["drag_threshold_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["drag_threshold_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["drag_threshold_label"].set_size_request(-1, CONTAINNER_HEIGHT) #self.alignment_widgets["drag_threshold_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) self.alignment_widgets["drag_threshold_label"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.alignment_widgets["drag_threshold_label"], False, False) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.alignment_widgets["drag_threshold_table"]) # tips lable self.container_widgets["drag_threshold_label_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["drag_threshold_label_hbox"].pack_start( self.image_widgets["drag"], False, False) self.container_widgets["drag_threshold_label_hbox"].pack_start( self.label_widgets["drag_drop"], False, False) # drag threshold time # set original value self.scale_widgets["drag_threshold_time"].set_value(settings.touchpad_get_drag_threshold()) self.scale_widgets["drag_threshold_time"].add_mark(self.adjust_widgets["drag_threshold_time"].get_lower(), gtk.POS_BOTTOM, _("Short")) self.scale_widgets["drag_threshold_time"].add_mark(self.adjust_widgets["drag_threshold_time"].get_upper(), gtk.POS_BOTTOM, _("Long")) self.scale_widgets["drag_threshold_time"].set_size_request(HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["drag_threshold_table"].set_size_request(MAIN_AREA_WIDTH, -1) self.container_widgets["drag_threshold_table"].set_col_spacings(WIDGET_SPACING) drag_threshold_align = self.__make_align(self.label_widgets["drag_threshold"], xalign=1.0) drag_threshold_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["drag_threshold_table"].attach( drag_threshold_align, 0, 1, 0, 1, 4) self.container_widgets["drag_threshold_table"].attach( self.__make_align(self.scale_widgets["drag_threshold_time"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) # relevant setting self.container_widgets["right_vbox"].pack_start( self.__make_align(self.label_widgets["relevant"], height=-1), False, False) self.container_widgets["right_vbox"].pack_start( self.alignment_widgets["keyboard_setting"], False, False) self.container_widgets["right_vbox"].pack_start( self.alignment_widgets["mouse_setting"], False, False) self.alignment_widgets["keyboard_setting"].add(self.button_widgets["keyboard_setting"]) self.alignment_widgets["mouse_setting"].add(self.button_widgets["mouse_setting"]) self.alignment_widgets["keyboard_setting"].set(0.0, 0.5, 0.0, 0.0) self.alignment_widgets["mouse_setting"].set(0.0, 0.5, 0.0, 0.0) self.alignment_widgets["keyboard_setting"].set_padding(15, 15, 0, 0) self.alignment_widgets["keyboard_setting"].set_size_request(-1, -1) self.alignment_widgets["mouse_setting"].set_size_request(-1, -1) if not self.has_touchpad: self.container_widgets["statusbar"].set_sensitive(False) self.alignment_widgets["left"].set_sensitive(False) self.label_widgets["acceleration"].set_sensitive(False) self.label_widgets["sensitivity"].set_sensitive(False) self.label_widgets["click_rate"].set_sensitive(False) self.label_widgets["drag_threshold"].set_sensitive(False) self.label_widgets["custom"].set_sensitive(False) self.label_widgets["pointer_speed"].set_sensitive(False) self.label_widgets["double_click"].set_sensitive(False) self.label_widgets["drag_drop"].set_sensitive(False) self.label_widgets["double_test"].set_sensitive(False) self.scale_widgets["pointer_speed_accel"].set_enable(False) self.scale_widgets["pointer_speed_sensitiv"].set_enable(False) self.scale_widgets["double_click_rate"].set_enable(False) self.scale_widgets["drag_threshold_time"].set_enable(False)
def __adjust_widget(self): ''' adjust widget ''' MID_SPACING = 10 RIGHT_BOX_WIDTH = TIP_BOX_WIDTH - 20 MAIN_AREA_WIDTH = 480 LABEL_WIDTH = 180 OPTION_LEFT_PADDING = WIDGET_SPACING + 16 TABLE_ROW_SPACING = 15 self.container_widgets["main_vbox"].pack_start( self.container_widgets["main_swindow"]) self.container_widgets["main_vbox"].pack_start( self.container_widgets["statusbar"], False, False) self.container_widgets["statusbar"].set_buttons( [self.button_widgets["set_to_default"]]) self.container_widgets["main_swindow"].add_child( self.container_widgets["main_hbox"]) self.container_widgets["main_hbox"].set_spacing(MID_SPACING) self.container_widgets["main_hbox"].set_size_request( WINDOW_WIDTH - 20, -1) self.container_widgets["main_hbox"].pack_start( self.alignment_widgets["left"]) self.container_widgets["main_hbox"].pack_start( self.alignment_widgets["right"], False, False) self.alignment_widgets["left"].add(self.container_widgets["left_vbox"]) self.alignment_widgets["right"].add( self.container_widgets["right_vbox"]) self.container_widgets["right_vbox"].set_size_request( RIGHT_BOX_WIDTH, -1) # set left padding self.alignment_widgets["left"].set(0.5, 0.5, 1.0, 1.0) self.alignment_widgets["left"].set_padding( TEXT_WINDOW_TOP_PADDING, 15, 0, TEXT_WINDOW_RIGHT_WIDGET_PADDING) # set right padding self.alignment_widgets["right"].set(0.0, 0.0, 1.0, 0.0) self.alignment_widgets["right"].set_padding(TEXT_WINDOW_TOP_PADDING, 0, 0, 60) self.container_widgets["left_vbox"].set_spacing(BETWEEN_SPACING) self.container_widgets["left_vbox"].pack_start( self.container_widgets["custom_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["pointer_speed_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["double_click_main_vbox"], False, False) self.container_widgets["left_vbox"].pack_start( self.container_widgets["drag_threshold_main_vbox"], False, False) # set option label width label_widgets = self.label_widgets label_width = max( label_widgets["acceleration"].size_request()[0], label_widgets["sensitivity"].size_request()[0], label_widgets["click_rate"].size_request()[0], label_widgets["drag_threshold"].size_request()[0]) + 2 #label_widgets["acceleration"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["sensitivity"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["click_rate"].set_size_request(label_width, WIDGET_HEIGHT) #label_widgets["drag_threshold"].set_size_request(label_width, WIDGET_HEIGHT) # custom self.alignment_widgets["custom_label"].add( self.container_widgets["custom_label_hbox"]) self.alignment_widgets["custom_button"].add( self.container_widgets["custom_button_hbox"]) # alignment set self.alignment_widgets["custom_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["custom_button"].set(0.0, 0.5, 1.0, 0.0) #self.alignment_widgets["custom_button"].set_padding(0, 0, TEXT_WINDOW_LEFT_PADDING+OPTION_LEFT_PADDING-10, 0) self.alignment_widgets["custom_label"].set_padding( 0, 0, TEXT_WINDOW_LEFT_PADDING, 0) #self.alignment_widgets["custom_label"].set_size_request(-1, CONTAINNER_HEIGHT) self.alignment_widgets["custom_button"].set_size_request( -1, CONTAINNER_HEIGHT) self.container_widgets["custom_main_vbox"].pack_start( self.alignment_widgets["custom_label"], False, False) self.container_widgets["custom_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["custom_main_vbox"].pack_start( self.alignment_widgets["custom_button"]) # tips label self.container_widgets["custom_label_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["custom_label_hbox"].pack_start( self.image_widgets["custom"], False, False) self.container_widgets["custom_label_hbox"].pack_start( self.label_widgets["custom"], False, False) # radio button set is_left = settings.touchpad_get_left_handed() if is_left == "mouse": if settings.mouse_get_left_handed(): self.button_widgets["left_hand_radio"].set_active(True) self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.button_widgets["right_hand_radio"].set_active(True) self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: if is_left == "left": self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_r%s.png" % (MODULE_NAME, self.has_touchpad_icon)) else: self.image_widgets[ "custom"].image_dpixbuf = app_theme.get_pixbuf( "%s/pad_l%s.png" % (MODULE_NAME, self.has_touchpad_icon)) self.button_widgets["%s_hand_radio" % is_left].set_active(True) #self.container_widgets["custom_button_hbox"].set_spacing(WIDGET_SPACING) self.container_widgets["custom_button_hbox0"] = gtk.HBox(False) self.container_widgets["custom_button_hbox0"].set_spacing( WIDGET_SPACING) self.container_widgets["custom_button_hbox0"].pack_start( self.button_widgets["right_hand_radio"], False, False) self.container_widgets["custom_button_hbox0"].pack_start( self.button_widgets["left_hand_radio"], False, False) button_align = self.__make_align( self.container_widgets["custom_button_hbox0"], xalign=0.0) #button_align.set_size_request(HSCALEBAR_WIDTH+WIDGET_SPACING+label_width, CONTAINNER_HEIGHT) self.container_widgets["custom_button_hbox"].pack_start( self.__make_align(width=STANDARD_LINE - 5), False, False) self.container_widgets["custom_button_hbox"].pack_start(button_align) # pointer speed self.alignment_widgets["pointer_speed_label"].add( self.container_widgets["pointer_speed_label_hbox"]) self.alignment_widgets["pointer_speed_table"].add( self.container_widgets["pointer_speed_table"]) # alignment set self.alignment_widgets["pointer_speed_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["pointer_speed_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["pointer_speed_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) #self.alignment_widgets["pointer_speed_label"].set_size_request(-1, CONTAINNER_HEIGHT) self.alignment_widgets["pointer_speed_label"].set_padding( 0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.alignment_widgets["pointer_speed_label"], False, False) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["pointer_speed_main_vbox"].pack_start( self.alignment_widgets["pointer_speed_table"]) # tips lable self.container_widgets["pointer_speed_label_hbox"].set_spacing( WIDGET_SPACING) self.container_widgets["pointer_speed_label_hbox"].pack_start( self.image_widgets["speed"], False, False) self.container_widgets["pointer_speed_label_hbox"].pack_start( self.label_widgets["pointer_speed"], False, False) # motion acceleration # set original value self.scale_widgets["pointer_speed_accel"].set_value( settings.touchpad_get_motion_acceleration()) self.scale_widgets["pointer_speed_accel"].add_mark( self.adjust_widgets["pointer_speed_accel"].get_lower(), gtk.POS_BOTTOM, _("Slow")) self.scale_widgets["pointer_speed_accel"].add_mark( self.adjust_widgets["pointer_speed_accel"].get_upper(), gtk.POS_BOTTOM, _("Fast")) self.scale_widgets["pointer_speed_accel"].set_size_request( HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["pointer_speed_table"].set_size_request( MAIN_AREA_WIDTH, -1) self.container_widgets["pointer_speed_table"].set_col_spacings( WIDGET_SPACING) #self.container_widgets["pointer_speed_table"].set_row_spacing(0, TABLE_ROW_SPACING) acceleration_align = self.__make_align( self.label_widgets["acceleration"], xalign=1.0) acceleration_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["pointer_speed_table"].attach( acceleration_align, 0, 1, 0, 1, 4) self.container_widgets["pointer_speed_table"].attach( self.__make_align(self.scale_widgets["pointer_speed_accel"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) # motion threshold # set original value self.scale_widgets["pointer_speed_sensitiv"].set_value( settings.touchpad_get_motion_threshold()) self.scale_widgets["pointer_speed_sensitiv"].add_mark( self.adjust_widgets["pointer_speed_sensitiv"].get_lower(), gtk.POS_BOTTOM, _("Low")) self.scale_widgets["pointer_speed_sensitiv"].add_mark( self.adjust_widgets["pointer_speed_sensitiv"].get_upper(), gtk.POS_BOTTOM, _("High")) self.scale_widgets["pointer_speed_sensitiv"].set_size_request( HSCALEBAR_WIDTH, -1) # table attach sensitivity_align = self.__make_align( self.label_widgets["sensitivity"], xalign=1.0) sensitivity_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["pointer_speed_table"].attach( sensitivity_align, 0, 1, 1, 2, 4) self.container_widgets["pointer_speed_table"].attach( self.__make_align(self.scale_widgets["pointer_speed_sensitiv"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 1, 2, 4) # double click self.alignment_widgets["double_click_label"].add( self.container_widgets["double_click_label_hbox"]) self.alignment_widgets["double_click_table"].add( self.container_widgets["double_click_table"]) self.alignment_widgets["double_click_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["double_click_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["double_click_label"].set_size_request(-1, CONTAINNER_HEIGHT) #self.alignment_widgets["double_click_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) self.alignment_widgets["double_click_label"].set_padding( 0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["double_click_main_vbox"].pack_start( self.alignment_widgets["double_click_label"], False, False) self.container_widgets["double_click_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["double_click_main_vbox"].pack_start( self.alignment_widgets["double_click_table"]) # tips lable self.container_widgets["double_click_label_hbox"].set_spacing( WIDGET_SPACING) self.container_widgets["double_click_label_hbox"].pack_start( self.image_widgets["double"], False, False) self.container_widgets["double_click_label_hbox"].pack_start( self.label_widgets["double_click"], False, False) # double click rate # set original value self.scale_widgets["double_click_rate"].set_value( settings.touchpad_get_double_click()) self.scale_widgets["double_click_rate"].add_mark( self.adjust_widgets["double_click_rate"].get_lower(), gtk.POS_BOTTOM, _("Slow")) self.scale_widgets["double_click_rate"].add_mark( self.adjust_widgets["double_click_rate"].get_upper(), gtk.POS_BOTTOM, _("Fast")) self.scale_widgets["double_click_rate"].set_size_request( HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["double_click_table"].set_size_request( MAIN_AREA_WIDTH, -1) self.container_widgets["double_click_table"].set_col_spacings( WIDGET_SPACING) click_rate_align = self.__make_align(self.label_widgets["click_rate"], xalign=1.0) click_rate_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["double_click_table"].attach( click_rate_align, 0, 1, 0, 1, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.scale_widgets["double_click_rate"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.label_widgets["double_test"]), 1, 3, 1, 2, 4) self.container_widgets["double_click_table"].attach( self.__make_align(self.button_widgets["double_test"], height=-1), 3, 4, 0, 2, 0, 0, 0) self.button_widgets["double_test"].set_size_request( self.image_widgets["double_test_1"].get_pixbuf().get_width(), self.image_widgets["double_test_1"].get_pixbuf().get_height()) # drag threshold self.alignment_widgets["drag_threshold_label"].add( self.container_widgets["drag_threshold_label_hbox"]) self.alignment_widgets["drag_threshold_table"].add( self.container_widgets["drag_threshold_table"]) self.alignment_widgets["drag_threshold_label"].set(0.0, 0.5, 1.0, 0.0) self.alignment_widgets["drag_threshold_table"].set(0.0, 0.5, 1.0, 1.0) #self.alignment_widgets["drag_threshold_label"].set_size_request(-1, CONTAINNER_HEIGHT) #self.alignment_widgets["drag_threshold_table"].set_padding(0, 0, OPTION_LEFT_PADDING, 0) self.alignment_widgets["drag_threshold_label"].set_padding( 0, 0, TEXT_WINDOW_LEFT_PADDING, 0) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.alignment_widgets["drag_threshold_label"], False, False) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.__setup_separator(), False, False) self.container_widgets["drag_threshold_main_vbox"].pack_start( self.alignment_widgets["drag_threshold_table"]) # tips lable self.container_widgets["drag_threshold_label_hbox"].set_spacing( WIDGET_SPACING) self.container_widgets["drag_threshold_label_hbox"].pack_start( self.image_widgets["drag"], False, False) self.container_widgets["drag_threshold_label_hbox"].pack_start( self.label_widgets["drag_drop"], False, False) # drag threshold time # set original value self.scale_widgets["drag_threshold_time"].set_value( settings.touchpad_get_drag_threshold()) self.scale_widgets["drag_threshold_time"].add_mark( self.adjust_widgets["drag_threshold_time"].get_lower(), gtk.POS_BOTTOM, _("Short")) self.scale_widgets["drag_threshold_time"].add_mark( self.adjust_widgets["drag_threshold_time"].get_upper(), gtk.POS_BOTTOM, _("Long")) self.scale_widgets["drag_threshold_time"].set_size_request( HSCALEBAR_WIDTH, -1) # table attach self.container_widgets["drag_threshold_table"].set_size_request( MAIN_AREA_WIDTH, -1) self.container_widgets["drag_threshold_table"].set_col_spacings( WIDGET_SPACING) drag_threshold_align = self.__make_align( self.label_widgets["drag_threshold"], xalign=1.0) drag_threshold_align.set_size_request(STANDARD_LINE, CONTAINNER_HEIGHT) self.container_widgets["drag_threshold_table"].attach( drag_threshold_align, 0, 1, 0, 1, 4) self.container_widgets["drag_threshold_table"].attach( self.__make_align(self.scale_widgets["drag_threshold_time"], yalign=0.0, yscale=1.0, padding_top=1, height=43), 1, 3, 0, 1, 4) # relevant setting self.container_widgets["right_vbox"].pack_start( self.__make_align(self.label_widgets["relevant"], height=-1), False, False) self.container_widgets["right_vbox"].pack_start( self.alignment_widgets["keyboard_setting"], False, False) self.container_widgets["right_vbox"].pack_start( self.alignment_widgets["mouse_setting"], False, False) self.alignment_widgets["keyboard_setting"].add( self.button_widgets["keyboard_setting"]) self.alignment_widgets["mouse_setting"].add( self.button_widgets["mouse_setting"]) self.alignment_widgets["keyboard_setting"].set(0.0, 0.5, 0.0, 0.0) self.alignment_widgets["mouse_setting"].set(0.0, 0.5, 0.0, 0.0) self.alignment_widgets["keyboard_setting"].set_padding(15, 15, 0, 0) self.alignment_widgets["keyboard_setting"].set_size_request(-1, -1) self.alignment_widgets["mouse_setting"].set_size_request(-1, -1) if not self.has_touchpad: self.container_widgets["statusbar"].set_sensitive(False) self.alignment_widgets["left"].set_sensitive(False) self.label_widgets["acceleration"].set_sensitive(False) self.label_widgets["sensitivity"].set_sensitive(False) self.label_widgets["click_rate"].set_sensitive(False) self.label_widgets["drag_threshold"].set_sensitive(False) self.label_widgets["custom"].set_sensitive(False) self.label_widgets["pointer_speed"].set_sensitive(False) self.label_widgets["double_click"].set_sensitive(False) self.label_widgets["drag_drop"].set_sensitive(False) self.label_widgets["double_test"].set_sensitive(False) self.scale_widgets["pointer_speed_accel"].set_enable(False) self.scale_widgets["pointer_speed_sensitiv"].set_enable(False) self.scale_widgets["double_click_rate"].set_enable(False) self.scale_widgets["drag_threshold_time"].set_enable(False)