def __init__(self, store): self.game_store = store self.model = self.game_store.modelfilter super(GameGridView, self).__init__(model=self.model) self.set_column_spacing(1) self.set_pixbuf_column(COL_ICON) self.set_item_padding(1) self.cell_width = (BANNER_SIZE[0] if store.icon_type == "banner" else BANNER_SMALL_SIZE[0]) self.cell_renderer = GridViewCellRendererText(self.cell_width) self.pack_end(self.cell_renderer, False) self.add_attribute(self.cell_renderer, 'markup', COL_NAME) self.connect_signals() self.connect('item-activated', self.on_item_activated) self.connect('selection-changed', self.on_selection_changed) store.connect('icons-changed', self.on_icons_changed)
def __init__(self, store, service_media): self.game_store = store self.service_media = service_media self.model = self.game_store.store super().__init__(model=self.game_store.store) GameView.__init__(self) self.service = None self.set_column_spacing(1) self.set_pixbuf_column(COL_ICON) self.set_item_padding(1) self.cell_width = (max(service_media.size[0], self.min_width)) self.cell_renderer = GridViewCellRendererText(self.cell_width) self.pack_end(self.cell_renderer, False) self.add_attribute(self.cell_renderer, "markup", COL_NAME) self.connect_signals() self.connect("item-activated", self.on_item_activated) self.connect("selection-changed", self.on_selection_changed) store.connect("icons-changed", self.on_icons_changed)
def __init__(self, store): self.game_store = store self.model = self.game_store.modelsort super().__init__(model=self.model) try: img_size = IMAGE_SIZES[store.image_type | ImageType.banner] except ValueError: img_size = IMAGE_SIZES[ImageType.banner_small] self.set_column_spacing(1) self.set_pixbuf_column(COL_ICON) self.set_item_padding(1) self.cell_width = img_size[0] self.cell_renderer = GridViewCellRendererText(self.cell_width) self.pack_end(self.cell_renderer, False) self.add_attribute(self.cell_renderer, "markup", COL_NAME) self.connect_signals() self.connect("item-activated", self.on_item_activated) self.connect("selection-changed", self.on_selection_changed) store.connect("icons-changed", self.on_icons_changed)