def _build_ui(self):
self.set_border_width(3)
# the frame around the screenshot (placeholder)
self.screenshot = Gtk.VBox()
self.pack_start(self.screenshot, True, True, 0)
self.spinner = Gtk.Spinner()
self.spinner.set_size_request(*self.SPINNER_SIZE)
self.spinner.set_valign(Gtk.Align.CENTER)
self.spinner.set_halign(Gtk.Align.CENTER)
self.screenshot.add(self.spinner)
# clickable screenshot button
self.button = ScreenshotButton()
self.screenshot.pack_start(self.button, True, False, 0)
# unavailable layout
self.unavailable = Gtk.Label(label=_(self.NOT_AVAILABLE_STRING))
self.unavailable.set_alignment(0.5, 0.5)
# force the label state to INSENSITIVE so we get the nice
# subtle etched in look
self.unavailable.set_state(Gtk.StateType.INSENSITIVE)
self.screenshot.add(self.unavailable)
self.thumbnails = ThumbnailGallery(self)
self.thumbnails.set_margin_top(5)
self.thumbnails.set_halign(Gtk.Align.CENTER)
self.pack_end(self.thumbnails, False, False, 0)
self.thumbnails.connect(
"thumb-selected", self.on_thumbnail_selected)
self.button.connect("clicked", self.on_clicked)
self.button.connect('enter-notify-event', self._on_enter)
self.button.connect('leave-notify-event', self._on_leave)
self.show_all()
评论列表
文章目录