Skip to content

Commit

Permalink
fix: code generation and excess image generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Axorax committed May 5, 2024
1 parent 7f816b5 commit bbdf618
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 30 deletions.
Binary file modified assets/image_1.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 removed assets/image_5.png
Binary file not shown.
Binary file removed assets/image_6.png
Binary file not shown.
Binary file removed assets/image_7.png
Binary file not shown.
4 changes: 0 additions & 4 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ def download(image_count):
entry_placeholder = True
elif type == 'textarea':
text_placeholder = True

if download_images:
image_count += 1
download(image_count)
elif type == 'button' and download_images:
image_count += 1
download(image_count)
Expand Down
12 changes: 0 additions & 12 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ def get_placeholder(self): return self.p

# Figma token input

token_input_image = tk.PhotoImage(file=load_asset("image_6.png"))

canvas.create_image(541, 123, image=token_input_image)

token_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand All @@ -97,10 +93,6 @@ def get_placeholder(self): return self.p

# File URL input

file_input_image = tk.PhotoImage(file=load_asset("image_7.png"))

canvas.create_image(541, 205, image=file_input_image)

file_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand All @@ -113,10 +105,6 @@ def get_placeholder(self): return self.p

# Output path textbox

outpath_input_image = tk.PhotoImage(file=load_asset("image_5.png"))

canvas.create_image(525, 286, image=outpath_input_image)

outpath_input = TkForge_Entry(
bd=0,
bg="#f5f5f5",
Expand Down
20 changes: 6 additions & 14 deletions tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ def image(i, c):
'''

def textbox(i, c, p=False):
p = f''',\n placeholder="{i['placeholder']}",''' if p else ","
s = f''',\n placeholder="{i['placeholder']}",''' if p else ","
return f'''
textbox_image_{c} = tk.PhotoImage(file=load_asset("{i["image"]}"))
canvas.create_image({int(i['x'] + i['width'] / 2)}, {int(i['y'] + i['height'] / 2)}, image=textbox_image_{c})
textbox_{c} = {"TkForge_Entry" if p == True else "tk.Entry"}(
textbox_{c} = {"TkForge_Entry" if p else "tk.Entry"}(
bd=0,
bg="{i["background"]}",
fg="{i['foreground']}"{p}
fg="{i['foreground']}"{s}
insertbackground="{i['foreground']}",
highlightthickness=0
)
Expand All @@ -53,16 +49,12 @@ def textbox(i, c, p=False):
'''

def textarea(i, c, p=False):
p = f''',\n placeholder="{i['placeholder']}",''' if p else ","
s = f''',\n placeholder="{i['placeholder']}",''' if p else ","
return f'''
textarea_image_{c} = tk.PhotoImage(file=load_asset("{i["image"]}"))
canvas.create_image({int(i['x'] + i['width'] / 2)}, {int(i['y'] + i['height'] / 2)}, image=textarea_image_{c})
textarea_{c} = {"TkForge_Text" if p == True else "tk.Text"}(
textarea_{c} = {"TkForge_Text" if p else "tk.Text"}(
bd=0,
bg="{i["background"]}",
fg="{i["foreground"]}"{p}
fg="{i["foreground"]}"{s}
insertbackground="{i['foreground']}",
highlightthickness=0
)
Expand Down

0 comments on commit bbdf618

Please sign in to comment.