def __init__(self, mailbox): super().__init__() self.hilite_tool = widgets.Aperture() self.label = layout.Box() self.box.add_child(self.label) self.label.orientation = Clutter.Orientation.VERTICAL self.label.ratio_spacing = 0.03 frame = widgets.Frame() frame.set_style_class('PisakEmailMessageTile') self.add_child(frame) margin = unit.h(0.0095) # create separate label for each header, specific to the given # `mailbox`; each label is set as an attribute of `self` with a # name of the corresponding header's lower-cased name; # list of headers is at the moment taken from the `imap_client` module. for header in imap_client.MAILBOX_HEADERS[mailbox]: label = Mx.Label() setattr(self, header.lower(), label) label.set_margin_right(margin) label.set_margin_left(margin) label.get_clutter_text().set_line_alignment(Pango.Alignment.CENTER) label.set_style_class('PisakEmailMessageTile' + header) self.label.add_child(label)
def _init_text(self): text = Mx.Label() text.set_style_class("LoadingPanel") text.set_text(MESSAGES["application_loading"]) text.set_x_align(Clutter.ActorAlign.CENTER) text.set_y_align(Clutter.ActorAlign.CENTER) self.add_child(text)
def _init_elements(self): self.preview = Mx.Image() self.preview.set_allow_upscale(True) self.box.add_child(self.preview) self.label = Mx.Label() self.label.set_style_class("PisakPhotoTileLabel") self.box.add_child(self.label)
def __init__(self): super().__init__() margin = 8 self.label = layout.Box() self.box.add_child(self.label) self.label.orientation = Clutter.Orientation.VERTICAL self.label.spacing = 20 self.title = Mx.Label() self.date = Mx.Label() self.title.set_margin_right(margin) self.title.set_margin_left(margin) self.date.set_margin_right(margin) self.date.set_margin_left(margin) self.title.get_clutter_text().set_line_alignment( Pango.Alignment.CENTER) self.date.get_clutter_text().set_line_alignment( Pango.Alignment.CENTER) self.title.set_style_class("PisakBlogPostTileTitle") self.date.set_style_class("PisakBlogPostTileDate") self.label.add_child(self.title) self.label.add_child(self.date)
def _init_text(self): self.box = Mx.BoxLayout() self.box.set_orientation(Mx.Orientation.VERTICAL) self.box.set_scroll_to_focused(True) self.text = Mx.Label() self.margin = Clutter.Margin.new() self.margin.top = 20 self.margin.left = self.margin.right = 10 self.text.set_margin(self.margin) self.box.add_actor(self.text, 0) self.clutter_text = self.text.get_clutter_text() self.connect("notify::mapped", self._check_to_resize) self.clutter_text.connect("text-changed", self._check_to_resize) self.clutter_text.connect("cursor-changed", self._scroll_to_view) self._set_text_params() self.add_actor(self.box)
def make_wifi_tab(self, ap): logging.debug("make_wifi") actor = Clutter.Actor() actor.set_size(self.actor_width, 40) text = Mx.Label() text.set_position(120, 0) apName = ap["service"][1]["Name"] if ap["active"]: text.set_text("* " + apName) else: text.set_text( " " + apName ) # the space is to keep the names aligned on the display text.set_style_class("wifi") actor.add_actor(text) tap = Clutter.TapAction() actor.add_action(tap) actor.ap = ap tap.connect("tap", self.ap_tap) actor.set_reactive(True) return actor
def _init_label(self): self.label = Mx.Label() self.add_actor(self.label)
def _display_popup_widget(self, container, message): popup = Mx.Label() popup.set_text(message) popup.set_style_class("PisakPopUp") container.add_child(popup)
def __init__(self): super().__init__() self.label = Mx.Label() self.label.set_style_class("PisakViewerProgressBar") self.bar.get_children()[0].set_style_class("PisakViewerProgressBar") self.bar.set_style_class("PisakViewerProgressBar")