Ticket #4065: 0001-Palettes-move-PRIMARY-and-SECONDARY-constant-to-the-.patch

File 0001-Palettes-move-PRIMARY-and-SECONDARY-constant-to-the-.patch, 1.9 KB (added by erikos, 11 years ago)

Palettes: move PRIMARY and SECONDARY constant to the base class

  • src/sugar3/graphics/palette.py

    From ae2d86d8e461be36952dcccaff20507cded68f84 Mon Sep 17 00:00:00 2001
    From: Simon Schampijer <simon@laptop.org>
    Date: Mon, 22 Oct 2012 19:04:36 +0200
    Subject: [PATCH toolkit-gtk3] Palettes: move PRIMARY and SECONDARY constant
     to the base class
    
    Signed-off-by: Simon Schampijer <simon@laptop.org>
    ---
     src/sugar3/graphics/palette.py       | 3 ---
     src/sugar3/graphics/palettewindow.py | 7 +++++--
     2 files changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py
    index fe4440b..efdc9fd 100644
    a b class Palette(PaletteWindow): 
    9090    display such information.
    9191    """
    9292
    93     PRIMARY = 0
    94     SECONDARY = 1
    95 
    9693    __gsignals__ = {
    9794        'activate': (GObject.SignalFlags.RUN_FIRST, None, ([])),
    9895    }
  • src/sugar3/graphics/palettewindow.py

    diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
    index 3be7fab..5965441 100644
    a b class PaletteWindow(GObject.GObject): 
    439439    Provides basic management of child widget, invoker, and animation.
    440440    """
    441441
     442    PRIMARY = 0
     443    SECONDARY = 1
     444
    442445    __gsignals__ = {
    443446        'popup': (GObject.SignalFlags.RUN_FIRST, None, ([])),
    444447        'popdown': (GObject.SignalFlags.RUN_FIRST, None, ([])),
    class PaletteWindow(GObject.GObject): 
    628631        self.on_invoker_leave()
    629632
    630633    def _invoker_right_click_cb(self, invoker):
    631         self.popup(immediate=True, state=1)
     634        self.popup(immediate=True, state=self.SECONDARY)
    632635
    633636    def _invoker_toggle_state_cb(self, invoker):
    634637        if self.is_up():
    635638            self.popdown(immediate=True)
    636639        else:
    637             self.popup(immediate=True, state=1)
     640            self.popup(immediate=True, state=self.SECONDARY)
    638641
    639642    def __enter_notify_cb(self, widget):
    640643        self.on_enter()