Пример #1
0
def set_default_photo_source():
    save = SaveListStore()

    if not save.has_save_file():

        monitor_w, monitor_h = get_geometry_first_monitor()
        if monitor_w > 800 and monitor_h > 600:
            SETTINGS_GEOMETRY.set_int('root-x', monitor_w - 225)
            SETTINGS_GEOMETRY.set_int('root-y', 200)

        folder = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES)
        sources = {0: {'source': 'Flickr', 'target': _('Interestingness')},
                   1: {'source': _('Folder'), 'target': folder}}
        save.save_to_json(sources)
Пример #2
0
    def on_window_leave_notify_event(self, widget, event):
#        if event.mode != 2:
#            return True
        self.photoimage.on_leave_cb(widget, event)

        # save geometry
        if not SETTINGS.get_boolean('window-fix'):
            x, y = widget.get_position()
            w, h = widget.get_size()

            if self.window.get_gravity() == Gdk.Gravity.CENTER:
                x += w / 2
                y += h / 2

            SETTINGS_GEOMETRY.set_int('root-x', x)
            SETTINGS_GEOMETRY.set_int('root-y', y)

        return False
Пример #3
0
    def on_window_leave_notify_event(self, widget, event):
        #        if event.mode != 2:
        #            return True
        self.photoimage.on_leave_cb(widget, event)

        # save geometry
        if not SETTINGS.get_boolean('window-fix'):
            x, y = widget.get_position()
            w, h = widget.get_size()

            if self.window.get_gravity() == Gdk.Gravity.CENTER:
                x += w / 2
                y += h / 2

            SETTINGS_GEOMETRY.set_int('root-x', x)
            SETTINGS_GEOMETRY.set_int('root-y', y)

        return False
Пример #4
0
def set_default_photo_source():
    save = SaveListStore()

    if not save.has_save_file():

        monitor_w, monitor_h = get_geometry_first_monitor()
        if monitor_w > 800 and monitor_h > 600:
            SETTINGS_GEOMETRY.set_int('root-x', monitor_w - 225)
            SETTINGS_GEOMETRY.set_int('root-y', 200)

        folder = GLib.get_user_special_dir(
            GLib.UserDirectory.DIRECTORY_PICTURES)
        sources = {
            0: {
                'source': 'Flickr',
                'target': _('Interestingness')
            },
            1: {
                'source': _('Folder'),
                'target': folder
            }
        }
        save.save_to_json(sources)