def test_visual_glitch_lp1048912(self): win = Gtk.Window() win.set_size_request(500, 300) scroll = Gtk.ScrolledWindow() win.add(scroll) viewport = Viewport() scroll.add(viewport) top_hbox = Gtk.HBox() viewport.add(top_hbox) right_column = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0) top_hbox.pack_start(right_column, True, True, 0) apptiles = Gtk.VBox() apptiles_frame = FramedHeaderBox() apptiles_frame.set_name("apptiles top") apptiles_frame.set_header_label("Frame1") apptiles_frame.add(apptiles) right_column.pack_start(apptiles_frame, True, True, 0) apptiles_frame.header_implements_more_button() apptiles2 = Gtk.VBox() apptiles2_frame = FramedHeaderBox() apptiles2_frame.set_name("apptiles bottom") apptiles2_frame.set_header_label("Frame2") apptiles2_frame.add(apptiles2) right_column.pack_start(apptiles2_frame, True, True, 0) apptiles2_frame.header_implements_more_button() # this delayed adding of the tiles causes a visual glitch like # described in #1048912 on the top of the bottom frame the line # will not be drawn correctly - any subsequent redraw of the # window will fix it GLib.timeout_add(1000, add_tiles, apptiles2) # this "viewport.queue_draw()" will fix the glitch #GLib.timeout_add_seconds(2, lambda: viewport.queue_draw()) # stop the test GLib.timeout_add_seconds(3, Gtk.main_quit) win.connect("destroy", Gtk.main_quit) win.show_all() Gtk.main()
def _append_sub_toprated(self): self.toprated = FlowableGrid() self.toprated.set_row_spacing(6) self.toprated.set_column_spacing(6) self.toprated_frame = FramedHeaderBox() self.toprated_frame.pack_start(self.toprated, True, True, 0) self.vbox.pack_start(self.toprated_frame, False, True, 0) return
def _append_sub_top_rated(self): self.top_rated = TileGrid() self.top_rated.connect("application-activated", self.on_application_activated) self.top_rated.set_row_spacing(6) self.top_rated.set_column_spacing(6) self.top_rated_frame = FramedHeaderBox() self.top_rated_frame.pack_start(self.top_rated, True, True, 0) self.vbox.pack_start(self.top_rated_frame, False, True, 0) return
def _append_whats_new(self): self.whats_new = FlowableGrid() self.whats_new_frame = FramedHeaderBox() self.whats_new_frame.set_header_label(_(u"What\u2019s New")) self.whats_new_frame.add(self.whats_new) whats_new_cat = self._update_whats_new_content() if whats_new_cat is not None: # only add to the visible right_frame if we actually have it self.right_column.pack_start(self.whats_new_frame, True, True, 0) self.whats_new_frame.header_implements_more_button() self.whats_new_frame.more.connect('clicked', self.on_category_clicked, whats_new_cat)
def _append_top_rated(self): self.top_rated = TileGrid() self.top_rated.connect("application-activated", self.on_application_activated) #~ self.top_rated.row_spacing = StockEms.SMALL self.top_rated_frame = FramedHeaderBox() self.top_rated_frame.set_header_label(_("Top Rated")) self.top_rated_frame.add(self.top_rated) self.bottom_hbox.pack_start(self.top_rated_frame, True, True, 0) top_rated_cat = self._update_top_rated_content() # only display the 'More' LinkButton if we have top_rated content if top_rated_cat is not None: self.top_rated_frame.header_implements_more_button() self.top_rated_frame.more.connect('clicked', self.on_category_clicked, top_rated_cat)
def _append_top_rated(self): self.toprated = FlowableGrid() #~ self.featured.row_spacing = StockEms.SMALL frame = FramedHeaderBox() frame.set_header_label(_("Top Rated")) frame.add(self.toprated) self.toprated_frame = frame self.right_column.pack_start(frame, True, True, 0) toprated_cat = self._update_toprated_content() # only display the 'More' LinkButton if we have toprated content if toprated_cat is not None: frame.header_implements_more_button() frame.more.connect('clicked', self.on_category_clicked, toprated_cat) return