def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.floppies_group = FloppiesGroup(self, 4) self.layout.add(self.floppies_group, fill=True) self.media_list_group = MediaListGroup(self, False) self.layout.add(self.media_list_group, expand=True, fill=True)
def __init__(self, parent): super().__init__(parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.drives_group = FloppiesGroup(self, 1, cd_mode=True) self.layout.add(self.drives_group, fill=True) self.layout.add_spacer(10) self.add_amiga_option(Option.CDROM_DRIVE_0_DELAY) self.layout.add_spacer(10) self.media_list_group = MediaListGroup(self, cd_mode=True) self.layout.add(self.media_list_group, expand=True, fill=True)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.input_group = InputGroup(self, refresh_button=True) self.layout.add(self.input_group, fill=True) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.input_group = InputGroup(self, parallel_ports=True) self.layout.add(self.input_group, fill=True) self.input_group = InputGroup(self, custom_ports=True) self.layout.add(self.input_group, fill=True)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.model_group = ModelGroup(self) self.layout.add(self.model_group, fill=True) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.removable_media_group = RemovableMediaGroup(self, 2, main=True) self.layout.add(self.removable_media_group, fill=True) self.layout.add_spacer(10) self.input_group = InputGroup( self, refresh_button=True, autofire_button=False) self.layout.add(self.input_group, fill=True)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.input_group = InputGroup(self, refresh_button=True) self.layout.add(self.input_group, fill=True) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.input_group = InputGroup( self, parallel_ports=True) self.layout.add(self.input_group, fill=True) self.input_group = InputGroup( self, custom_ports=True) self.layout.add(self.input_group, fill=True)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() self.model_group = ModelGroup(self) self.layout.add(self.model_group, fill=True) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.removable_media_group = RemovableMediaGroup(self, 2, main=True) self.layout.add(self.removable_media_group, fill=True) self.layout.add_spacer(10) self.input_group = InputGroup( self, refresh_button=True, autofire_button=False ) self.layout.add(self.input_group, fill=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): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() heading_label = fsui.HeadingLabel(self, gettext("Hard Drives")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.hard_drive_groups = [] for i in range(4): self.hard_drive_groups.append(HardDriveGroup(self, i)) self.layout.add(self.hard_drive_groups[i], fill=True, margin=10) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) heading_label = fsui.HeadingLabel(self, gettext("WHDLoad Arguments")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.whdload_group = WHDLoadGroup(self) self.layout.add(self.whdload_group, fill=True)
def __init__( self, parent, icon, button_type=TYPE_TAB, left_padding=0, right_padding=0, ): fsui.Panel.__init__(self, parent, paintable=True) Skin.set_background_color(self) self.layout = fsui.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.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
def __init__( self, parent, icon, button_type=TYPE_TAB, left_padding=0, right_padding=0, ): fsui.Panel.__init__(self, parent, paintable=True) Skin.set_background_color(self) self.layout = fsui.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.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
def __init__(self, parent, cover_on_right=True): BottomPanel.__init__(self, parent) Skin.set_background_color(self) # self.set_background_color((0xdd, 0xdd, 0xdd)) self.cover_on_right = cover_on_right self.requests = None self.image = None self.layout = fsui.HorizontalLayout() # def get_min_height(width): # return Constants.COVER_SIZE[1] + 2 * BORDER # self.layout.get_min_height = get_min_height self.layout.padding_left = BORDER // 2 self.layout.padding_right = BORDER // 2 self.layout.padding_top = BORDER + 2 self.layout.padding_bottom = Skin.get_bottom_margin() self.default_image = fsui.Image("launcher:/data/cover.png") # self.default_image.resize(Constants.COVER_SIZE) self.cover_overlay = fsui.Image("launcher:/data/cover_overlay.png") self.cover_overlay_square = fsui.Image( "launcher:/data/cover_overlay_square.png") if not self.cover_on_right: self.layout.add_spacer(Constants.COVER_SIZE[0]) # self.panel = fsui.Panel(self) # self.panel.set_background_color((0xdd, 0xdd, 0xdd)) # self.layout.add(self.panel, expand=True, fill=True) vert_layout = fsui.VerticalLayout() self.layout.add(vert_layout, expand=True, fill=True) # self.panel.layout.padding_top = 10 if self.cover_on_right: vert_layout.padding_right = BORDER else: vert_layout.padding_left = BORDER vert_layout.add_spacer(58 + 3) hori_layout = fsui.HorizontalLayout() vert_layout.add(hori_layout, fill=True) hori_layout.add_spacer(0, expand=True) self.web_button = WebButton(self) hori_layout.add(self.web_button, margin_right=3) self.edit_button = EditButton(self) hori_layout.add(self.edit_button, margin_right=3) # def label_min_width(): # return 330 # self.title_label = fsui.HeadingLabel(self) # self.title_label.get_min_width = label_min_width # vert_layout.add(self.title_label) # self.sub_title_label = fsui.Label(self) # self.sub_title_label.get_min_width = label_min_width # vert_layout.add(self.sub_title_label) self.title = "" self.sub_title = "" self.year = "" self.publisher = "" self.developer = "" self.companies = "" self.image_path = "" vert_layout.add_spacer(0, expand=True) hori_layout = fsui.HorizontalLayout() vert_layout.add(hori_layout, fill=True) # for rating in [1, 4, 5]: # button = RatingButton(self, rating) # hori_layout.add(button, margin_right=5, fill=True) hori_layout.add_spacer(0, expand=True) # self.launch_group = LaunchGroup(self) # hori_layout.add(self.launch_group, fill=True) if self.cover_on_right: self.layout.add_spacer(Constants.COVER_SIZE[0]) self.image_loader = ImageLoader() self.load_info() LauncherSettings.add_listener(self) config = get_config(self) config.add_listener(self) for key in [ "database_url", "hol_url", "lemon_url", "mobygames_url", "wikipedia_url", "year", "publisher", "developer", ]: self.on_config(key, config.get(key))
def __init__(self, parent): super().__init__(parent) Skin.set_background_color(self) self.layout = VerticalLayout() self.config_widget_factory = ConfigWidgetFactory()
def create_column(self, column, content=True, expand=False, min_width=0): layout = fsui.VerticalLayout() self.column_layout.add(layout, fill=True, expand=expand) if min_width: layout.add_spacer(min_width, 0) layout.add_spacer(0, 10 + Skin.EXTRA_GROUP_MARGIN) if content: book = Book(self) Skin.set_background_color(book) if column == 1: margin_right = Skin.EXTRA_GROUP_MARGIN # expand = False expand = True else: margin_right = 0 expand = True hor_layout = fsui.HorizontalLayout() layout.add(hor_layout, fill=True, expand=expand, margin_right=margin_right) # hor_layout.add( # book, fill=True, expand=expand, margin_right=margin_right) vert_layout = fsui.VerticalLayout() hor_layout.add( vert_layout, fill=True, expand=expand, margin_right=margin_right, ) hor_layout_2 = fsui.HorizontalLayout() vert_layout.add(hor_layout_2, fill=True, expand=True) # vert_layout.add(book, fill=True, expand=True) hor_layout_2.add(book, fill=True, expand=True) # self.add_tab_panel(LaunchGroup, expand=False) # if column == 2 and \ # LauncherSettings.get( # Option.LAUNCHER_CONFIG_FEATURE) == "1": # if launcher.ui.get_screen_size()[0] >= 1280: # hor_layout.add_spacer(10) # # if not Skin.fws(): # # line_panel = fsui.Panel(self) # # line_panel.set_background_color( # # fsui.Color(*BORDER_COLOR)) # # line_panel.set_min_width(2) # # hor_layout.add( # # line_panel, fill=True, margin_top=-10, # # margin_bottom=-10) # self.config_browser = ConfigBrowser(self) # self.config_browser.set_min_width(CONFIG_BROWSER_WIDTH) # # if Skin.fws(): # hor_layout.add(self.config_browser, fill=True, # expand=0.5, margin=-10, margin_left=0) # # else: # # hor_layout.add(self.config_browser, fill=True, # # expand=0.5, margin=10) if column == 2: # hor_layout.add_spacer(10) self.quick_settings_panel = QuickSettingsPanel(self, self.fsgs) self.quick_settings_panel.set_min_width(QUICK_SETTINGS_WIDTH) # hor_layout.add(self.quick_settings_panel, fill=True, # expand=0.5, margin=-10, margin_left=0) # hor_layout.add(self.quick_settings_panel, fill=True, # expand=0.5, margin=0, margin_top=0) # Adding to hor_layout_2 will make it appear "one level" # further in. # hor_layout_2.add(self.quick_settings_panel, fill=True, # margin=0, margin_top=0) if LauncherSettings.get(Option.QUICK_SETTINGS) != "1": self.quick_settings_panel.hide() hor_layout.add( self.quick_settings_panel, fill=True, margin=0, margin_top=0, ) if column == 2: # if fs_uae_launcher.ui.get_screen_size()[1] >= 1024: # vert_layout.add_spacer(100) hor2_layout = fsui.HorizontalLayout() vert_layout.add(hor2_layout, fill=True, margin=10) launch_group = LaunchGroup(self, self.gsc) # hor2_layout.add_spacer(0, expand=True) hor2_layout.add(launch_group, expand=True) self.books.append(book) self.add_column_content(column) else: layout.add_spacer(0, expand=True) self.books.append(None) # if column == 1 and Settings.get(Option.CONFIG_FEATURE) == "1": # from fs_uae_launcher.ui.config.browser import ConfigBrowser # config_browser = ConfigBrowser(self) # config_browser.set_min_height(200) # layout.add(config_browser, fill=True, expand=True, margin=10) layout.add_spacer(0, 10 + Skin.EXTRA_GROUP_MARGIN)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.HorizontalLayout() vert_layout = fsui.VerticalLayout() self.layout.add(vert_layout, fill=True, expand=True) hor_layout = fsui.HorizontalLayout() vert_layout.add(hor_layout, fill=True) label_stand_in = fsui.Panel(self) tw, th = label_stand_in.measure_text("Games") label_stand_in.set_min_height(th) hor_layout.add(label_stand_in, margin_top=10, margin_bottom=10) hor_layout.add(NewButton(self), margin_left=10, margin_right=10) game_list_selector = GameListSelector(self) game_list_selector.set_min_width(250) game_list_selector.setMaximumWidth(250) game_list_selector.changed.connect(self.on_game_list_changed) hor_layout.add(game_list_selector, expand=False, margin_left=10) self.text_field = fsui.TextField(self, LauncherSettings.get("config_search")) self.text_field.on_changed = self.on_search_changed if VariantsBrowser.use_horizontal_layout(): # window is big enough to use fixed size # self.text_field.set_min_width(210) self.text_field.set_min_width(229) hor_layout.add( self.text_field, expand=False, margin=10, margin_top=0, margin_bottom=0, ) else: hor_layout.add( self.text_field, expand=True, margin=10, margin_top=0, margin_bottom=0, ) # self.refresh_button = IconButton(self, "refresh_button.png") # self.refresh_button.set_tooltip( # gettext("Refresh Game Configurations from Online Database")) # self.refresh_button.activated.connect(self.on_refresh_button) # hor_layout.add( # self.refresh_button, margin=10, margin_top=0, margin_bottom=0) self.configurations_browser = ConfigurationsBrowser(self) vert_layout.add(self.configurations_browser, fill=True, expand=3, margin=10) self.variants_panel = fsui.Panel(self) vert_layout.add( self.variants_panel, fill=True, expand=False, margin=10, margin_top=20, ) self.variants_panel.layout = fsui.HorizontalLayout() self.variants_browser = VariantsBrowser(self.variants_panel) # Do not use fill=True with the default OS X theme at least, # if you do the item will be rendered with the old Aqua look self.variants_panel.layout.add(self.variants_browser, fill=False, expand=True) # for rating in [1, 4, 5]: # button = RatingButton(self.variants_panel, rating) # self.variants_panel.layout.add(button, margin_left=5, fill=True) self.variants_panel.layout.add(RatingChoice(self.variants_panel), margin_left=5, fill=True) self.config_panel = fsui.Panel(self) vert_layout.add( self.config_panel, fill=True, expand=False, margin_bottom=10, margin_top=20, ) self.config_panel.layout = fsui.VerticalLayout() self.config_group = ConfigGroup(self.config_panel, new_button=False) self.config_panel.layout.add(self.config_group, fill=True, expand=True) LauncherSettings.add_listener(self) self.on_setting("parent_uuid", LauncherSettings.get("parent_uuid"))
def __init__(self, parent, header=True): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() if header: hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) self.layout.add_spacer(0) label = fsui.HeadingLabel(self, gettext("Net Play")) hori_layout.add(label, margin=10) hori_layout.add_spacer(0, expand=True) # label = fsui.Label(self, "Netplay is currently disabled in the " # "development versions.") # self.layout.add(label, margin=10) # label = fsui.Label(self, "Please use the stable FS-UAE series for " # "netplay in the meantime.") # self.layout.add(label, margin=10) # return # TODO gettext("Nick:") gettext("Connect") gettext("Disconnect") # self.nick_label = fsui.Label(self, _("Nick:")) # hori_layout.add(self.nick_label, # margin=10, margin_top=0, margin_bottom=0) # # self.nick_field = fsui.TextField(self, Settings.get("irc_nick")) # self.nick_field.set_min_width(130) # hori_layout.add(self.nick_field, margin_right=10) # #self.nick_field.on_changed = self.on_nick_change # # self.connect_button = fsui.Button(self, _("Connect")) # hori_layout.add(self.connect_button, margin_right=10) # #self.connect_button.activated.connect(self.on_connect_button) # # self.disconnect_button = fsui.Button(self, _("Disconnect")) # hori_layout.add(self.disconnect_button, margin_right=10) # #self.disconnect_button.activated.connect(self.on_disconnect_button) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True, expand=True) ver_layout = fsui.VerticalLayout() hori_layout.add(ver_layout, fill=True) self.channel_list = fsui.ListView(self) self.channel_list.set_min_width(212) self.channel_list.on_select_item = self.on_select_channel ver_layout.add(self.channel_list, fill=True, expand=True, margin=10) self.nick_list = fsui.ListView(self) ver_layout.add(self.nick_list, fill=True, expand=True, margin=10) self.text_area = fsui.TextArea(self, font_family="monospace") hori_layout.add(self.text_area, fill=True, expand=True, margin=10, margin_left=0) self.input_field = fsui.TextField(self) self.input_field.activated.connect(self.on_input) self.layout.add(self.input_field, fill=True, margin=10, margin_top=0) self.active_channel = LOBBY_CHANNEL self.input_field.focus() self.netplay = Netplay() IRCBroadcaster.add_listener(self)
def __init__(self, parent, header=True): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() if header: hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) self.layout.add_spacer(0) label = fsui.HeadingLabel(self, gettext("Net Play")) hori_layout.add(label, margin=10) hori_layout.add_spacer(0, expand=True) # label = fsui.Label(self, "Netplay is currently disabled in the " # "development versions.") # self.layout.add(label, margin=10) # label = fsui.Label(self, "Please use the stable FS-UAE series for " # "netplay in the meantime.") # self.layout.add(label, margin=10) # return # TODO gettext("Nick:") gettext("Connect") gettext("Disconnect") # self.nick_label = fsui.Label(self, _("Nick:")) # hori_layout.add(self.nick_label, # margin=10, margin_top=0, margin_bottom=0) # # self.nick_field = fsui.TextField(self, Settings.get("irc_nick")) # self.nick_field.set_min_width(130) # hori_layout.add(self.nick_field, margin_right=10) # #self.nick_field.on_changed = self.on_nick_change # # self.connect_button = fsui.Button(self, _("Connect")) # hori_layout.add(self.connect_button, margin_right=10) # #self.connect_button.activated.connect(self.on_connect_button) # # self.disconnect_button = fsui.Button(self, _("Disconnect")) # hori_layout.add(self.disconnect_button, margin_right=10) # #self.disconnect_button.activated.connect(self.on_disconnect_button) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True, expand=True) ver_layout = fsui.VerticalLayout() hori_layout.add(ver_layout, fill=True) self.channel_list = fsui.ListView(self) self.channel_list.set_min_width(212) self.channel_list.on_select_item = self.on_select_channel ver_layout.add(self.channel_list, fill=True, expand=True, margin=10) self.nick_list = fsui.ListView(self) ver_layout.add(self.nick_list, fill=True, expand=True, margin=10) self.text_area = fsui.TextArea(self, font_family="monospace") hori_layout.add( self.text_area, fill=True, expand=True, margin=10, margin_left=0 ) self.input_field = fsui.TextField(self) self.input_field.activated.connect(self.on_input) self.layout.add(self.input_field, fill=True, margin=10, margin_top=0) self.active_channel = LOBBY_CHANNEL self.input_field.focus() self.netplay = Netplay() IRCBroadcaster.add_listener(self)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.HorizontalLayout() vert_layout = fsui.VerticalLayout() self.layout.add(vert_layout, fill=True, expand=True) hor_layout = fsui.HorizontalLayout() vert_layout.add(hor_layout, fill=True) label_stand_in = fsui.Panel(self) tw, th = label_stand_in.measure_text("Games") label_stand_in.set_min_height(th) hor_layout.add(label_stand_in, margin_top=10, margin_bottom=10) hor_layout.add(NewButton(self), margin_left=10, margin_right=10) game_list_selector = GameListSelector(self) game_list_selector.set_min_width(250) game_list_selector.setMaximumWidth(250) game_list_selector.changed.connect(self.on_game_list_changed) hor_layout.add(game_list_selector, expand=False, margin_left=10) self.text_field = fsui.TextField( self, LauncherSettings.get("config_search")) self.text_field.on_changed = self.on_search_changed if VariantsBrowser.use_horizontal_layout(): # window is big enough to use fixed size # self.text_field.set_min_width(210) self.text_field.set_min_width(229) hor_layout.add( self.text_field, expand=False, margin=10, margin_top=0, margin_bottom=0) else: hor_layout.add( self.text_field, expand=True, margin=10, margin_top=0, margin_bottom=0) # self.refresh_button = IconButton(self, "refresh_button.png") # self.refresh_button.set_tooltip( # gettext("Refresh Game Configurations from Online Database")) # self.refresh_button.activated.connect(self.on_refresh_button) # hor_layout.add( # self.refresh_button, margin=10, margin_top=0, margin_bottom=0) self.configurations_browser = ConfigurationsBrowser(self) vert_layout.add( self.configurations_browser, fill=True, expand=3, margin=10) self.variants_panel = fsui.Panel(self) vert_layout.add(self.variants_panel, fill=True, expand=False, margin=10, margin_top=20) self.variants_panel.layout = fsui.HorizontalLayout() self.variants_browser = VariantsBrowser(self.variants_panel) # Do not use fill=True with the default OS X theme at least, # if you do the item will be rendered with the old Aqua look self.variants_panel.layout.add( self.variants_browser, fill=False, expand=True) # for rating in [1, 4, 5]: # button = RatingButton(self.variants_panel, rating) # self.variants_panel.layout.add(button, margin_left=5, fill=True) self.variants_panel.layout.add( RatingChoice(self.variants_panel), margin_left=5, fill=True) self.config_panel = fsui.Panel(self) vert_layout.add(self.config_panel, fill=True, expand=False, margin_bottom=10, margin_top=20) self.config_panel.layout = fsui.VerticalLayout() self.config_group = ConfigGroup(self.config_panel, new_button=False) self.config_panel.layout.add(self.config_group, fill=True, expand=True) LauncherSettings.add_listener(self) self.on_setting("parent_uuid", LauncherSettings.get("parent_uuid"))