def __init__(self, parent, **kwargs): self._window_iconified = False self._window_visible = False GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, **kwargs) # Enable support for tracking iconified state if hasattr(self, 'on_iconify') and hasattr(self, 'on_uniconify'): self.main_window.connect('window-state-event', \ self._on_window_state_event_iconified) # Enable support for tracking visibility state self.main_window.connect('visibility-notify-event', \ self._on_window_state_event_visibility) if parent is not None: self.main_window.set_transient_for(parent) if hasattr(self, 'center_on_widget'): (x, y) = parent.get_position() a = self.center_on_widget.allocation (x, y) = (x + a.x, y + a.y) (w, h) = (a.width, a.height) (pw, ph) = self.main_window.get_size() self.main_window.move(x + w/2 - pw/2, y + h/2 - ph/2)
def __init__(self, parent, **kwargs): self._window_iconified = False self._window_visible = False GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, **kwargs) # Enable support for tracking iconified state if hasattr(self, 'on_iconify') and hasattr(self, 'on_uniconify'): self.main_window.connect('window-state-event', \ self._on_window_state_event_iconified) # Enable support for tracking visibility state self.main_window.connect('visibility-notify-event', \ self._on_window_state_event_visibility) if parent is not None: self.main_window.set_transient_for(parent) if hasattr(self, 'center_on_widget'): (x, y) = parent.get_position() a = self.center_on_widget.allocation (x, y) = (x + a.x, y + a.y) (w, h) = (a.width, a.height) (pw, ph) = self.main_window.get_size() self.main_window.move(x + w / 2 - pw / 2, y + h / 2 - ph / 2)
def __init__(self, parent, **kwargs): self._window_iconified = False self._window_visible = False # Enable support for portrait mode changes on Maemo 5 if gpodder.ui.fremantle: self._window_orientation = Orientation.LANDSCAPE GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, **kwargs) # Enable support for portrait mode changes on Maemo 5 if gpodder.ui.fremantle: self.main_window.connect('configure-event', \ self._on_configure_event_maemo) # Enable support for fullscreen toggle key on Maemo 4 if gpodder.ui.diablo: self._maemo_fullscreen = False self._maemo_fullscreen_chain = None self.main_window.connect('key-press-event', \ self._on_key_press_event_maemo) self.main_window.connect('window-state-event', \ self._on_window_state_event_maemo) # Enable support for tracking iconified state if hasattr(self, 'on_iconify') and hasattr(self, 'on_uniconify'): self.main_window.connect('window-state-event', \ self._on_window_state_event_iconified) # Enable support for tracking visibility state if gpodder.ui.desktop: self.main_window.connect('visibility-notify-event', \ self._on_window_state_event_visibility) # Set widgets to finger-friendly mode if on Maemo for widget_name in self.finger_friendly_widgets: if hasattr(self, widget_name): self.set_finger_friendly(getattr(self, widget_name)) if parent is not None: self.main_window.set_transient_for(parent) if gpodder.ui.desktop: if hasattr(self, 'center_on_widget'): (x, y) = parent.get_position() a = self.center_on_widget.allocation (x, y) = (x + a.x, y + a.y) (w, h) = (a.width, a.height) (pw, ph) = self.main_window.get_size() self.main_window.move(x + w / 2 - pw / 2, y + h / 2 - ph / 2) elif gpodder.ui.diablo: self._maemo_fullscreen_chain = parent if parent.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN: self.main_window.fullscreen() self._maemo_fullscreen = True
def __init__(self, parent, **kwargs): self._window_iconified = False GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, parent, **kwargs) # Enable support for tracking iconified state if hasattr(self, 'on_iconify') and hasattr(self, 'on_uniconify'): self.main_window.connect('window-state-event', self._on_window_state_event_iconified)
def __init__(self, parent, **kwargs): self._window_iconified = False self._window_visible = False # Enable support for portrait mode changes on Maemo 5 if gpodder.ui.fremantle: self._window_orientation = Orientation.LANDSCAPE GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, **kwargs) # Enable support for portrait mode changes on Maemo 5 if gpodder.ui.fremantle: self.main_window.connect('configure-event', \ self._on_configure_event_maemo) # Enable support for fullscreen toggle key on Maemo 4 if gpodder.ui.diablo: self._maemo_fullscreen = False self._maemo_fullscreen_chain = None self.main_window.connect('key-press-event', \ self._on_key_press_event_maemo) self.main_window.connect('window-state-event', \ self._on_window_state_event_maemo) # Enable support for tracking iconified state if hasattr(self, 'on_iconify') and hasattr(self, 'on_uniconify'): self.main_window.connect('window-state-event', \ self._on_window_state_event_iconified) # Enable support for tracking visibility state if gpodder.ui.desktop: self.main_window.connect('visibility-notify-event', \ self._on_window_state_event_visibility) # Set widgets to finger-friendly mode if on Maemo for widget_name in self.finger_friendly_widgets: if hasattr(self, widget_name): self.set_finger_friendly(getattr(self, widget_name)) if parent is not None: self.main_window.set_transient_for(parent) if gpodder.ui.desktop: if hasattr(self, 'center_on_widget'): (x, y) = parent.get_position() a = self.center_on_widget.allocation (x, y) = (x + a.x, y + a.y) (w, h) = (a.width, a.height) (pw, ph) = self.main_window.get_size() self.main_window.move(x + w/2 - pw/2, y + h/2 - ph/2) elif gpodder.ui.diablo: self._maemo_fullscreen_chain = parent if parent.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN: self.main_window.fullscreen() self._maemo_fullscreen = True