overlay.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:blackmamba 作者: zrzka 项目源码 文件源码
def __init__(self, container, state):
        self._container = container
        self._touch_began_location = None
        self._initial_container_frame = None
        self._container_superview = ObjCInstance(container).superview()

        label = LayoutProxy(ui.Label())
        label.font = ('<system>', 13.0)
        label.alignment = ui.ALIGN_CENTER
        label.text_color = get_theme_value('bar_title_color')
        label.touch_enabled = False
        self.add_subview(label)
        label.layout.align_left_with_superview.equal = 0
        label.layout.align_right_with_superview.equal = 0
        label.layout.align_center_y_with_superview.equal = 0
        self.title_label = label

        button = LayoutProxy(ui.Button(title='x', tint_color=get_theme_value('tint_color')))
        self.add_subview(button)
        button.layout.align_left_with_superview.equal = 0
        button.layout.align_top_with_superview.equal = 0
        button.layout.align_bottom_with_superview.equal = 0
        button.layout.width.equal = _OVERLAY_BAR_HEIGHT
        self.close_button = button

        button = LayoutProxy(ui.Button(title='-', tint_color=get_theme_value('tint_color')))
        self.add_subview(button)
        button.layout.align_right_with_superview.equal = 0
        button.layout.align_top_with_superview.equal = 0
        button.layout.align_bottom_with_superview.equal = 0
        button.layout.width.equal = _OVERLAY_BAR_HEIGHT
        self.collapse_button = button

        separator = LayoutProxy(ui.View(background_color=get_theme_value('separator_color')))
        self.add_subview(separator)
        separator.layout.height.equal = 1
        separator.layout.align_left_with_superview.equal = 0
        separator.layout.align_bottom_with_superview.equal = 0
        separator.layout.align_right_with_superview.equal = 0
        self.separator = separator

        self.update_appearance(state)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号