Exemplo n.º 1
0
    def expose_background_box(self, widget, event):
        '''
        Callback for `expose-event` signal.

        @param widget: BackgroundBox self.
        @param event: Expose event.
        @return: Always return False.
        '''
        cr = widget.window.cairo_create()
        with cairo_state(cr):
            rect = widget.allocation
            toplevel = widget.get_toplevel()
            (offset_x, offset_y) = widget.translate_coordinates(toplevel, 0, 0)
            (shadow_x, shadow_y) = get_window_shadow_size(toplevel)

            x = shadow_x - offset_x
            y = shadow_y - offset_y

            cr.rectangle(rect.x, rect.y, rect.width, rect.height)
            cr.clip()
            cr.translate(x, y)
            skin_config.render_background(cr, widget, 0, 0)

        self.draw_mask(cr, rect.x, rect.y, rect.width, rect.height)

        return False
Exemplo n.º 2
0
    def expose_background_box(self, widget, event):
        '''
        Callback for `expose-event` signal.

        @param widget: BackgroundBox self.
        @param event: Expose event.
        @return: Always return False.
        '''
        cr = widget.window.cairo_create()
        with cairo_state(cr):
            rect = widget.allocation
            toplevel = widget.get_toplevel()
            (offset_x, offset_y) = widget.translate_coordinates(toplevel, 0, 0)
            (shadow_x, shadow_y) = get_window_shadow_size(toplevel)

            x = shadow_x - offset_x
            y = shadow_y - offset_y

            cr.rectangle(rect.x, rect.y, rect.width, rect.height)
            cr.clip()
            cr.translate(x, y)
            skin_config.render_background(cr, widget, 0, 0)

        self.draw_mask(cr, rect.x, rect.y, rect.width, rect.height)

        return False
Exemplo n.º 3
0
    def expose_tab_content_box(self, widget, event):
        '''
        Internal function to `expose-event` signal.
        '''
        # Init.
        cr = widget.window.cairo_create()
        rect = widget.allocation
        self.tab_box_width = rect.width

        # Draw background.
        toplevel = widget.get_toplevel()
        coordinate = widget.translate_coordinates(toplevel, 0, 0)
        (offset_x, offset_y) = coordinate

        with cairo_state(cr):
            cr.rectangle(rect.x, rect.y, rect.width, rect.height)
            cr.clip()

            (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
            skin_config.render_background(cr, self, shadow_x, shadow_y)

        # Draw mask.
        cr.set_source_rgba(
            *alpha_color_hex_to_cairo((self.tab_select_bg_color.get_color(),
                                       0.93)))
        cr.rectangle(rect.x, rect.y, rect.width, rect.height)
        cr.fill()
Exemplo n.º 4
0
 def draw_title_background(self, cr, widget):
     (offset_x, offset_y) = widget.translate_coordinates(self.get_toplevel(), 0, 0)
     with cairo_state(cr):
         cr.translate(-offset_x, -offset_y)
         
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         skin_config.render_background(cr, widget, shadow_x, shadow_y)
Exemplo n.º 5
0
    def expose_tab_content_box(self, widget, event):
        '''
        Internal function to `expose-event` signal.
        '''
        # Init.
        cr = widget.window.cairo_create()
        rect = widget.allocation
        self.tab_box_width = rect.width

        # Draw background.
        toplevel = widget.get_toplevel()
        coordinate = widget.translate_coordinates(toplevel, 0, 0)
        (offset_x, offset_y) = coordinate

        with cairo_state(cr):
            cr.rectangle(rect.x, rect.y, rect.width, rect.height)
            cr.clip()
            
            (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
            skin_config.render_background(cr, self, shadow_x, shadow_y)
        
        # Draw mask.
        cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_select_bg_color.get_color(), 0.93)))
        cr.rectangle(rect.x, rect.y, rect.width, rect.height)
        cr.fill()
Exemplo n.º 6
0
 def expose_icon_view(self, widget, event):
     '''
     Internal callback for `expose-event` signal.
     '''
     # Update vadjustment.
     self.update_vadjustment()    
     
     # Init.
     cr = widget.window.cairo_create()
     rect = widget.allocation
     
     # Get offset.
     (offset_x, offset_y, viewport) = self.get_offset_coordinate(widget)
         
     # Draw background.
     with cairo_state(cr):
         scrolled_window = get_match_parent(self, ["ScrolledWindow"])
         cr.translate(-scrolled_window.allocation.x, -scrolled_window.allocation.y)
         cr.rectangle(offset_x, offset_y, 
                      scrolled_window.allocation.x + scrolled_window.allocation.width, 
                      scrolled_window.allocation.y + scrolled_window.allocation.height)
         cr.clip()
         
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         skin_config.render_background(cr, self, offset_x + shadow_x, offset_y + shadow_y)
         
     # Draw mask.
     self.draw_mask(cr, offset_x, offset_y, viewport.allocation.width, viewport.allocation.height)
     
     # Draw items.
     self.draw_items(cr, rect, offset_x, offset_y, viewport)
Exemplo n.º 7
0
def draw_icon_view_mask(widget, x, y, w, h, render_callback):
    '''
    Draw icon view mask with given render method.

    @param widget: Target widget.
    @param x: X coordinate of draw area.
    @param y: Y coordinate of draw area.
    @param w: Width of draw area.
    @param h: Height of draw area.
    @param render_callback: Render callback.
    '''
    cr = widget.window.cairo_create()
    viewport = get_match_parent(widget, ["Viewport"])
    toplevel = widget.get_toplevel()
    (offset_x, offset_y) = viewport.translate_coordinates(toplevel, 0, 0)
    (shadow_x, shadow_y) = get_window_shadow_size(toplevel)

    with cairo_state(cr):
        cr.rectangle(x, y, w, h)
        cr.clip()

        render_callback(
            cr,
            x - offset_x + shadow_x,
            y - offset_y + shadow_y,
            toplevel.allocation.width,
            toplevel.allocation.height)
Exemplo n.º 8
0
    def draw_title_background(self, cr, widget):
        (offset_x,
         offset_y) = widget.translate_coordinates(self.get_toplevel(), 0, 0)
        with cairo_state(cr):
            cr.translate(-offset_x, -offset_y)

            (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
            skin_config.render_background(cr, widget, shadow_x, shadow_y)
Exemplo n.º 9
0
 def expose_dragable_tabbar(self, widget, event):
     '''
     docs
     '''
     # Init.
     cr = widget.window.cairo_create()
     rect = widget.allocation
     x, w, h = rect.x, rect.width, rect.height
     y = 0
     
     # Draw background.
     (offset_x, offset_y) = widget.translate_coordinates(self.get_toplevel(), 0, 0)
     with cairo_state(cr):
         cr.translate(-offset_x, -offset_y)
         
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         skin_config.render_background(cr, widget, shadow_x, shadow_y)
     
     # Draw inactive tab.
     draw_x_list = []
     width_offset = 0
     for (index, tab_name) in enumerate(self.names):
         draw_x_list.append(x + width_offset)
         width_offset += (self.name_widths[index] - (self.triangle_width + self.tab_radious * 2))
         
     for (index, tab_name) in enumerate(reversed(self.names)):
         tab_index = len(self.names) - index - 1
         if tab_index != self.active_index:
             self.draw_tab(cr, draw_x_list[tab_index], y, tab_name, tab_index)
             
     # Draw active tab.
     self.draw_tab(cr, draw_x_list[self.active_index], y, self.names[self.active_index], self.active_index)        
     
     # Draw bottom line.
     frame_color = alpha_color_hex_to_cairo(ui_theme.get_alpha_color("dragable_tab_bottom_active_frame").get_color_info())        
     cr.set_source_rgba(*frame_color)
     cr.rectangle(x, 
                  y + h - 1, 
                  draw_x_list[self.active_index],
                  1)
     cr.rectangle(x + draw_x_list[self.active_index] + self.name_widths[self.active_index], 
                  y + h - 1,
                  w - draw_x_list[self.active_index] - self.name_widths[self.active_index],
                  1)
     cr.fill()
     
     return True
Exemplo n.º 10
0
 def draw_background(self, widget, cr):
     with cairo_state(cr):
         scrolled_window = get_match_parent(self, ["ScrolledWindow"])
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         (offset_x, offset_y) = self.translate_coordinates(self.get_toplevel(), 0, 0)
         vadjust = scrolled_window.get_vadjustment()    
         vadjust_value = int(vadjust.get_value())
         hadjust = scrolled_window.get_hadjustment()    
         hadjust_value = int(hadjust.get_value())
         
         x = shadow_x - offset_x
         y = shadow_y - offset_y
         
         cr.rectangle(hadjust_value, vadjust_value, scrolled_window.allocation.width, scrolled_window.allocation.height)
         cr.clip()
         cr.translate(x, y)
         skin_config.render_background(cr, widget, 0, 0)
Exemplo n.º 11
0
def draw_list_view_mask(widget, x, y, w, h, render_callback):
    '''Draw skin preview view mask.'''
    cr = widget.window.cairo_create()
    viewport = get_match_parent(widget, ["Viewport"])
    toplevel = widget.get_toplevel()
    (offset_x, offset_y) = viewport.translate_coordinates(toplevel, 0, 0)
    (shadow_x, shadow_y) = get_window_shadow_size(toplevel)
    
    with cairo_state(cr):
        cr.rectangle(x, y, w, h)
        cr.clip()
        
        render_callback(
            cr, 
            x - offset_x + shadow_x, 
            y - offset_y + shadow_y,
            toplevel.allocation.width,
            toplevel.allocation.height)
Exemplo n.º 12
0
    def expose_background_box(self, widget, event):
        '''Expose background box.'''
        cr = widget.window.cairo_create()
        rect = widget.allocation
        toplevel = widget.get_toplevel()
        coordinate = widget.translate_coordinates(toplevel, rect.x, rect.y)
        (offset_x, offset_y) = coordinate
        
        with cairo_state(cr):
            cr.rectangle(rect.x, rect.y, rect.width, rect.height)
            cr.clip()
            
            (shadow_x, shadow_y) = get_window_shadow_size(toplevel)
            skin_config.render_background(cr, widget, shadow_x, shadow_y)
            
        self.draw_mask(cr, rect.x, rect.y, rect.width, rect.height)    

        return False
Exemplo n.º 13
0
    def draw_background(self, widget, cr):
        with cairo_state(cr):
            scrolled_window = get_match_parent(self, ["ScrolledWindow"])
            (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
            (offset_x,
             offset_y) = self.translate_coordinates(self.get_toplevel(), 0, 0)
            vadjust = scrolled_window.get_vadjustment()
            vadjust_value = int(vadjust.get_value())
            hadjust = scrolled_window.get_hadjustment()
            hadjust_value = int(hadjust.get_value())

            x = shadow_x - offset_x
            y = shadow_y - offset_y

            cr.rectangle(hadjust_value, vadjust_value,
                         scrolled_window.allocation.width,
                         scrolled_window.allocation.height)
            cr.clip()
            cr.translate(x, y)
            skin_config.render_background(cr, widget, 0, 0)
Exemplo n.º 14
0
    def adjust_menu_position(self):
        '''
        Internal function to realize menu position.
        '''
        # Adjust coordinate.
        (screen_width, screen_height) = get_screen_size(self)

        menu_width = menu_height = 0
        for menu_item in self.menu_items:
            if isinstance(menu_item.item_box, gtk.Button):
                item_box_width = menu_item.item_box_width
                if item_box_width > menu_width:
                    menu_width = item_box_width

            menu_height += menu_item.item_box_height
        (shadow_x, shadow_y) = get_window_shadow_size(self)
        menu_width += (self.padding_x + shadow_x) * 2
        menu_height += (self.padding_y + shadow_y) * 2

        if self.x_align == ALIGN_START:
            dx = self.expect_x
        elif self.x_align == ALIGN_MIDDLE:
            dx = self.expect_x - menu_width / 2
        else:
            dx = self.expect_x - menu_width

        if self.y_align == ALIGN_START:
            dy = self.expect_y
        elif self.y_align == ALIGN_MIDDLE:
            dy = self.expect_y - menu_height / 2
        else:
            dy = self.expect_y - menu_height

        if self.expect_x + menu_width > screen_width:
            dx = self.expect_x - menu_width + self.offset_x
        if self.expect_y + menu_height > screen_height:
            dy = self.expect_y - menu_height + self.offset_y

        self.move(dx, dy)
Exemplo n.º 15
0
    def adjust_menu_position(self):
        """
        Internal function to realize menu position.
        """
        # Adjust coordinate.
        (screen_width, screen_height) = get_screen_size(self)

        menu_width = menu_height = 0
        for menu_item in self.menu_items:
            if isinstance(menu_item.item_box, gtk.Button):
                item_box_width = menu_item.item_box_width
                if item_box_width > menu_width:
                    menu_width = item_box_width

            menu_height += menu_item.item_box_height
        (shadow_x, shadow_y) = get_window_shadow_size(self)
        menu_width += (self.padding_x + shadow_x) * 2
        menu_height += (self.padding_y + shadow_y) * 2

        if self.x_align == ALIGN_START:
            dx = self.expect_x
        elif self.x_align == ALIGN_MIDDLE:
            dx = self.expect_x - menu_width / 2
        else:
            dx = self.expect_x - menu_width

        if self.y_align == ALIGN_START:
            dy = self.expect_y
        elif self.y_align == ALIGN_MIDDLE:
            dy = self.expect_y - menu_height / 2
        else:
            dy = self.expect_y - menu_height

        if self.expect_x + menu_width > screen_width:
            dx = self.expect_x - menu_width + self.offset_x
        if self.expect_y + menu_height > screen_height:
            dy = self.expect_y - menu_height + self.offset_y

        self.move(dx, dy)
Exemplo n.º 16
0
def draw_icon_view_mask(widget, x, y, w, h, render_callback):
    '''
    Draw icon view mask with given render method.

    @param widget: Target widget.
    @param x: X coordinate of draw area.
    @param y: Y coordinate of draw area.
    @param w: Width of draw area.
    @param h: Height of draw area.
    @param render_callback: Render callback.
    '''
    cr = widget.window.cairo_create()
    viewport = get_match_parent(widget, ["Viewport"])
    toplevel = widget.get_toplevel()
    (offset_x, offset_y) = viewport.translate_coordinates(toplevel, 0, 0)
    (shadow_x, shadow_y) = get_window_shadow_size(toplevel)

    with cairo_state(cr):
        cr.rectangle(x, y, w, h)
        cr.clip()

        render_callback(cr, x - offset_x + shadow_x, y - offset_y + shadow_y,
                        toplevel.allocation.width, toplevel.allocation.height)
Exemplo n.º 17
0
    def expose_tab_title_box(self, widget, event):
        '''
        Internal callback for `expose-event` signal.
        '''
        cr = widget.window.cairo_create()
        rect = widget.allocation
        
        # Draw background.
        (offset_x, offset_y) = widget.translate_coordinates(self.get_toplevel(), 0, 0)
        with cairo_state(cr):
            cr.translate(-offset_x, -offset_y)
            
            (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
            skin_config.render_background(cr, widget, shadow_x, shadow_y)
        
        if len(self.tab_items) > 0:    
            # Draw title unselect tab.
            tab_title_width = sum(self.tab_title_widths)
            
            with cairo_state(cr):
                with cairo_disable_antialias(cr):
                    cr.rectangle(0,
                                 0,
                                 sum(self.tab_title_widths[0:self.tab_index]),
                                 self.tab_height)
                    cr.rectangle(sum(self.tab_title_widths[0:min(self.tab_index + 1, len(self.tab_items))]) + 1,
                                 0,
                                 sum(self.tab_title_widths) - sum(self.tab_title_widths[0:min(self.tab_index + 1, len(self.tab_items))]),
                                 self.tab_height)
                    cr.clip()
                    
                    cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_unselect_bg_color.get_color(), 0.7)))
                    cr.rectangle(1, 1, tab_title_width, self.tab_height)
                    cr.fill()
                        
                    cr.set_line_width(1)
                    cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_unselect_frame_color.get_color(), 1.0)))
                    cr.rectangle(1, 1, tab_title_width, self.tab_height)
                    cr.stroke()
                    
                    for (index, width) in enumerate(self.tab_title_widths[:-1]):
                        cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_unselect_frame_color.get_color(), 1.0)))
                        cr.rectangle(1 + sum(self.tab_title_widths[0:index]) + width,
                                     1,
                                     1,
                                     self.tab_height)
                        cr.fill()
                        
                    cr.set_source_rgb(*color_hex_to_cairo(self.tab_select_frame_color.get_color()))    
                    cr.rectangle(0,
                                 rect.height - 1,
                                 sum(self.tab_title_widths[0:self.tab_index]),
                                 1)
                    cr.fill()
                
                    cr.set_source_rgb(*color_hex_to_cairo(self.tab_select_frame_color.get_color()))    
                    cr.rectangle(1 + sum(self.tab_title_widths[0:self.tab_index]),
                                 rect.height - 1,
                                 rect.width - sum(self.tab_title_widths[0:self.tab_index]),
                                 1)
                    cr.fill()
                            
            for (index, item) in enumerate(self.tab_items):
                # Draw title background.
                title = item[0]
                
                # Draw title tab.
                with cairo_disable_antialias(cr):
                    if index == self.tab_index:
                        # Draw title select tab.
                        cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_select_bg_color.get_color(), 0.93)))    
                        if index == 0:
                            cr.rectangle(sum(self.tab_title_widths[0:index]),
                                         1,
                                         self.tab_title_widths[index] + 1,
                                         self.tab_height)
                        else:
                            cr.rectangle(1 + sum(self.tab_title_widths[0:index]),
                                         1,
                                         self.tab_title_widths[index],
                                         self.tab_height)
                        cr.fill()
                        
                        if index == 0:
                            cr.rectangle(0,
                                         0,
                                         rect.width,
                                         self.tab_height)
                            cr.clip()
                            
                        cr.set_line_width(1)
                        cr.set_source_rgb(*color_hex_to_cairo(self.tab_select_frame_color.get_color()))    
                        if index == 0:
                            cr.rectangle(sum(self.tab_title_widths[0:index]),
                                         1,
                                         self.tab_title_widths[index] + 2,
                                         self.tab_height)
                        else:
                            cr.rectangle(1 + sum(self.tab_title_widths[0:index]),
                                         1,
                                         self.tab_title_widths[index] + 1,
                                         self.tab_height)
                        cr.stroke()
                        
                draw_text(cr, title, 
                          sum(self.tab_title_widths[0:index]) + self.tab_padding_x,
                          self.tab_padding_y,
                          self.tab_title_widths[index] - self.tab_padding_x * 2,
                          self.tab_height - self.tab_padding_y * 2,
                          )
                
                # Draw close button.
                if self.can_close_tab:
                    button_x = sum(self.tab_title_widths[0:index + 1]) - self.close_button_padding_x - self.close_button_size
                    button_y = self.close_button_padding_y
                    
                    if self.hover_close_button_index == index:
                        cr.set_source_rgb(*color_hex_to_cairo(self.close_button_select_background_color))
                        draw_round_rectangle(
                            cr,
                            button_x - self.close_button_frame_size,
                            button_y - self.close_button_frame_size,
                            self.close_button_size + self.close_button_frame_size * 2,
                            self.close_button_size + self.close_button_frame_size * 2,
                            2
                            )
                        cr.fill()
                    
                    cr.set_line_width(1.5)
                    if self.hover_close_button_index == index:
                        cr.set_source_rgb(*color_hex_to_cairo(self.close_button_select_foreground_color))
                    else:
                        cr.set_source_rgb(*color_hex_to_cairo(self.close_button_color))
                    cr.move_to(button_x, button_y)
                    cr.line_to(button_x + self.close_button_size, button_y + self.close_button_size)
                    cr.stroke()

                    cr.move_to(button_x + self.close_button_size, button_y)
                    cr.line_to(button_x, button_y + self.close_button_size)
                    cr.stroke()
        else:
            cr.set_source_rgba(*alpha_color_hex_to_cairo((self.tab_select_bg_color.get_color(), 0.93)))
            cr.rectangle(0, 0, rect.width, rect.height)
            cr.fill()
Exemplo n.º 18
0
 def expose_icon_view(self, widget, event):
     '''Expose list view.'''
     # Update vadjustment.
     self.update_vadjustment()    
     
     # Init.
     cr = widget.window.cairo_create()
     rect = widget.allocation
     
     # Get offset.
     (offset_x, offset_y, viewport) = self.get_offset_coordinate(widget)
         
     # Draw background.
     with cairo_state(cr):
         scrolled_window = get_match_parent(self, ["ScrolledWindow"])
         cr.translate(-scrolled_window.allocation.x, -scrolled_window.allocation.y)
         cr.rectangle(offset_x, offset_y, 
                      scrolled_window.allocation.x + scrolled_window.allocation.width, 
                      scrolled_window.allocation.y + scrolled_window.allocation.height)
         cr.clip()
         
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         skin_config.render_background(cr, self, offset_x + shadow_x, offset_y + shadow_y)
         
     # Draw mask.
     self.draw_mask(cr, offset_x, offset_y, viewport.allocation.width, viewport.allocation.height)
         
     # Draw item.
     if len(self.items) > 0:
         with cairo_state(cr):
             # Don't draw any item out of viewport area.
             cr.rectangle(offset_x, offset_y,
                          viewport.allocation.width, 
                          viewport.allocation.height)        
             cr.clip()
             
             # Draw item.
             item_width, item_height = self.items[0].get_width(), self.items[0].get_height()
             scrolled_window = get_match_parent(self, ["ScrolledWindow"])
             columns = int((scrolled_window.allocation.width - self.padding_x * 2) / item_width)
                 
             # Get viewport index.
             start_y = offset_y - self.padding_y
             start_row = max(int(start_y / item_height), 0)
             start_index = start_row * columns
             
             end_y = offset_y - self.padding_y + viewport.allocation.height
             if end_y % item_height == 0:
                 end_row = end_y / item_height - 1
             else:
                 end_row = end_y / item_height
             end_index = min((end_row + 1) * columns, len(self.items))
             
             for (index, item) in enumerate(self.items[start_index:end_index]):
                 row = int((start_index + index) / columns)
                 column = (start_index + index) % columns
                 render_x = rect.x + self.padding_x + column * item_width
                 render_y = rect.y + self.padding_y + row * item_height
                 
                 with cairo_state(cr):
                     # Don't allow draw out of item area.
                     cr.rectangle(render_x, render_y, item_width, item_height)
                     cr.clip()
                     
                     item.render(cr, gtk.gdk.Rectangle(render_x, render_y, item_width, item_height))
Exemplo n.º 19
0
 def tree_view_expose_event(self, widget, event):
     cr = widget.window.cairo_create()
     rect = widget.allocation
     x, y, w, h = rect.x, rect.y, rect.width, rect.height
     
     # Get offset.
     (offset_x, offset_y, viewport) = self.get_offset_coordinate(widget)
     
     
     # Draw background.
     with cairo_state(cr):
         scrolled_window = get_match_parent(self, ["ScrolledWindow"])
         cr.translate(-scrolled_window.allocation.x, -scrolled_window.allocation.y)
         cr.rectangle(offset_x, offset_y, 
                      scrolled_window.allocation.x + scrolled_window.allocation.width, 
                      scrolled_window.allocation.y + scrolled_window.allocation.height)
         cr.clip()
         
         (shadow_x, shadow_y) = get_window_shadow_size(self.get_toplevel())
         skin_config.render_background(cr, self, offset_x + shadow_x, offset_y + shadow_y)
         
     # Draw mask.
     self.draw_mask(cr, offset_x, offset_y, viewport.allocation.width, viewport.allocation.height)
     
     if self.press_draw_bool:
         self.draw_y_padding = int(self.press_height) / self.height * self.height
         draw_vlinear(
             cr,
             x, y + self.draw_y_padding, w, self.height,
             ui_theme.get_shadow_color("tree_item_select").get_color_info())
     
     if self.move_draw_bool:
         if int(self.press_height) / self.height * self.height != int(self.move_height) / self.height * self.height:
             self.draw_y_padding = int(self.move_height) / self.height * self.height
             draw_vlinear(
                 cr,
                 x, y + self.draw_y_padding, w, self.height,
                 ui_theme.get_shadow_color("tree_item_hover").get_color_info())
         
     if self.tree_list:    
         temp_height = 0
         # (cr, text, font_size, font_color, x, y, width, height, font_align
         for (widget_index, draw_widget) in enumerate(self.tree_list):
             if draw_widget.text:
                 index = int(self.press_height) / self.height
                 if widget_index == index:
                     font_color = ui_theme.get_color("tree_item_select_font").get_color()
                 else:
                     font_color = ui_theme.get_color("tree_item_normal_font").get_color()
                 draw_text(cr, draw_widget.text, 
                             self.font_x_padding + draw_widget.width,
                             temp_height + self.height/2, 
                             self.font_width, 
                             self.font_height,
                             self.font_size,
                             font_color,
                             alignment=self.font_align
                           )    
                 
             font_w, font_h = get_content_size(draw_widget.text, self.font_size)    
             index = int(self.press_height) / self.height
             if draw_widget.tree_view_item.get_has_arrow():
                 if not draw_widget.show_child_items_bool:
                     if widget_index == index:
                         pixbuf = self.normal_hover_pixbuf.get_pixbuf()
                     else:
                         pixbuf = self.normal_pixbuf.get_pixbuf()
                     draw_pixbuf(cr, pixbuf,
                                 widget.allocation.width - self.arrow_x_padding - self.font_x_padding,
                                 # draw_widget.width - self.arrow_x_padding + self.font_x_padding,
                                 # font_w + self.font_x_padding + draw_widget.width + self.arrow_x_padding, 
                                 temp_height + (self.height - self.normal_pixbuf.get_pixbuf().get_height()) / 2)
                 else:
                     if widget_index == index:
                         pixbuf = self.press_hover_pixbuf.get_pixbuf()
                     else:
                         pixbuf = self.press_pixbuf.get_pixbuf()
                     draw_pixbuf(cr, pixbuf,
                                 widget.allocation.width - self.arrow_x_padding - self.font_x_padding,
                                 # draw_widget.width - self.arrow_x_padding + self.font_x_padding,
                                 # font_w + self.font_x_padding + draw_widget.width + self.arrow_x_padding, 
                                 temp_height + (self.height - self.normal_pixbuf.get_pixbuf().get_height()) / 2)
                 
             temp_height += self.height