Skip to content

Commit

Permalink
Change PyAEDT icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Apr 26, 2024
1 parent 35631e4 commit 3f68e63
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions pyaedt/misc/aedtlib_personalib_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,24 +211,56 @@ def write_tab_config(product_toolkit_dir, pyaedt_lib_dir, force_write=False):

# Write a new "Panel_PyAEDT" sub-element.
panel = ET.SubElement(root, "panel", label="Panel_PyAEDT")
gallery = ET.SubElement(panel, "gallery", imagewidth="120", imageheight="72")
image_rel_path = os.path.relpath(pyaedt_lib_dir, product_toolkit_dir).replace("\\", "/") + "/"
if image_rel_path == "./":
image_rel_path = ""
ET.SubElement(gallery, "button", label="PyAEDT", isLarge="1", image=image_rel_path + "images/large/pyansys.png")
group = ET.SubElement(gallery, "group", label="PyAEDT Menu", image=image_rel_path + "images/gallery/PyAEDT.png")
ET.SubElement(group, "button", label="Console", script="PyAEDT/Console")
ET.SubElement(group, "button", label="Jupyter Notebook", script="PyAEDT/Jupyter")
ET.SubElement(group, "button", label="Run PyAEDT Script", script="PyAEDT/Run PyAEDT Script")
ET.SubElement(group, "button", label="Toolkit Manager", script="PyAEDT/Run Toolkit Manager")
ET.SubElement(
panel,
"button",
label="Console",
script="PyAEDT/Console",
isLarge="1",
image=image_rel_path + "images/gallery/console.png",
)
ET.SubElement(
panel,
"button",
label="Jupyter Notebook",
script="PyAEDT/Jupyter",
isLarge="1",
image=image_rel_path + "images/gallery/jupyter.png",
)
ET.SubElement(
panel,
"button",
label="Run PyAEDT Script",
script="PyAEDT/Run PyAEDT Script",
isLarge="1",
image=image_rel_path + "images/gallery/run_script.png",
)
ET.SubElement(
panel,
"button",
label="Toolkit Manager",
script="PyAEDT/Run Toolkit Manager",
isLarge="1",
image=image_rel_path + "images/gallery/toolkit_manager.png",
)

# Backup any existing file if present
if os.path.isfile(tab_config_file_path):
shutil.copy(tab_config_file_path, tab_config_file_path + ".orig")

write_pretty_xml(root, tab_config_file_path)

files_to_copy = ["images/large/pyansys.png", "images/gallery/PyAEDT.png", "images/large/logo.png"]
files_to_copy = [
"images/large/pyansys.png",
"images/gallery/console.png",
"images/gallery/jupyter.png",
"images/gallery/run_script.png",
"images/gallery/toolkit_manager.png",
"images/large/logo.png",
]
for file_name in files_to_copy:
dest_file = os.path.normpath(os.path.join(pyaedt_lib_dir, file_name))
os.makedirs(os.path.dirname(dest_file), exist_ok=True)
Expand Down
Binary file removed pyaedt/misc/images/gallery/PyAEDT.png
Binary file not shown.
Binary file added pyaedt/misc/images/gallery/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pyaedt/misc/images/gallery/jupyter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pyaedt/misc/images/gallery/run_script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pyaedt/misc/images/gallery/toolkit_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f68e63

Please sign in to comment.