def create_window(self, argv, descriptor): """ Create application main window as the Gtk.Window. :param: argv: application arguments. :param descriptor: general application descriptor. """ gtk_window = Gtk.Window() embed = GtkClutter.Embed() gtk_window.add(embed) gtk_window.stage = embed.get_stage() clutter_window = window.Window(self, gtk_window.stage, descriptor) clutter_window.wrapper = gtk_window gtk_window.stage.set_title('PISAK') gtk_window.stage.set_position(unit.MONITOR_X, unit.MONITOR_Y) if arg_parser.get_args().debug: coeff = 0.7 size = coeff*unit.w(1), coeff*unit.h(1) gtk_window.stage.set_size(*size) gtk_window.set_default_size(*size) gtk_window.set_resizable(True) else: gtk_window.stage.set_size(unit.w(1), unit.h(1)) gtk_window.stage.set_fullscreen(True) gtk_window.fullscreen() gtk_window.connect("destroy", lambda _: Gtk.main_quit()) return clutter_window
def create_window(self, argv, descriptor): """ Create application main window as the Gtk.Window. :param: argv: application arguments. :param descriptor: general application descriptor. """ gtk_window = Gtk.Window() embed = GtkClutter.Embed() gtk_window.add(embed) gtk_window.stage = embed.get_stage() clutter_window = window.Window(self, gtk_window.stage, descriptor) clutter_window.wrapper = gtk_window gtk_window.stage.set_title('PISAK') gtk_window.stage.set_position(unit.MONITOR_X, unit.MONITOR_Y) if arg_parser.get_args().debug: coeff = 0.7 size = coeff * unit.w(1), coeff * unit.h(1) gtk_window.stage.set_size(*size) gtk_window.set_default_size(*size) gtk_window.set_resizable(True) else: gtk_window.stage.set_size(unit.w(1), unit.h(1)) gtk_window.stage.set_fullscreen(True) gtk_window.fullscreen() gtk_window.connect("destroy", lambda _: Gtk.main_quit()) return clutter_window
def create_window(self, argv, descriptor): clutter_window = window.Window(self, Clutter.Stage(), descriptor) clutter_window.stage.set_title('Pisak Main') if arg_parser.get_args().debug: coeff = 0.7 clutter_window.stage.set_size(coeff * unit.w(1), coeff * unit.h(1)) clutter_window.stage.set_user_resizable(True) else: clutter_window.stage.set_size(unit.w(1), unit.h(1)) clutter_window.stage.set_fullscreen(True) clutter_window.stage.connect("destroy", lambda _: Clutter.main_quit()) return clutter_window
def create_window(self, argv, descriptor): clutter_window = window.Window(self, Clutter.Stage(), descriptor) clutter_window.stage.set_title('Pisak Main') if arg_parser.get_args().debug: coeff = 0.7 clutter_window.stage.set_size(coeff*unit.w(1), coeff*unit.h(1)) clutter_window.stage.set_user_resizable(True) else: clutter_window.stage.set_size(unit.w(1), unit.h(1)) clutter_window.stage.set_fullscreen(True) clutter_window.stage.connect("destroy", lambda _: Clutter.main_quit()) return clutter_window
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__(self): super().__init__() self.set_position(unit.MONITOR_X, unit.MONITOR_Y) self.set_size(unit.w(1), unit.h(1)) self._init_content() if not arg_parser.get_args().debug: self.set_fullscreen(True)
def _set_px_spacing(self, *args): if hasattr(self, "ratio_spacing"): if self.layout.get_orientation() == Clutter.Orientation.HORIZONTAL: px_spacing = unit.w(self.ratio_spacing) elif self.layout.get_orientation() == Clutter.Orientation.VERTICAL: px_spacing = unit.h(self.ratio_spacing) self.layout.set_spacing(px_spacing)
def __init__(self): self.index = 0 self.new_slide_transition = Clutter.PropertyTransition.new("x") self.new_slide_transition.connect("stopped", self._clean_up) self.old_slide_transition = Clutter.PropertyTransition.new("x") self.set_clip_to_allocation(True) self.transition_duration = 1000 self.idle_duration = 1000 self.pending_slides = () self.slideshow_on = False self.fullscreen_on = False self.slideshow_on_fullscreen = True self.old_slide = None self.slide = None self.album_length = None self.cached_slide_width = None self.cached_slide_height = None self._prev_content = None self._middleware = None self._exit_button = None self._cover = Clutter.Actor() self._cover.set_layout_manager(Clutter.BinLayout()) self._cover.set_size(unit.w(1), unit.h(1)) self.apply_props()
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 = widgets.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) # set the get_text method to the topic label so it can be read self.label.get_text = self.label.get_children()[0].get_text
def create_window(self, argv, descriptor): """ Create application main window as the Clutter.Stage. :param: argv: application arguments. :param descriptor: general application descriptor. """ clutter_window = window.Window(self, Clutter.Stage(), descriptor) clutter_window.stage.set_title('PISAK') clutter_window.stage.set_position(unit.MONITOR_X, unit.MONITOR_Y) if arg_parser.get_args().debug: coeff = 0.7 clutter_window.stage.set_size(coeff*unit.w(1), coeff*unit.h(1)) clutter_window.stage.set_user_resizable(True) else: clutter_window.stage.set_size(unit.w(1), unit.h(1)) clutter_window.stage.set_fullscreen(True) clutter_window.stage.connect("destroy", lambda _: Clutter.main_quit()) return clutter_window
def create_window(self, argv, descriptor): """ Create application main window as the Clutter.Stage. :param: argv: application arguments. :param descriptor: general application descriptor. """ clutter_window = window.Window(self, Clutter.Stage(), descriptor) clutter_window.stage.set_title('PISAK') clutter_window.stage.set_position(unit.MONITOR_X, unit.MONITOR_Y) if arg_parser.get_args().debug: coeff = 0.7 clutter_window.stage.set_size(coeff * unit.w(1), coeff * unit.h(1)) clutter_window.stage.set_user_resizable(True) else: clutter_window.stage.set_size(unit.w(1), unit.h(1)) clutter_window.stage.set_fullscreen(True) clutter_window.stage.connect("destroy", lambda _: Clutter.main_quit()) return clutter_window
def __init__(self, width, height, rows, columns, tiles, strategy, selector, ratio_spacing): super().__init__() self.set_size(width, height) self.strategy = strategy self.selector = selector layout = Clutter.BoxLayout() layout.set_spacing(unit.h(ratio_spacing)) layout.set_orientation(Clutter.Orientation.VERTICAL) self.set_layout_manager(layout) self.set_y_align(Clutter.ActorAlign.START) self._add_tiles(rows, columns, tiles, ratio_spacing)
def __init__(self): super().__init__() self._exit_button = None self._engine = None self._menu = None self._middleware = None self._exit_handler = 0 self._prev_content = None self._cover = Clutter.Actor() self._cover.set_layout_manager(Clutter.BinLayout()) self._cover.set_size(unit.w(1), unit.h(1)) self.fullscreen = False
def create_window(self, argv, descriptor): gtk_window = Gtk.Window() embed = GtkClutter.Embed() gtk_window.add(embed) gtk_window.stage = embed.get_stage() clutter_window = window.Window(self, gtk_window.stage, descriptor) clutter_window.wrapper = gtk_window gtk_window.stage.set_title('Pisak Main') if arg_parser.get_args().debug: coeff = 0.7 size = coeff*unit.w(1), coeff*unit.h(1) gtk_window.stage.set_size(*size) gtk_window.set_default_size(*size) gtk_window.set_resizable(True) else: gtk_window.stage.set_fullscreen(True) gtk_window.fullscreen() gtk_window.connect("destroy", lambda _: Gtk.main_quit()) return clutter_window
def create_window(self, argv, descriptor): gtk_window = Gtk.Window() embed = GtkClutter.Embed() gtk_window.add(embed) gtk_window.stage = embed.get_stage() clutter_window = window.Window(self, gtk_window.stage, descriptor) clutter_window.wrapper = gtk_window gtk_window.stage.set_title('Pisak Main') if arg_parser.get_args().debug: coeff = 0.7 size = coeff * unit.w(1), coeff * unit.h(1) gtk_window.stage.set_size(*size) gtk_window.set_default_size(*size) gtk_window.set_resizable(True) else: gtk_window.stage.set_fullscreen(True) gtk_window.fullscreen() gtk_window.connect("destroy", lambda _: Gtk.main_quit()) return clutter_window
def ratio_height(self, value): self._ratio_height = value self.set_height(unit.h(value))
def ratio_height(self, value): self._ratio_height = value converted_value = unit.h(value) self.set_height(converted_value) self.view_actor.set_height(converted_value)
def preview_ratio_height(self, value): self._preview_ratio_height = value self.preview.set_height(unit.h(value))
def ratio_margin_bottom(self, value): self._ratio_margin_bottom = value self.set_margin_bottom(unit.h(value))
def page_ratio_spacing(self, value): self._page_ratio_spacing = value self.page_spacing = int(min(unit.h(value), unit.w(value)))
def ratio_margin_top(self, value): self._ratio_margin_top = value self.set_margin_top(unit.h(value))