コード例 #1
0
ファイル: songlist.py プロジェクト: pensadorramm/quodlibet
            def column_clicked(column, *args):
                # if ctrl is held during the sort click, append a sort key
                # or change order if already sorted
                ctrl_held = False
                event = Gtk.get_current_event()
                if event:
                    ok, state = event.get_state()
                    if ok and state & qltk.get_primary_accel_mod():
                        ctrl_held = True

                self.toggle_column_sort(column, replace=not ctrl_held)
コード例 #2
0
            def column_clicked(column, *args):
                # if ctrl is held during the sort click, append a sort key
                # or change order if already sorted
                ctrl_held = False
                event = Gtk.get_current_event()
                if event:
                    ok, state = event.get_state()
                    if ok and state & qltk.get_primary_accel_mod():
                        ctrl_held = True

                self.toggle_column_sort(column, replace=not ctrl_held)
コード例 #3
0
    def __block_selection(self, event):
        x, y = map(int, [event.x, event.y])
        try:
            path, col, cellx, celly = self.get_path_at_pos(x, y)
        except TypeError:
            return True
        selection = self.get_selection()
        is_selected = selection.path_is_selected(path)
        mod_active = event.get_state() & (
            get_primary_accel_mod() | Gdk.ModifierType.SHIFT_MASK)

        if is_selected:
            self.__pending_action = (path, col, mod_active)
            selection.set_select_function(lambda *args: False, None)
        else:
            self.__pending_action = None
            selection.set_select_function(lambda *args: True, None)
コード例 #4
0
ファイル: views.py プロジェクト: mistotebe/quodlibet
    def __block_selection(self, event):
        x, y = map(int, [event.x, event.y])
        try:
            path, col, cellx, celly = self.get_path_at_pos(x, y)
        except TypeError:
            return True
        self.grab_focus()
        selection = self.get_selection()
        is_selected = selection.path_is_selected(path)
        mod_active = event.get_state() & (get_primary_accel_mod() | Gdk.ModifierType.SHIFT_MASK)

        if is_selected and not mod_active:
            self.__pending_event = [x, y]
            selection.set_select_function(lambda *args: False, None)
        elif event.type == Gdk.EventType.BUTTON_PRESS:
            self.__pending_event = None
            selection.set_select_function(lambda *args: True, None)
コード例 #5
0
    def __block_selection(self, event):
        x, y = map(int, [event.x, event.y])
        try:
            path, col, cellx, celly = self.get_path_at_pos(x, y)
        except TypeError:
            return True
        self.grab_focus()
        selection = self.get_selection()
        is_selected = selection.path_is_selected(path)
        mod_active = event.get_state() & (get_primary_accel_mod()
                                          | Gdk.ModifierType.SHIFT_MASK)

        if is_selected and not mod_active:
            self.__pending_event = [x, y]
            selection.set_select_function(lambda *args: False, None)
        elif event.type == Gdk.EventType.BUTTON_PRESS:
            self.__pending_event = None
            selection.set_select_function(lambda *args: True, None)
コード例 #6
0
ファイル: helper.py プロジェクト: ZDBioHazard/quodlibet
def send_button_click(widget, button, primary=False, shift=False,
                      recursive=False):
    """See send_key_click_event"""

    state = Gdk.ModifierType(0)
    if primary:
        state |= get_primary_accel_mod()
    if shift:
        state |= Gdk.ModifierType.SHIFT_MASK

    assert isinstance(widget, Gtk.Widget)
    handled = _send_button_click_event(widget, button=button, state=state)

    if recursive:
        if isinstance(widget, Gtk.Container):
            for child in widget.get_children():
                handled += send_button_click(
                    child, button, primary, shift, recursive)

    return handled
コード例 #7
0
ファイル: helper.py プロジェクト: markshep/quodlibet
def send_button_click(widget, button, primary=False, shift=False,
                      recursive=False):
    """See send_key_click_event"""

    state = Gdk.ModifierType(0)
    if primary:
        state |= get_primary_accel_mod()
    if shift:
        state |= Gdk.ModifierType.SHIFT_MASK

    assert isinstance(widget, Gtk.Widget)
    handled = _send_button_click_event(widget, button=button, state=state)

    if recursive:
        if isinstance(widget, Gtk.Container):
            for child in widget.get_children():
                handled += send_button_click(
                    child, button, primary, shift, recursive)

    return handled
コード例 #8
0
 def __drag_begin(self, *args):
     ok, state = Gtk.get_current_event_state()
     if ok and state & qltk.get_primary_accel_mod():
         self.__force_copy = True
     else:
         self.__force_copy = False
コード例 #9
0
ファイル: songlist.py プロジェクト: ZDBioHazard/quodlibet
 def __drag_begin(self, *args):
     ok, state = Gtk.get_current_event_state()
     if ok and state & qltk.get_primary_accel_mod():
         self.__force_copy = True
     else:
         self.__force_copy = False