def __init__(self, callback1=None, callback2=None): super(LoginBox, self).__init__() self.login_button = LoginButton("登陆网易帐号", callback1) self.sina_microblog_login_button = LoginButton("新浪微博登录", callback2) self.username_entry = gtk.Entry() self.username_entry.set_text('username or phone') self.password_entry = gtk.Entry() self.password_entry.set_text('password') self.password_entry.set_visibility(False) content_box = gtk.VBox() content_box.pack_start(create_bottom_align(), True, True) content_box.pack_start(self.username_entry, False, False) content_box.pack_start(self.password_entry, False, False) login_box = gtk.HButtonBox() login_box.pack_start(self.login_button, False, False, 16) content_box.pack_start(login_box, False, False, 16) sina_microblog_login_box = gtk.HButtonBox() sina_microblog_login_box.pack_start( self.sina_microblog_login_button, False, False, 16) content_box.pack_start(sina_microblog_login_box, False, False, 16) content_box.pack_start(create_upper_align(), True, True) self.pack_start(create_right_align(), True, True) self.pack_start(content_box, False, False) self.pack_start(create_left_align(), True, True) self.set_size_request(PLAYLIST_WIDTH, -1) self.connect("expose-event", self.on_loginbox_expose)
def create_jobs_box(self): self.file_job_button = self.create_job_button("plus", _("Add Music"), self.song_view.recursion_add_dir) # self.file_job_button.connect("clicked", self.open_file_or_dir) self.job_box = gtk.EventBox() self.job_box.set_size_request(220, -1) targets = [("text/deepin-songs", gtk.TARGET_SAME_APP, 1), ("text/uri-list", 0, 2), ("text/plain", 0, 3)] self.job_box.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP, targets, gtk.gdk.ACTION_COPY) self.job_box.set_visible_window(False) self.job_box.connect("drag-data-received", self.song_view.on_drag_data_received) # Content box. content_box = gtk.VBox() content_box.pack_start(create_bottom_align(), True, True) # content_box.pack_start(ImageBox(app_theme.get_pixbuf("jobs/scan_tip.png")), False, False) content_box.pack_start(self.file_job_button, False, False) content_box.pack_start(create_upper_align(), True, True) # Rind box. rind_box = gtk.HBox() rind_box.pack_start(create_right_align(), True, True) rind_box.pack_start(content_box, False, False) rind_box.pack_start(create_left_align(), True, True) self.job_box.add(rind_box) self.jobs_align = gtk.Alignment() self.jobs_align.set(0.5, 0.5, 1, 1) self.jobs_align.add(self.job_box) self.jobs_align.connect("expose-event", self.draw_mask)
def __init__(self, callback=None): super(LoginBox, self).__init__() self.login_button = LoginButton(callback) content_box = gtk.VBox() content_box.pack_start(create_bottom_align(), True, True) content_box.pack_start(self.login_button, False, False) content_box.pack_start(create_upper_align(), True, True) self.pack_start(create_right_align(), True, True) self.pack_start(content_box, False, False) self.pack_start(create_left_align(), True, True) self.set_size_request(PLAYLIST_WIDTH, -1) self.connect("expose-event", self.on_loginbox_expose)