mirror of
https://github.com/grassmunk/Chicago95.git
synced 2025-07-27 07:34:36 +02:00
Merge branch 'grassmunk:master' into master
This commit is contained in:
commit
954685bb37
BIN
Icons/Chicago95/actions/16/treeview-closed-inverted.png
Normal file
BIN
Icons/Chicago95/actions/16/treeview-closed-inverted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
Icons/Chicago95/actions/16/treeview-closed.png
Normal file
BIN
Icons/Chicago95/actions/16/treeview-closed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
BIN
Icons/Chicago95/actions/16/treeview-opened-inverted.png
Normal file
BIN
Icons/Chicago95/actions/16/treeview-opened-inverted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
Icons/Chicago95/actions/16/treeview-opened.png
Normal file
BIN
Icons/Chicago95/actions/16/treeview-opened.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
195
Plus/PlusGUI.py
195
Plus/PlusGUI.py
@ -382,7 +382,11 @@ class MakePreview:
|
|||||||
#print("Font: {} NOT FOUND".format(fontname))
|
#print("Font: {} NOT FOUND".format(fontname))
|
||||||
|
|
||||||
return self.get_font("Noto-Sans-Regular")
|
return self.get_font("Noto-Sans-Regular")
|
||||||
|
|
||||||
|
def get_font_y_offset(self, draw, text, font):
|
||||||
|
# Get the top offset from the bounding box
|
||||||
|
left, top, right, bottom = draw.textbbox((0, 0), text, font=font)
|
||||||
|
return top
|
||||||
|
|
||||||
def preview_gen(self):
|
def preview_gen(self):
|
||||||
print("[MakePreview] Preview...", end=' ', flush=True)
|
print("[MakePreview] Preview...", end=' ', flush=True)
|
||||||
@ -395,8 +399,11 @@ class MakePreview:
|
|||||||
msgboxtitle = Image.new('RGB', (173-6, self.iCaptionHeight), color = colors['activetitle'])
|
msgboxtitle = Image.new('RGB', (173-6, self.iCaptionHeight), color = colors['activetitle'])
|
||||||
draw = ImageDraw.Draw(msgboxtitle)
|
draw = ImageDraw.Draw(msgboxtitle)
|
||||||
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
||||||
w, h = draw.textsize("Message Box", font=myFont)
|
#w, h = draw.textsize("Message Box", font=myFont)
|
||||||
font_y_offset = myFont.getoffset("Message Box")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "Message Box", font=myFont)
|
||||||
|
w, h = right - left, bottom - top
|
||||||
|
#font_y_offset = myFont.getoffset("Message Box")[1]
|
||||||
|
font_y_offset = top
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
draw.text((2,int(((self.iCaptionHeight-h)-font_y_offset)/2)), "Message Box", fill=colors['titletext'], font=myFont)
|
draw.text((2,int(((self.iCaptionHeight-h)-font_y_offset)/2)), "Message Box", fill=colors['titletext'], font=myFont)
|
||||||
|
|
||||||
@ -405,17 +412,24 @@ class MakePreview:
|
|||||||
inactivetitle = Image.new('RGB', (inactive_window.size[0]-8, self.iCaptionHeight), color = colors['inactivetitle'])
|
inactivetitle = Image.new('RGB', (inactive_window.size[0]-8, self.iCaptionHeight), color = colors['inactivetitle'])
|
||||||
draw = ImageDraw.Draw(inactivetitle)
|
draw = ImageDraw.Draw(inactivetitle)
|
||||||
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
||||||
w, h = draw.textsize("Inactive Window", font=myFont)
|
#w, h = draw.textsize("Inactive Window", font=myFont)
|
||||||
font_y_offset = myFont.getoffset("Inactive Window")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "Inactive Window", font=myFont)
|
||||||
|
w, h = right - left, bottom - top
|
||||||
|
|
||||||
|
font_y_offset = top
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
draw.text((2,int((self.iCaptionHeight-h)-font_y_offset)/2), "Inactive Window", fill=colors['inactivetitletext'], font=myFont)
|
draw.text((2,int((self.iCaptionHeight-h)-font_y_offset)/2), "Inactive Window", fill=colors['inactivetitletext'], font=myFont)
|
||||||
|
|
||||||
|
|
||||||
#Now we create the Active window title in multiple steps, starting with the title
|
#Now we create the Active window title in multiple steps, starting with the title
|
||||||
activetitle = Image.new('RGB', (217, self.iCaptionHeight), color = colors['activetitle'])
|
activetitle = Image.new('RGB', (217, self.iCaptionHeight), color = colors['activetitle'])
|
||||||
draw = ImageDraw.Draw(activetitle)
|
draw = ImageDraw.Draw(activetitle)
|
||||||
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
myFont = ImageFont.truetype(self.lfcaptionfont, self.caption_pt)
|
||||||
font_y_offset = myFont.getoffset("Active Window")[1]
|
#font_y_offset = myFont.getoffset("Active Window")[1]
|
||||||
w, h = draw.textsize("Active Window", font=myFont)
|
#w, h = draw.textsize("Active Window", font=myFont)
|
||||||
|
left, top, right, bottom = draw.textbbox((0, 0), "Active Window", font=myFont)
|
||||||
|
w, h = right - left, bottom - top
|
||||||
|
font_y_offset = top
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
draw.text((2,int((self.iCaptionHeight-h)-font_y_offset)/2), "Active Window", fill=colors['titletext'], font=myFont)
|
draw.text((2,int((self.iCaptionHeight-h)-font_y_offset)/2), "Active Window", fill=colors['titletext'], font=myFont)
|
||||||
|
|
||||||
@ -425,22 +439,30 @@ class MakePreview:
|
|||||||
menubar = Image.new('RGB', (activetitle.size[0], self.iMenuHeight), color = colors['menu'])
|
menubar = Image.new('RGB', (activetitle.size[0], self.iMenuHeight), color = colors['menu'])
|
||||||
draw = ImageDraw.Draw(menubar)
|
draw = ImageDraw.Draw(menubar)
|
||||||
#Normal menu item
|
#Normal menu item
|
||||||
normal_w, normal_h = draw.textsize("Normal", font=menufont)
|
#normal_w, normal_h = draw.textsize("Normal", font=menufont)
|
||||||
font_y_offset = menufont.getoffset("Normal")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "Normal", font=menufont)
|
||||||
|
normal_w, normal_h = right - left, bottom - top
|
||||||
|
#font_y_offset = menufont.getoffset("Normal")[1]
|
||||||
|
font_y_offset = top
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
draw.text((6,int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Normal", fill=colors['menutext'], font=menufont)
|
draw.text((6,int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Normal", fill=colors['menutext'], font=menufont)
|
||||||
#Disabled menu item
|
#Disabled menu item
|
||||||
disabled_w, disabled_h = draw.textsize("Disabled", font=menufont)
|
#disabled_w, disabled_h = draw.textsize("Disabled", font=menufont)
|
||||||
|
left, top, right, bottom = draw.textbbox((0, 0), "Disabled", font=menufont)
|
||||||
|
disabled_w, disabled_h = right - left, bottom - top
|
||||||
draw.text((normal_w+14,(int(((menubar.size[1]-normal_h)-font_y_offset)/2))+1), "Disabled", fill=colors['buttonhilight'], font=menufont)
|
draw.text((normal_w+14,(int(((menubar.size[1]-normal_h)-font_y_offset)/2))+1), "Disabled", fill=colors['buttonhilight'], font=menufont)
|
||||||
draw.text((normal_w+13,int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Disabled", fill=colors['buttonshadow'], font=menufont)
|
draw.text((normal_w+13,int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Disabled", fill=colors['buttonshadow'], font=menufont)
|
||||||
#Selected menu item
|
#Selected menu item
|
||||||
selected_w, selected_h = draw.textsize("Selected", font=menufont)
|
#selected_w, selected_h = draw.textsize("Selected", font=menufont)
|
||||||
|
left, top, right, bottom = draw.textbbox((0, 0), "Selected", font=menufont)
|
||||||
|
selected_w, selected_h = right - left, bottom - top
|
||||||
#myFont.fontmode = "1"
|
#myFont.fontmode = "1"
|
||||||
#draw.text((6,int(menubar.size[1]-normal_h)/2), "Selected", fill=colors['hilighttext'], font=menufont)
|
#draw.text((6,int(menubar.size[1]-normal_h)/2), "Selected", fill=colors['hilighttext'], font=menufont)
|
||||||
selected = Image.new('RGB', (selected_w+12,menubar.size[1]), color = colors['hilight'])
|
selected = Image.new('RGB', (selected_w+12,menubar.size[1]), color = colors['hilight'])
|
||||||
selected_draw = ImageDraw.Draw(selected)
|
selected_draw = ImageDraw.Draw(selected)
|
||||||
selected_draw.fontmode = "1"
|
selected_draw.fontmode = "1"
|
||||||
font_y_offset = menufont.getoffset("Selected")[1]
|
#font_y_offset = menufont.getoffset("Selected")[1]
|
||||||
|
font_y_offset = top
|
||||||
selected_draw.text((int((selected.size[0]-selected_w)/2),int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Selected", fill=colors['hilighttext'], font=menufont)
|
selected_draw.text((int((selected.size[0]-selected_w)/2),int(((menubar.size[1]-normal_h)-font_y_offset)/2)), "Selected", fill=colors['hilighttext'], font=menufont)
|
||||||
menubar.paste(selected, (normal_w+13+disabled_w+6,int((menubar.size[1]-selected.size[1])/2)))
|
menubar.paste(selected, (normal_w+13+disabled_w+6,int((menubar.size[1]-selected.size[1])/2)))
|
||||||
|
|
||||||
@ -471,7 +493,8 @@ class MakePreview:
|
|||||||
draw.line([(window.size[0]-2,window.size[1]-2),(window.size[0]-2, 1), (window.size[0]-2,window.size[1]-2), (1,window.size[1]-2)],fill=colors['buttonlight'], width=1)
|
draw.line([(window.size[0]-2,window.size[1]-2),(window.size[0]-2, 1), (window.size[0]-2,window.size[1]-2), (1,window.size[1]-2)],fill=colors['buttonlight'], width=1)
|
||||||
window_font = ImageFont.truetype(self.arial_bold, 14)
|
window_font = ImageFont.truetype(self.arial_bold, 14)
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
font_y_offset = window_font.getoffset("Window Text")[1]
|
#font_y_offset = window_font.getoffset("Window Text")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "Window Text", window_font)
|
||||||
draw.text((4,7-font_y_offset), "Window Text", fill=colors['windowtext'], font=window_font)
|
draw.text((4,7-font_y_offset), "Window Text", fill=colors['windowtext'], font=window_font)
|
||||||
window.paste(uparrow, (window.size[0]-2-uparrow.size[0],2))
|
window.paste(uparrow, (window.size[0]-2-uparrow.size[0],2))
|
||||||
draw.rectangle(((window.size[0]-2-uparrow.size[0],2+uparrow.size[1]),(window.size[0]-3, window.size[1]-3)), fill=colors['scrollbar'])
|
draw.rectangle(((window.size[0]-2-uparrow.size[0],2+uparrow.size[1]),(window.size[0]-3, window.size[1]-3)), fill=colors['scrollbar'])
|
||||||
@ -504,14 +527,18 @@ class MakePreview:
|
|||||||
draw.rectangle(((2, 2), (button.size[0]-3, button.size[1]-3)), fill=colors['buttonface'], width=1)
|
draw.rectangle(((2, 2), (button.size[0]-3, button.size[1]-3)), fill=colors['buttonface'], width=1)
|
||||||
myFont = ImageFont.truetype(self.arial_bold, self.msgfont_pt)
|
myFont = ImageFont.truetype(self.arial_bold, self.msgfont_pt)
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
font_y_offset = myFont.getoffset("OK")[1]
|
#w, h = draw.textsize("OK", font=myFont)
|
||||||
w, h = draw.textsize("OK", font=myFont)
|
left, top, right, bottom = draw.textbbox((0, 0), "OK", font=myFont)
|
||||||
|
w, h = right - left, bottom - top
|
||||||
|
font_y_offset = top
|
||||||
draw.text(((66-w)/2,((22-h)-font_y_offset)/2), "OK", fill=colors['buttontext'], font=myFont)
|
draw.text(((66-w)/2,((22-h)-font_y_offset)/2), "OK", fill=colors['buttontext'], font=myFont)
|
||||||
#button.save("button.png", "PNG")
|
#button.save("button.png", "PNG")
|
||||||
|
|
||||||
# Then we create the window itself
|
# Then we create the window itself
|
||||||
myFont = ImageFont.truetype(self.arial, self.msgfont_pt)
|
myFont = ImageFont.truetype(self.arial, self.msgfont_pt)
|
||||||
msg_text_w, msg_text_h = draw.textsize("Message Text", font=myFont)
|
#msg_text_w, msg_text_h = draw.textsize("Message Text", font=myFont)
|
||||||
|
left, top, right, bottom = draw.textbbox((0, 0), "Message Text", font=myFont)
|
||||||
|
msg_text_w, msg_text_h = right - left, bottom - top
|
||||||
message_box = Image.new('RGB', (173, self.iCaptionHeight+8+msg_text_h+3+button.size[1]+6), color = colors['buttondkshadow'])
|
message_box = Image.new('RGB', (173, self.iCaptionHeight+8+msg_text_h+3+button.size[1]+6), color = colors['buttondkshadow'])
|
||||||
draw = ImageDraw.Draw(message_box)
|
draw = ImageDraw.Draw(message_box)
|
||||||
draw.line([(0,0),(171, 0), (0,0), (0,message_box.size[1]-2)],fill=colors['buttonlight'], width=1)
|
draw.line([(0,0),(171, 0), (0,0), (0,message_box.size[1]-2)],fill=colors['buttonlight'], width=1)
|
||||||
@ -521,7 +548,8 @@ class MakePreview:
|
|||||||
draw.rectangle(((2, 2), (message_box.size[0]-3, message_box.size[1]-3)), fill=colors['activeborder'], width=1)
|
draw.rectangle(((2, 2), (message_box.size[0]-3, message_box.size[1]-3)), fill=colors['activeborder'], width=1)
|
||||||
draw.rectangle(((3, 3), (message_box.size[0]-4, message_box.size[1]-4)), fill=colors['buttonface'], width=1)
|
draw.rectangle(((3, 3), (message_box.size[0]-4, message_box.size[1]-4)), fill=colors['buttonface'], width=1)
|
||||||
draw.fontmode = "1"
|
draw.fontmode = "1"
|
||||||
font_y_offset = myFont.getoffset("Message Text")[1]
|
#font_y_offset = myFont.getoffset("Message Text")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "Message Text", window_font)
|
||||||
draw.text((7,self.iCaptionHeight+8-font_y_offset), "Message Text", fill=colors['windowtext'], font=myFont)
|
draw.text((7,self.iCaptionHeight+8-font_y_offset), "Message Text", fill=colors['windowtext'], font=myFont)
|
||||||
# We then put all the peices together
|
# We then put all the peices together
|
||||||
message_box.paste(msgboxtitle, (3,3))
|
message_box.paste(msgboxtitle, (3,3))
|
||||||
@ -559,24 +587,33 @@ class MakePreview:
|
|||||||
# First we make the text under each icon
|
# First we make the text under each icon
|
||||||
# My Computer
|
# My Computer
|
||||||
iconfont = ImageFont.truetype(self.lfFont, self.iconfont_pt)
|
iconfont = ImageFont.truetype(self.lfFont, self.iconfont_pt)
|
||||||
size = iconfont.getsize("My Computer")
|
#size = iconfont.getsize("My Computer")
|
||||||
font_y_offset = iconfont.getoffset("My Computer")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "My Computer", font=iconfont)
|
||||||
|
size = (right - left, bottom - top)
|
||||||
|
#font_y_offset = iconfont.getoffset("My Computer")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "My Computer", iconfont)
|
||||||
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
||||||
my_computer_text = Image.new('RGBA', squaresize, colors['background'])
|
my_computer_text = Image.new('RGBA', squaresize, colors['background'])
|
||||||
iconfont_draw = ImageDraw.Draw(my_computer_text)
|
iconfont_draw = ImageDraw.Draw(my_computer_text)
|
||||||
iconfont_draw.fontmode = "1"
|
iconfont_draw.fontmode = "1"
|
||||||
iconfont_draw.text((3,3-font_y_offset), "My Computer", fill=colors['foreground'], font=iconfont)
|
iconfont_draw.text((3,3-font_y_offset), "My Computer", fill=colors['foreground'], font=iconfont)
|
||||||
# Network Neighborhood
|
# Network Neighborhood
|
||||||
size = iconfont.getsize("Network Neighborhood")
|
#size = iconfont.getsize("Network Neighborhood")
|
||||||
font_y_offset = iconfont.getoffset("Network Neighborhood")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "Network Neighborhood", font=iconfont)
|
||||||
|
size = (right - left, bottom - top)
|
||||||
|
# font_y_offset = iconfont.getoffset("Network Neighborhood")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "Network Neighborhood", iconfont)
|
||||||
squaresize = (size[0] + 6, size[1] + 6 - font_y_offset)
|
squaresize = (size[0] + 6, size[1] + 6 - font_y_offset)
|
||||||
network_neighborhood_text = Image.new('RGBA', squaresize, colors['background'])
|
network_neighborhood_text = Image.new('RGBA', squaresize, colors['background'])
|
||||||
iconfont_draw = ImageDraw.Draw(network_neighborhood_text)
|
iconfont_draw = ImageDraw.Draw(network_neighborhood_text)
|
||||||
iconfont_draw.fontmode = "1"
|
iconfont_draw.fontmode = "1"
|
||||||
iconfont_draw.text((3,3-font_y_offset), "Network Neighborhood", fill=colors['foreground'],font=iconfont)
|
iconfont_draw.text((3,3-font_y_offset), "Network Neighborhood", fill=colors['foreground'],font=iconfont)
|
||||||
# Recycle Bin
|
# Recycle Bin
|
||||||
size = iconfont.getsize("Recycle Bin")
|
# size = iconfont.getsize("Recycle Bin")
|
||||||
font_y_offset = iconfont.getoffset("Recycle Bin")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "Recycle Bin", font=iconfont)
|
||||||
|
size = (right - left, bottom - top)
|
||||||
|
# font_y_offset = iconfont.getoffset("Recycle Bin")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "Recycle Bin", iconfont)
|
||||||
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
||||||
recycle_bin_empty_text = Image.new('RGBA', squaresize, colors['background'])
|
recycle_bin_empty_text = Image.new('RGBA', squaresize, colors['background'])
|
||||||
iconfont_draw = ImageDraw.Draw(recycle_bin_empty_text)
|
iconfont_draw = ImageDraw.Draw(recycle_bin_empty_text)
|
||||||
@ -586,8 +623,11 @@ class MakePreview:
|
|||||||
# My Documents
|
# My Documents
|
||||||
# Not all themes have one
|
# Not all themes have one
|
||||||
if self.my_documents:
|
if self.my_documents:
|
||||||
size = iconfont.getsize("My Documents")
|
# size = iconfont.getsize("My Documents")
|
||||||
font_y_offset = iconfont.getoffset("My Documents")[1]
|
left, top, right, bottom = draw.textbbox((0, 0), "My Documents", font=iconfont)
|
||||||
|
size = (right - left, bottom - top)
|
||||||
|
# font_y_offset = iconfont.getoffset("My Documents")[1]
|
||||||
|
font_y_offset = self.get_font_y_offset(draw, "My Documents", iconfont)
|
||||||
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
squaresize = (size[0] + 6, size[1] + 6- font_y_offset)
|
||||||
my_documents_text = Image.new('RGBA', squaresize, colors['background'])
|
my_documents_text = Image.new('RGBA', squaresize, colors['background'])
|
||||||
iconfont_draw = ImageDraw.Draw(my_documents_text)
|
iconfont_draw = ImageDraw.Draw(my_documents_text)
|
||||||
@ -668,6 +708,56 @@ class MakePreview:
|
|||||||
|
|
||||||
print("OK", end='\n', flush=True)
|
print("OK", end='\n', flush=True)
|
||||||
|
|
||||||
|
def render_html_to_image(self, html_path, output_path, width, height):
|
||||||
|
"""Render HTML to image using any available browser."""
|
||||||
|
html_abs_path = os.path.abspath(html_path)
|
||||||
|
html_url = f"file://{html_abs_path}"
|
||||||
|
|
||||||
|
# List of browsers to try, in order of preference
|
||||||
|
browsers = [
|
||||||
|
{
|
||||||
|
'name': 'chromium-browser',
|
||||||
|
'args': ['--headless', '--disable-gpu', f'--window-size={width},{height}', f'--screenshot={output_path}', html_url]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'google-chrome',
|
||||||
|
'args': ['--headless', '--disable-gpu', f'--window-size={width},{height}', f'--screenshot={output_path}', html_url]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'firefox',
|
||||||
|
'args': ['--headless', f'--screenshot={output_path}', f'--window-size={width},{height}', html_url]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'brave-browser',
|
||||||
|
'args': ['--headless', '--disable-gpu', f'--window-size={width},{height}', f'--screenshot={output_path}', html_url]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
# Try to use wkhtmltoimage first if it exists (original method)
|
||||||
|
try:
|
||||||
|
subprocess.check_call(['wkhtmltoimage', '--quiet', '--height', str(height), '--width', str(width), html_path, output_path])
|
||||||
|
return True
|
||||||
|
except (subprocess.SubprocessError, FileNotFoundError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# If wkhtmltoimage not available, try browsers
|
||||||
|
for browser in browsers:
|
||||||
|
try:
|
||||||
|
subprocess.check_call([browser['name']] + browser['args'])
|
||||||
|
return True
|
||||||
|
except (subprocess.SubprocessError, FileNotFoundError):
|
||||||
|
continue
|
||||||
|
|
||||||
|
# If all browsers fail, try ImageMagick's convert
|
||||||
|
try:
|
||||||
|
subprocess.check_call(['convert', '-size', f'{width}x{height}', html_url, output_path])
|
||||||
|
return True
|
||||||
|
except (subprocess.SubprocessError, FileNotFoundError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# No rendering method available
|
||||||
|
return False
|
||||||
|
|
||||||
def get_wallpaper(self):
|
def get_wallpaper(self):
|
||||||
print("[MakePreview] Wallpaper...", end=' ', flush=True)
|
print("[MakePreview] Wallpaper...", end=' ', flush=True)
|
||||||
# WallpaperStyle=2
|
# WallpaperStyle=2
|
||||||
@ -682,24 +772,40 @@ class MakePreview:
|
|||||||
if (self.plus.theme_config['wallpaper'] and self.plus.theme_config['wallpaper']['theme_wallpaper'] and
|
if (self.plus.theme_config['wallpaper'] and self.plus.theme_config['wallpaper']['theme_wallpaper'] and
|
||||||
'path' in self.plus.theme_config['wallpaper']['theme_wallpaper'] and self.plus.theme_config['wallpaper']['theme_wallpaper']['path']):
|
'path' in self.plus.theme_config['wallpaper']['theme_wallpaper'] and self.plus.theme_config['wallpaper']['theme_wallpaper']['path']):
|
||||||
|
|
||||||
#print(plus.theme_config['wallpaper']['theme_wallpaper']['path'])
|
|
||||||
#print(os.path.splitext(plus.theme_config['wallpaper']['theme_wallpaper']['path'])[1])
|
|
||||||
if os.path.splitext(self.plus.theme_config['wallpaper']['theme_wallpaper']['path'])[1].lower() in [".html", ".htm"]:
|
if os.path.splitext(self.plus.theme_config['wallpaper']['theme_wallpaper']['path'])[1].lower() in [".html", ".htm"]:
|
||||||
w = 1024
|
w = 1024
|
||||||
h = 768
|
h = 768
|
||||||
if "800" in self.plus.theme_config['wallpaper']['theme_wallpaper']['path'] or "800" in self.plus.theme_name:
|
if "800" in self.plus.theme_config['wallpaper']['theme_wallpaper']['path'] or "800" in self.plus.theme_name:
|
||||||
w = 800
|
w = 800
|
||||||
h = 600
|
h = 600
|
||||||
|
|
||||||
args = ['wkhtmltoimage', '--quiet','--height', str(h), '--width', str(w), self.plus.theme_config['wallpaper']['theme_wallpaper']['path'],'temp_html.png']
|
temp_file = "temp_html.png"
|
||||||
|
|
||||||
subprocess.check_call(args)
|
# Try to render HTML to image using our new function
|
||||||
self.wallpaper = Image.open("temp_html.png").convert('RGBA')
|
success = self.render_html_to_image(
|
||||||
os.remove("temp_html.png")
|
self.plus.theme_config['wallpaper']['theme_wallpaper']['path'],
|
||||||
|
temp_file,
|
||||||
|
w,
|
||||||
|
h
|
||||||
|
)
|
||||||
|
|
||||||
|
if success and os.path.exists(temp_file):
|
||||||
|
self.wallpaper = Image.open(temp_file).convert('RGBA')
|
||||||
|
os.remove(temp_file)
|
||||||
|
else:
|
||||||
|
print("Warning: Could not render HTML wallpaper. Please install a browser like chromium-browser, firefox, or brave.")
|
||||||
|
# Fall back to default handling
|
||||||
|
try:
|
||||||
|
self.wallpaper = Image.open(self.plus.theme_config['wallpaper']['theme_wallpaper']['path']).convert('RGBA')
|
||||||
|
except OSError:
|
||||||
|
args = ['convert', '-resize', '32x32', self.plus.theme_config['wallpaper']['theme_wallpaper']['path'], "temp_bmp.png"]
|
||||||
|
subprocess.check_call(args)
|
||||||
|
self.wallpaper = Image.open("temp_bmp.png").convert('RGBA')
|
||||||
|
os.remove("temp_bmp.png")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.wallpaper = Image.open(self.plus.theme_config['wallpaper']['theme_wallpaper']['path']).convert('RGBA')
|
self.wallpaper = Image.open(self.plus.theme_config['wallpaper']['theme_wallpaper']['path']).convert('RGBA')
|
||||||
except OSError:
|
except OSError:
|
||||||
args = ['convert', '-resize', '32x32', self.plus.theme_config['wallpaper']['theme_wallpaper']['path'], "temp_bmp.png"]
|
args = ['convert', '-resize', '32x32', self.plus.theme_config['wallpaper']['theme_wallpaper']['path'], "temp_bmp.png"]
|
||||||
subprocess.check_call(args)
|
subprocess.check_call(args)
|
||||||
self.wallpaper = Image.open("temp_bmp.png").convert('RGBA')
|
self.wallpaper = Image.open("temp_bmp.png").convert('RGBA')
|
||||||
@ -709,7 +815,6 @@ class MakePreview:
|
|||||||
self.tile = True
|
self.tile = True
|
||||||
|
|
||||||
self.style = self.plus.theme_config['wallpaper']['theme_wallpaper']['wallpaperstyle']
|
self.style = self.plus.theme_config['wallpaper']['theme_wallpaper']['wallpaperstyle']
|
||||||
|
|
||||||
print("OK", end='\n', flush=True)
|
print("OK", end='\n', flush=True)
|
||||||
|
|
||||||
def make_icons(self, plus, ico_name):
|
def make_icons(self, plus, ico_name):
|
||||||
@ -1274,22 +1379,4 @@ def main():
|
|||||||
#plus = plusGTK()
|
#plus = plusGTK()
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
185
Theme/Chicago95/gtk-3.0/apps/xfce-panel-hacks.css
Normal file
185
Theme/Chicago95/gtk-3.0/apps/xfce-panel-hacks.css
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
/* Hack to give the task bar a pseudo handle
|
||||||
|
Remove code after this comment to disable the fake handle image.
|
||||||
|
Also, tasklist name changes depending on individual panel layout. This hack supports up to 24 different positions.
|
||||||
|
If it still doesn't work for you, you can look up your tasklist's ID in xfce4-panel settings.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#tasklist > box, #tasklist-1 > box, #tasklist-2 > box, #tasklist-3 > box,
|
||||||
|
#tasklist-4 > box, #tasklist-5 > box, #tasklist-6 > box, #tasklist-7 > box,
|
||||||
|
#tasklist-8 > box, #tasklist-9 > box, #tasklist-10 > box, #tasklist-11 > box,
|
||||||
|
#tasklist-12 > box, #tasklist-13 > box, #tasklist-14 > box, #tasklist-15 > box,
|
||||||
|
#tasklist-16 > box, #tasklist-17 > box, #tasklist-18 > box, #tasklist-19 > box,
|
||||||
|
#tasklist-20 > box, #tasklist-21 > box, #tasklist-22 > box, #tasklist-23 > box,
|
||||||
|
#tasklist-24 > box {
|
||||||
|
border-left: 11px solid;
|
||||||
|
border-image: url("../assets/panel-handle.png");
|
||||||
|
border-image-slice: 2 2 2 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hack to give the first launcher icon a pseudo handle */
|
||||||
|
|
||||||
|
#XfcePanelWindow widget > widget:nth-child(2) box #launcher-arrow {
|
||||||
|
border-left: 11px solid;
|
||||||
|
border-image: url("../assets/panel-handle.png");
|
||||||
|
border-image-slice: 2 2 2 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hack to give launcher icons borders on hover and on click */
|
||||||
|
|
||||||
|
#XfcePanelWindow widget > widget:nth-child(2) box #launcher-arrow image {
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#XfcePanelWindow widget > widget:nth-child(2) box #launcher-arrow:hover image {
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#XfcePanelWindow widget > widget:nth-child(2) box #launcher-arrow:active image {
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#XfcePanelWindow #launcher-arrow:hover {
|
||||||
|
box-shadow: 1px 1px @border_bright inset, -1px -1px @border_shade inset;
|
||||||
|
background-image: none;
|
||||||
|
border-top: 2px transparent solid;
|
||||||
|
border-bottom: 2px transparent solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
#XfcePanelWindow #launcher-arrow:active {
|
||||||
|
box-shadow: 1px 1px @border_shade inset, -1px -1px @border_bright inset;
|
||||||
|
background-image: none;
|
||||||
|
border-top: 2px transparent solid;
|
||||||
|
border-bottom: 2px transparent solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hack to hide the mic icon from pulseaudio plugin */
|
||||||
|
|
||||||
|
#pulseaudio-button > box > .recording-indicator {
|
||||||
|
-gtk-icon-transform: scale(0);
|
||||||
|
margin-right:-100px;
|
||||||
|
}
|
||||||
|
#pulseaudio-button > box > image:nth-child(2){
|
||||||
|
margin-left:-8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hack to add border to systray, all of the internal and some of the external plugins
|
||||||
|
WARNING: This hack assumes your systray and plugin icons are laid out in the following order:
|
||||||
|
systray to the left, stylable plugin icons in the middle, clock plugin on the right.
|
||||||
|
You'll have to make appropriate modifications to "border-right", "border-left" and "box-shadow" properties of certain items if it's not the case.
|
||||||
|
Also, just like the tasklist, some of the plugin names change depending on individual panel layout. This hack supports up to 24 different positions for those plugins. Again, if it still doesn't work for you, you can look up these plugins' IDs in xfce4-panel settings.
|
||||||
|
Unfortunately, it wasn't possible to add border to some plugins - mostly because they either already had solid borders around them or they didn't fit in the borders. They will have to be moved outside the border.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#systray-1 > box, #systray-2 > box, #systray-3 > box, #systray-4 > box, #systray-5 > box, #systray-6 > box, #systray-7 > box, #systray-8 > box, #systray-9 > box, #systray-10 > box, #systray-11 > box, #systray-12 > box, #systray-13 > box, #systray-14 >box, #systray-15 > box, #systray-16 > box, #systray-17 > box, #systray-18 > box, #systray-19 > box, #systray-20 > box, #systray-21 >box, #systray-22 > box, #systray-23 > box, #systray-24 > box {
|
||||||
|
box-shadow: 1px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#xkb-1 button, #xkb-2 button, #xkb-3 button, #xkb-3 button, #xkb-4 button, #xkb-5 button, #xkb-6 button, #xkb-7 button, #xkb-8 button, #xkb-9 button, #xkb-10 button, #xkb-12 button, #xkb-13 button, #xkb-14 button, #xkb-15 button, #xkb-16 button, #xkb-17 button, #xkb-18 button, #xkb-19 button, #xkb-20 button, #xkb-21 button, #xkb-22 button, #xkb-23 button, #xkb-24 button {
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
margin-left: -1px;
|
||||||
|
color: white;
|
||||||
|
outline-width: 0px;
|
||||||
|
background: linear-gradient(180deg, @bg_color 18%, @selected_bg_color 18%, @selected_bg_color 82%, @bg_color 82%);
|
||||||
|
background-size:16px;
|
||||||
|
background-position: 55% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
#xfce4-notification-plugin, #xfce4-notification-plugin:hover, #xfce4-notification-plugin:active {
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
padding-top:14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio-button > box{
|
||||||
|
margin-top:-1px;
|
||||||
|
margin-bottom:-1px;
|
||||||
|
margin-left:-1px;
|
||||||
|
margin-right:-1px;
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock-button {
|
||||||
|
border-left: none;
|
||||||
|
box-shadow: inset 0px 1px @border_shade, inset -1px -1px @border_bright;
|
||||||
|
}
|
||||||
|
|
||||||
|
#xfce4-power-manager-plugin box{
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
#xfce4-power-manager-plugin{margin-left:-1px; margin-right:-1px;}
|
||||||
|
|
||||||
|
|
||||||
|
#xfce_sensors box {
|
||||||
|
padding-right:0px;
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#xfce4-clipman-plugin{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#thunar-tpa-1 button, #thunar-tpa-2 button, #thunar-tpa-3 button, #thunar-tpa-4 button, #thunar-tpa-5 button, #thunar-tpa-6 button, #thunar-tpa-7 button, #thunar-tpa-8 button, #thunar-tpa-8 button, #thunar-tpa-9 button, #thunar-tpa-10 button, #thunar-tpa-11 button, #thunar-tpa-12 button, #thunar-tpa-13 button, #thunar-tpa-14 button, #thunar-tpa-15 button, #thunar-tpa-16 button, #thunar-tpa-17 button, #thunar-tpa-18 button, #thunar-tpa-19 button, #thunar-tpa-20 button, #thunar-tpa-21 button, #thunar-tpa-22 button, #thunar-tpa-23 button, #thunar-tpa-24 button {
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#xfce4-verve-plugin-1 box, #xfce4-verve-plugin-2 box, #xfce4-verve-plugin-3 box, #xfce4-verve-plugin-4 box, #xfce4-verve-plugin-5 box, #xfce4-verve-plugin-6 box, #xfce4-verve-plugin-7 box, #xfce4-verve-plugin-8 box, #xfce4-verve-plugin-9 box, #xfce4-verve-plugin-10 box, #xfce4-verve-plugin-11 box, #xfce4-verve-plugin-13 box, #xfce4-verve-plugin-14 box, #xfce4-verve-plugin-15 box, #xfce4-verve-plugin-16 box, #xfce4-verve-plugin-17 box, #xfce4-verve-plugin-18 box, #xfce4-verve-plugin-19 box, #xfce4-verve-plugin-20 box, #xfce4-verve-plugin-21 box, #xfce4-verve-plugin-22 box, #xfce4-verve-plugin-23 box, #xfce4-verve-plugin-24 box{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#xfce-panel-button{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#genmon-1 box, #genmon-2 box, #genmon-3 box, #genmon-4 box, #genmon-5 box, #genmon-6 box, #genmon-7 box, #genmon-8 box, #genmon-9 box, #genmon-10 box, #genmon-11 box, #genmon-12 box, #genmon-13 box, #genmon-14 box, #genmon-15 box, #genmon-16 box, #genmon-17 box, #genmon-18 box, #genmon-19 box, #genmon-20 box, #genmon-21 box, #genmon-22 box, #genmon-23 box, #genmon-24 box{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#xfce-panel-toggle-button box {
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
#xfce-panel-toggle-button{margin-left:-1px;margin-right:-1px;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#windowmenu-button{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#directorymenu-button{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#actions-button{
|
||||||
|
box-shadow: 0px 4px @border_shade inset, 0 3px @bg_color inset, 0 -4px @border_bright inset, 0 -3px @border_bright inset, 0 -3px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#sn-button, #sn-button:hover, #sn-button:active{
|
||||||
|
box-shadow: 0px 3px @border_shade inset, 0 2px @bg_color inset, 0 -1px @border_bright inset, 0 -3px @border_bright inset, 0 -2px @bg_color inset;
|
||||||
|
border-right: none;
|
||||||
|
}
|
BIN
Theme/Chicago95/gtk-3.0/assets/panel-handle.png
Normal file
BIN
Theme/Chicago95/gtk-3.0/assets/panel-handle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -60,3 +60,9 @@ treeview.view image {
|
|||||||
treeview.view.separator {
|
treeview.view.separator {
|
||||||
min-height: 8px;
|
min-height: 8px;
|
||||||
color: @border_dark; }
|
color: @border_dark; }
|
||||||
|
|
||||||
|
/* This adds expand symbols to treeview */
|
||||||
|
treeview.view.expander { -gtk-icon-source: -gtk-icontheme("treeview-closed"); }
|
||||||
|
treeview.view.expander:selected { -gtk-icon-source: -gtk-icontheme("treeview-closed-inverted"); }
|
||||||
|
treeview.view.expander:checked { -gtk-icon-source: -gtk-icontheme("treeview-opened"); }
|
||||||
|
treeview.view.expander:checked:selected { -gtk-icon-source: -gtk-icontheme("treeview-opened-inverted"); }
|
||||||
|
@ -186,3 +186,4 @@
|
|||||||
@import url("apps/nemo.css");
|
@import url("apps/nemo.css");
|
||||||
@import url("apps/synaptic.css");*/
|
@import url("apps/synaptic.css");*/
|
||||||
@import url("apps/lightdm-gtk-greeter.css");
|
@import url("apps/lightdm-gtk-greeter.css");
|
||||||
|
@import url("apps/xfce-panel-hacks.css");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user