def left_label_text(label: str, name: str, xoffset=100, default_value: str = "") -> None: core.add_text(label) core.add_same_line(xoffset=xoffset) core.add_text(name, default_value=default_value)
def place(self, same_line=False): if same_line: add_same_line() add_input_text(self.name, callback=self.on_text_changed, callback_data=self.callback_data, **self.default_config) return self
def _render_start_scan_window(self): core.delete_item(item=self._window_name, children_only=True) core.add_text('Please choose directories to scan.', parent=self._window_name) core.add_text('Press \'Start Scan\' to run duplicate images search.', parent=self._window_name) core.add_text( '', parent=self._window_name) core.add_separator(parent=self._window_name) core.add_button( 'Add Scan Directory', callback=self._add_scan_directory_callback, parent=self._window_name) core.add_text('', parent=self._window_name) core.add_text('Folders to scan', parent=self._window_name) if not self._scan_directories: core.add_text('No directories chosen', parent=self._window_name, color=[249, 19, 19]) for scan_directory in self._scan_directories: core.add_button( name='Remove ##'+scan_directory, parent=self._window_name, callback=self._remove_scan_dir_click_handler, callback_data=scan_directory) core.add_same_line( parent=self._window_name) core.add_text( name=scan_directory, parent=self._window_name) core.add_separator(parent=self._window_name) core.add_text( '', parent=self._window_name) core.add_button( 'Start Scan', callback=self._start_scan_click_handler, callback_data=self._scan_directories, parent=self._window_name)
def __init__(self): core.set_style_item_spacing(1, 1) core.set_style_window_padding(0, 0) with simple.window("main"): with simple.group("controls", width=520): with simple.group("buttons"): for x in range(6): core.add_button(f"id-{x}", label=f"button {x}") core.add_color_button("bcolor", (196, 128, 155, 255)) core.add_radio_button("radio") core.add_checkbox("checkbox") core.add_same_line() with simple.group("misc"): core.add_date_picker("date") with simple.group("text"): core.add_text("text") core.add_input_text( "input_text", label="", default_value= "Call me Ish-meal. Tasty like an ashen log.") core.add_label_text("label", label="", default_value="label") core.add_same_line() with simple.group("dropdown"): core.add_listbox("listbox", label="", items=(1, 2, 3)) core.add_combo("combo", label="", items=(1, 2, 3)) for x in ["float", "int"]: with simple.group(x): for what in ["add_drag_", "add_input_"]: for y in ['', 2, 3, 4]: n = f"{what}{x}{y}" cmd = getattr(core, n) cmd(n, label="", width=200) core.add_same_line() manager.ThemeManager()