properly reverting back changes in issue-698 branch
@@ -46,84 +46,5 @@ class ShellConfigurationPage(ConfigurationPage):
squeeze_combo.grid(row=22, column=1, sticky=tk.W, padx=10, pady=10)
-def load_plugin() -> None:
- get_workbench().add_configuration_page(_("Shell"), ShellConfigurationPage)
-eze_combo.grid(row=2, column=2, sticky="w", padx=10, pady=10)
-
- # ==================================================
- self._original_family = get_workbench().get_option("view.io_font_family")
- self._original_size = get_workbench().get_option("view.io_font_size")
-
- self._family_variable = create_string_var(
- self._original_family, modification_listener=self._update_appearance
- )
-
- self._size_variable = create_string_var(
- self._original_size, modification_listener=self._update_appearance
- )
-
- ttk.Label(self, text="Shell font").grid(
- row=5, column=0, sticky="w", pady=(10, 0)
- )
- self._family_combo = ttk.Combobox(
- self,
- exportselection=False,
- state="readonly",
- height=15,
- textvariable=self._family_variable,
- values=self._get_families_to_show(),
- )
- self._family_combo.grid(row=6, column=0, sticky="w", padx=(0, 10))
-
- ttk.Label(self, text="Size").grid(row=5, column=1, sticky="w", pady=(10, 0))
- self._size_combo = ttk.Combobox(
- self,
- width=4,
- exportselection=False,
- textvariable=self._size_variable,
- state="readonly",
- height=15,
- values=[str(x) for x in range(3, 73)],
- )
- self._size_combo.grid(row=6, column=1, sticky="w")
-
- self._text_preview = ttk.Label(
- self, text="Shell text preview", font="IOFont", background="white"
- )
- self._text_preview.grid(
- row=7, column=1, sticky="w", pady=(30, 30), columnspan=4
- )
-
- (
- ttk.Label(
- self, text="NB! Some style elements change only after restarting Thonny"
- ).grid(row=9, column=0, columnspan=3, sticky="w", pady=(0, 5))
- )
-
- def apply(self):
- return
-
- def cancel(self):
- if getattr(self._family_variable, "modified") or getattr(
- self._size_variable, "modified"
- ):
- get_workbench().set_option("view.io_font_size", self._original_size)
- get_workbench().set_option("view.io_font_family", self._original_family)
- get_workbench().reload_themes()
- get_workbench().update_fonts()
-
- def _update_appearance(self):
- get_workbench().set_option("view.io_font_size", int(self._size_variable.get()))
- get_workbench().set_option("view.io_font_family", self._family_variable.get())
- get_workbench().update_fonts()
- self._text_preview.configure(font="IOFont")
- pass
-
- def _get_families_to_show(self):
- # In Linux, families may contain duplicates (actually different fonts get same names)
- return sorted(set(filter(lambda name: name[0].isalpha(), tk_font.families())))
-
-
-
def load_plugin() -> None:
get_workbench().add_configuration_page(_("Shell"), ShellConfigurationPage)
