Пример #1
0
    def make_bar_bigger(self, orientation):
        if orientation == gtk.ORIENTATION_HORIZONTAL:
            region = gdk.region_rectangle(
                gdk.Rectangle(0, 0, int(self._horizaontal.bar_len),
                              self.bar_width))

            if self.hallocation.x == 0:
                self.hwindow.shape_combine_region(region,
                                                  self.top_bottom_space,
                                                  -self.right_space)
            else:
                self.hwindow.shape_combine_region(region,
                                                  -self.top_bottom_space,
                                                  -self.right_space)
        elif orientation == gtk.ORIENTATION_VERTICAL:
            region = gdk.region_rectangle(
                gdk.Rectangle(0, 0, self.bar_width,
                              int(self._vertical.bar_len)))

            if self.vallocation.y == 0:
                self.vwindow.shape_combine_region(region, -self.right_space,
                                                  self.top_bottom_space)
            else:
                self.vwindow.shape_combine_region(region, -self.right_space,
                                                  -self.top_bottom_space)
        else:
            raise "make_bar_bigger's orientation must be gtk.ORIENTATION_VERTICAL or gtk.ORIENTATION_HORIZONTAL"
Пример #2
0
    def make_bar_smaller(self, orientation):
        if orientation == gtk.ORIENTATION_HORIZONTAL:
            bar_len = self._horizaontal.bar_len
            if bar_len == 0:
                self._horizaontal.need_update_region = True
                return
            region = gdk.region_rectangle(gdk.Rectangle(0, 0, int(bar_len), self.bar_small_width))

            if self.hallocation.x == 0:
                self.hwindow.shape_combine_region(region, self.top_bottom_space, self.bar_width - self.bar_small_width -self.right_space)
            else:
                self.hwindow.shape_combine_region(region, -self.top_bottom_space, self.bar_width - self.bar_small_width -self.right_space)
        elif orientation == gtk.ORIENTATION_VERTICAL:
            bar_len = self._vertical.bar_len
            if bar_len == 0:
                self._vertical.need_update_region = True
                return
            region = gdk.region_rectangle(gdk.Rectangle(0, 0, self.bar_small_width, int(bar_len)))

            if self.vallocation.y == 0:
                self.vwindow.shape_combine_region(region, self.bar_width-self.bar_small_width - self.right_space, self.top_bottom_space)
            else:
                self.vwindow.shape_combine_region(region, self.bar_width-self.bar_small_width - self.right_space, -self.top_bottom_space)
        else:
            raise "make_bar_smaller's orientation must be gtk.ORIENTATION_VERTICAL or gtk.ORIENTATION_HORIZONTAL"

        return False
Пример #3
0
    def make_bar_bigger(self, orientation):
        if orientation == gtk.ORIENTATION_HORIZONTAL:
            region = gdk.region_rectangle(gdk.Rectangle(0, 0, int(self._horizaontal.bar_len), self.bar_width))

            if self.hallocation.x == 0:
                self.hwindow.shape_combine_region(region, self.top_bootm_space, -self.right_space)
            else:
                self.hwindow.shape_combine_region(region, -self.top_bootm_space, -self.right_space)
        elif orientation == gtk.ORIENTATION_VERTICAL:
            region = gdk.region_rectangle(gdk.Rectangle(0, 0, self.bar_width, int(self._vertical.bar_len)))

            if self.vallocation.y == 0:
                self.vwindow.shape_combine_region(region, -self.right_space, self.top_bootm_space)
            else:
                self.vwindow.shape_combine_region(region, -self.right_space, -self.top_bootm_space)
        else:
            raise "make_bar_bigger's orientation must be gtk.ORIENTATION_VERTICAL or gtk.ORIENTATION_HORIZONTAL"