def __init__(self, parent, icon=None): if icon is not None: self.icon = icon else: self.icon = Image("launcher:res/16/world.png") Panel.__init__(self, parent, paintable=True) # self.set_tooltip(tooltip) LauncherConfig.add_listener(self) self.on_config("variant_rating", "")
def __init__(self, parent): Panel.__init__(self, parent, paintable=True) self.set_min_height(29) # self.set_background_color(Color(0xd8, 0xd8, 0xd8)) self.layout = VerticalLayout() self.hori_layout = HorizontalLayout() if Skin.fws(): self.top_border_size = 2 else: self.top_border_size = 1 self.layout.add(self.hori_layout, fill=True, expand=True, margin_top=self.top_border_size) element = ProtectionElement(self) self.hori_layout.add(element, fill=True) element = WarningsElement(self) self.hori_layout.add(element, fill=True, expand=True) self.hori_layout.add_spacer(16) for language, icon_name in reversed([ ("en", "flag-gb"), ("de", "flag-de"), ("fr", "flag-fr"), ("es", "flag-es"), ("it", "flag-it"), ("ja", "flag-jp"), # ("", "flag-unknown"), ]): icon = Image("workspace:res/16/" + icon_name + ".png") element = LanguageElement(self, language, icon) self.hori_layout.add(element, fill=True) self.hori_layout.add_spacer(16) element = PlayersElement(self) self.hori_layout.add(element, fill=True) # for config_key, icon_name in [ # ("database_url", "database_url_16"), # ("hol_url", "hol_url_16"), # ("lemonamiga_url", "lemon_url_16"), # ("mobygames_url", "mobygames_url_16"), # ("wikipedia_url", "wikipedia_url_16"), # ]: # icon = Image("launcher:res/" + icon_name + ".png") # element = LinkButtonElement(self, config_key, icon) # self.hori_layout.add(element) element = WebLinkElement(self) self.hori_layout.add(element, fill=True) # this listener is added after all status bar children have # added their listeners, this is important for re-layout... LauncherConfig.add_listener(self)
def __init__(self, parent, icon=None): if icon is not None: self.icon = icon else: self.icon = Image("launcher:/data/16x16/world.png") Panel.__init__(self, parent, paintable=True) # self.set_tooltip(tooltip) config = get_config(self) config.add_listener(self) self.on_config("variant_uuid", "")
def __init__(self, parent): """ :type parent: fsui.Widget """ Panel.__init__(self, parent, paintable=True) # self.set_background_color(Color(0xd0, 0xd0, 0xd0)) self.set_background_color(parent.get_background_color()) self.icon = None self.right_icon = None self.right_icon_disabled = None self.text = "" self.active = True
def __init__(self, parent, spacing=10): unused(spacing) Panel.__init__(self, parent, paintable=True) Skin.set_background_color(self) self.layout = HorizontalLayout() self.layout.add_spacer(20) # self.layout.add_spacer(spacing) # self.layout.padding_left = 10 # self.layout.padding_right = 10 # self.set_background_color(Color(0xAEAEAE)) # self.set_min_height(Constants.TAB_HEIGHT) self.bgcolor = get_theme(self).window_bgcolor() self.set_background_color(self.bgcolor)
def __init__( self, parent, icon, button_type=TYPE_TAB, left_padding=0, right_padding=0, ): Panel.__init__(self, parent, paintable=True) Skin.set_background_color(self) self.layout = VerticalLayout() # self.set_background_color((0xdd, 0xdd, 0xdd)) # self.set_min_width(Constants.TAB_WIDTH + left_padding + right_padding) # self.set_min_height(Constants.TAB_HEIGHT) self.set_min_size((64, 48)) self.group_id = 0 self.icon = icon self.type = button_type self.state = self.STATE_NORMAL self.hover = False self.left_padding = left_padding self.right_padding = right_padding self.bgcolor = get_theme(self).window_bgcolor()