当前位置: 首页>>代码示例>>Python>>正文


Python Label.set_ellipsize方法代码示例

本文整理汇总了Python中dtk.ui.label.Label.set_ellipsize方法的典型用法代码示例。如果您正苦于以下问题:Python Label.set_ellipsize方法的具体用法?Python Label.set_ellipsize怎么用?Python Label.set_ellipsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dtk.ui.label.Label的用法示例。


在下文中一共展示了Label.set_ellipsize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DetailPage

# 需要导入模块: from dtk.ui.label import Label [as 别名]
# 或者: from dtk.ui.label.Label import set_ellipsize [as 别名]
class DetailPage(gtk.HBox):
    '''
    class docs
    '''

    PADDING_Y = 20

    ICON_SIZE = 64
    ICON_PADDING_X = 50

    STAR_PADDING_X = 36
    STAR_PADDING_Y = 12
    STAR_SIZE = 13

    MARK_NUMBER_SIZE = 11
    MARK_NUMBER_PADDING_X = 4
    MARK_NUMBER_PADDING_Y = 10

    INFO_RENDER_X = 10
    INFO_RENDER_Y = 140
    INFO_RENDER_HEIGHT = 18
    INFO_CATEGORY_RENDER_Y = INFO_RENDER_Y + INFO_RENDER_HEIGHT
    INFO_VERSION_RENDER_Y = INFO_RENDER_Y + INFO_RENDER_HEIGHT * 2
    INFO_SIZE_RENDER_Y = INFO_RENDER_Y + INFO_RENDER_HEIGHT * 3
    INFO_DOWNLOAD_RENDER_Y = INFO_RENDER_Y + INFO_RENDER_HEIGHT * 4
    INFO_HOMEPAGE_RENDER_Y = INFO_RENDER_Y + INFO_RENDER_HEIGHT * 5

    LEFT_INFO_PADDING_X = 18
    LEFT_INFO_PADDING_Y = 50

    LEFT_BUTTON_PADDING_Y = 50

    LEFT_INFO_WIDTH = 164

    RIGHT_INFO_PADDING_X = 30

    RIGHT_TITLE_BOX_HEIGHT = 70

    ALIAS_NAME_SIZE = 16
    ALIAS_NAME_PADDING_Y = 20

    LONG_DESC_PADDING_Y = 10
    LONG_DESC_WRAP_WIDTH = 630
    LONG_DESC_INIT_HEIGHT = 45

    MARK_SIZE = 11
    MARK_PADDING_X = 5
    MARK_PADDING_Y = -3

    def __init__(self, data_manager):
        '''
        init docs
        '''
        gtk.HBox.__init__(self)
        self.data_manager = data_manager
        self.pkg_name = None
        self.alias_name = ""
        self.pkg_pixbuf = None
        self.pkg_star_view = None

        self.left_view_box = gtk.VBox()
        self.left_view_box.set_size_request(self.LEFT_INFO_WIDTH, - 1)

        self.left_logo_box = gtk.VBox()
        self.left_logo_box.set_size_request(-1, 90)

        self.star_box = gtk.HBox()
        self.star_align = gtk.Alignment(0.4, 0.5, 0, 0)
        self.star_align.set_padding(0, 5, 0, 0)
        self.star_align.add(self.star_box)

        self.left_action_box = gtk.HBox()
        self.left_action_align = gtk.Alignment()
        self.left_action_align.set(0.5, 0.5, 0, 0)
        self.left_action_align.set_padding(0, 30, 0, 0)
        self.left_action_align.add(self.left_action_box)

        self.left_label_table = gtk.Table(4, 1)
        self.left_label_table.set_row_spacings(4)

        self.left_label_align = gtk.Alignment()
        self.left_label_align.set(0.0, 0.5, 0, 0)
        self.left_label_align.set_padding(0, 0, 14, 0)

        self.left_category_name_label = Label()
        self.left_category_label = Label(hover_color=app_theme.get_color("homepage_hover"))
        self.left_category_label.set_clickable()
        self.left_category_label_align = gtk.Alignment()
        self.left_category_label_align.set(0.0, 0.5, 0, 0)
        self.left_category_label_align.add(self.left_category_label)
        self.left_category_label_box = gtk.HBox()
        self.left_category_label_box.pack_start(self.left_category_name_label, False, False)
        self.left_category_label_box.pack_start(self.left_category_label_align, True, True)
        self.left_category_box = gtk.VBox()
        self.left_version_label = Label(label_width=136)
        show_label_tooltip(self.left_version_label)
        self.left_version_label.set_ellipsize(pango.ELLIPSIZE_END)
        self.left_download_label = Label()
        self.left_size_label = Label()

#.........这里部分代码省略.........
开发者ID:kissthink,项目名称:deepin-store,代码行数:103,代码来源:detail_page.py


注:本文中的dtk.ui.label.Label.set_ellipsize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。