Skip to content

Commit 131f85d

Browse files
committed
Small changes
1 parent ae229cd commit 131f85d

File tree

4 files changed

+85
-10
lines changed

4 files changed

+85
-10
lines changed

OpticUI.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,77 @@ def set_icons(iconpack_path):
102102
full = os.path.join(root, file)
103103
icons.update({file: full})
104104

105+
def icon_path(name, spec=None):
106+
filename = None # "assets/chat.png"
107+
name = name.lower()
108+
names = None
109+
n = 0
110+
if " " in name:
111+
names = name.split(" ")
112+
name = names[0]
113+
name = name.lower()
114+
elif "." in name:
115+
names = name.split(".")
116+
name = names[0]
117+
name = name.lower()
118+
119+
# name = name.replace(" ", "-")
120+
if names == None:
121+
names = [name]
122+
for name in names:
123+
for f in icons:
124+
full = icons[f]
125+
files = f[:-4].split("-")
126+
if str(name) == str(f)[:-4].lower():
127+
filename = full
128+
break
129+
130+
elif str(name) == str(f).lower():
131+
filename = full
132+
break
133+
elif str(name) == files[0]:
134+
filename = full
135+
elif name in full:
136+
if spec == None:
137+
filename = full
138+
break
139+
else:
140+
if spec in full:
141+
filename = full
142+
break
143+
if filename != None:
144+
break
145+
if filename != None:
146+
break
147+
148+
if filename == None:
149+
filename = "link.png"
150+
if name == "":
151+
filename = "link.png"
152+
try:
153+
if filename.endswith(".svg") == True:
154+
pass
155+
# out = BytesIO()
156+
# cairosvg.svg2png(url=filename, write_to=out)
157+
# imager = Image.open(out)
158+
else:
159+
try:
160+
imager = Image.open(filename)
161+
except:
162+
with open(filename) as f:
163+
reader = f.read()
164+
if ".png" in reader:
165+
filename = os.path.dirname(filename) + "\\" + reader
166+
#imager = Image.open(filename)
167+
else:
168+
#imager = Image.open(asset_dir + "link.png")
169+
filename = asset_dir + "link.png"
170+
return filename#imager
171+
172+
except:
173+
#imager = Image.open(asset_dir + "link.png")
174+
return asset_dir + "link.png"#imager
175+
return asset_dir + "link.png"
105176

106177
def icon(name, spec=None):
107178
filename = None # "assets/chat.png"

manager.build/.sconsign-37.dblite

Whitespace-only changes.

manager.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Copyright Paul-E/Opticos Studios 2021
44
# https://sites.google.com/bartimee.com/opticos-studios/home
55

6-
76
# Dedicated to the Sacred Heart of Jesus
87

98
# #########
@@ -37,7 +36,7 @@
3736

3837
BUILD_MODE = "MSIX" # MSIX or WIN32
3938

40-
version = "1.3.8 beta 1 build7"
39+
version = "1.3.8 beta 2 build7"
4140

4241
lc_name = "Licenses138.txt"
4342

@@ -1088,6 +1087,7 @@ def get():
10881087
profile = tools.profile(machine)
10891088
m_version = get_version(machine)
10901089

1090+
10911091
if "QT_SCALE_FACTOR=2" in profile:
10921092
QT = 2
10931093
if "GDK_SCALE=2" in profile:
@@ -2855,7 +2855,7 @@ def login(*args):
28552855
if creds != {}:
28562856
return creds
28572857

2858-
2858+
from ttkbootstrap import Style
28592859
def shortcut(name=None, cmd=None, mach=None, icn=None):
28602860
ui.set_icons(asset_dir + "Paper/")
28612861
k = get_light()
@@ -2879,6 +2879,10 @@ def quitter():
28792879
# sys.exit()
28802880
return None
28812881

2882+
#style = Style(theme='superhero')#darkly')
2883+
#boxRoot = style.master
2884+
2885+
28822886
boxRoot.title("Shortcut Creator")
28832887
boxRoot.iconname("Dialog")
28842888
boxRoot.minsize(420, 480)
@@ -3421,6 +3425,7 @@ def draw(canvas, mouse=False):
34213425
if animator.get("start")[0] < 100 and animator.get("start")[0] > 0:
34223426
if acrylic == False:
34233427
canvas.blit(back, [-1 * (screensize[0] - WIDTH), -1 * (screensize[1] - taskbar - int(HEIGHT * launch))])
3428+
34243429
if pos_config == "bottom":
34253430
win32gui.MoveWindow(HWND, winpos, screensize[1] - taskbar - int(HEIGHT * launch), WIDTH, HEIGHT, 1)
34263431
elif pos_config == "top":
@@ -3430,7 +3435,6 @@ def draw(canvas, mouse=False):
34303435
HEIGHT, 1)
34313436
elif pos_config == "left":
34323437
win32gui.MoveWindow(HWND, taskbar - WIDTH + int(WIDTH * launch), screensize[1] - HEIGHT, WIDTH, HEIGHT, 1)
3433-
34343438
lumen_opac = 0
34353439
win32gui.SetLayeredWindowAttributes(HWND, win32api.RGB(*fuchsia), int(launch * 255), win32con.LWA_ALPHA)
34363440

singleton.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def __init__(self, flavor_id="", lockfile=""):
6868
try:
6969
fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
7070
except IOError:
71-
logger.warning(
72-
"Another instance is already running, quitting.")
71+
#logger.warning(
72+
# "Another instance is already running, quitting.")
7373
raise SingleInstanceException()
7474
self.initialized = True
7575

@@ -87,10 +87,10 @@ def __del__(self):
8787
if os.path.isfile(self.lockfile):
8888
os.unlink(self.lockfile)
8989
except Exception as e:
90-
if logger:
91-
logger.warning(e)
92-
else:
93-
print("Unloggable error: %s" % e)
90+
#if logger:
91+
# logger.warning(e)
92+
#else:
93+
# print("Unloggable error: %s" % e)
9494
sys.exit(-1)
9595

9696

0 commit comments

Comments
 (0)