-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
894b410
commit 51fa412
Showing
116 changed files
with
481 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/usr/bin/python3 | ||
|
||
import os | ||
import shelve | ||
from tkinter import Label, Tk, Frame | ||
|
||
from PIL import Image, ImageTk | ||
|
||
|
||
PATH = "../hoverset/data/image" | ||
|
||
|
||
class ImageView(Label): | ||
|
||
def __init__(self, master, image: Image): | ||
super().__init__(master, bg="#5a5a5a") | ||
self.image = image | ||
self.image.thumbnail((40, 40), Image.LANCZOS) | ||
self.config(width=image.size[0], height=image.size[1]) | ||
self._rendered = ImageTk.PhotoImage(image=self.image) | ||
self.config(image=self._rendered) | ||
self.bind("<Enter>", lambda _: self.config(bg="#3a3a3a", fg="green")) | ||
self.bind("<Leave>", lambda _: self.config(bg="#5a5a5a", fg="white")) | ||
|
||
|
||
def recolor(color1, color2, image) -> Image: | ||
image = image.copy() | ||
pix = image.load() | ||
for y in range(image.size[1]): | ||
for x in range(image.size[0]): | ||
if pix[x, y] == color1: | ||
image.putpixel((x, y), color2) | ||
return image | ||
|
||
|
||
def add_image(image: Image, name) -> None: | ||
with shelve.open(PATH) as dat: | ||
dat[name] = image | ||
|
||
|
||
def get_image(name, color): | ||
with shelve.open(PATH) as dat: | ||
img = dat[name] | ||
return recolor((255, 255, 255, 255), color, img) | ||
|
||
|
||
def load_all(parent): | ||
columns = 15 | ||
column = 0 | ||
row = 0 | ||
with shelve.open(PATH) as db: | ||
for name in db: | ||
view = ImageView(parent, db[name]) | ||
view.grid(row=row, column=column) | ||
column += 1 | ||
if column == columns: | ||
column = 0 | ||
row += 1 | ||
|
||
|
||
def save_core(): | ||
db = shelve.open(PATH) | ||
try: | ||
for file in os.listdir("core"): | ||
if file.endswith(".png"): | ||
img = Image.open(os.path.join("core", file)) | ||
db[file.split(".")[0]] = img | ||
except Exception as e: | ||
print(e) | ||
finally: | ||
db.close() | ||
|
||
|
||
def save_icons(): | ||
path = "icons" | ||
db = shelve.open(PATH) | ||
try: | ||
for file in os.listdir(path): | ||
if file.endswith(".png"): | ||
img = Image.open(os.path.join(path, file)) | ||
img.thumbnail((86, 86), Image.LANCZOS) | ||
key = file.split(".")[0] | ||
new_key = "".join(["_", key]) | ||
db[new_key] = img | ||
if key in db: | ||
del db[key] | ||
except Exception as e: | ||
print(e) | ||
finally: | ||
db.close() | ||
|
||
|
||
if __name__ == '__main__': | ||
root = Tk() | ||
save_icons() | ||
save_core() | ||
f = Frame(root, bg="#5a5a5a", width=400, height=400) | ||
f.pack(fill="both", expand=True) | ||
f.grid_propagate(1) | ||
load_all(f) | ||
root.mainloop() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,88 @@ | ||
'add', (3624960, 29645) | ||
'aggregate', (5466624, 29645) | ||
'archive', (3654656, 29645) | ||
'arrow_left', (5585408, 29645) | ||
'arrow_right', (4753920, 29645) | ||
'attach', (6030848, 29645) | ||
'blank', (3476480, 29645) | ||
'button', (3773440, 29645) | ||
'calculator', (4724224, 29645) | ||
'calendar_dark', (4278272, 29645) | ||
'calendar_light', (5763584, 29645) | ||
'camera', (5644800, 29645) | ||
'center_align', (4516352, 29645) | ||
'check', (5436928, 29645) | ||
'checkbutton', (3031040, 29645) | ||
'chevron_down', (6090240, 29645) | ||
'chevron_left', (5674496, 29645) | ||
'chevron_right', (4218880, 29645) | ||
'chevron_up', (3120128, 29645) | ||
'clipboard', (3714048, 29645) | ||
'clock', (3803136, 29645) | ||
'close', (5882368, 29645) | ||
'cloud', (5377536, 29645) | ||
'colorpicker', (4307968, 29645) | ||
'combobox', (4813312, 29645) | ||
'copy', (5407232, 29645) | ||
'crop_resize', (4694528, 29645) | ||
'cut', (3238912, 29645) | ||
'cut2', (5080576, 29645) | ||
'data', (5347840, 29645) | ||
'default', (5139968, 29645) | ||
'delete', (4575744, 29645) | ||
'developer', (5615104, 29645) | ||
'division', (3535872, 29645) | ||
'edit', (6060544, 29645) | ||
'emoji', (4337664, 29645) | ||
'entry', (4932096, 29645) | ||
'equalizer', (3832832, 29645) | ||
'eye', (4129792, 29645) | ||
'file_explorer_dark', (4189184, 29645) | ||
'file_explorer_light', (5496320, 29645) | ||
'filter', (5704192, 29645) | ||
'fingerprint', (3357696, 29645) | ||
'flame', (4100096, 29645) | ||
'flip_horizontal', (4397056, 29645) | ||
'flip_vertical', (3981312, 29645) | ||
'folder', (5110272, 29645) | ||
'frame', (3595264, 29645) | ||
'fullscreen', (3060736, 29645) | ||
'gaming', (5912064, 29645) | ||
'graph', (4872704, 29645) | ||
'grid', (5971456, 29645) | ||
'heart', (5021184, 29645) | ||
'image_dark', (4426752, 29645) | ||
'image_editor', (5288448, 29645) | ||
'image_light', (4991488, 29645) | ||
'info', (4040704, 29645) | ||
'labelframe', (5793280, 29645) | ||
'left_align', (4546048, 29645) | ||
'link', (4605440, 29645) | ||
'listbox', (3743744, 29645) | ||
'math', (3328000, 29645) | ||
'menu', (4664832, 29645) | ||
'menubutton', (3387392, 29645) | ||
'multiline_text', (3298304, 29645) | ||
'network', (4902400, 29645) | ||
'normal_screen', (3090432, 29645) | ||
'notebook', (5169664, 29645) | ||
'paint', (5526016, 29645) | ||
'person', (3565568, 29645) | ||
'pin', (5258752, 29645) | ||
'play', (4486656, 29645) | ||
'progressbar', (3268608, 29645) | ||
'radiobutton', (5199360, 29645) | ||
'redo', (4783616, 29645) | ||
'right_align', (3446784, 29645) | ||
'rotate_clockwise', (6001152, 29645) | ||
'rotate_counterclockwise', (4011008, 29645) | ||
'sample', (4456448, 29730) | ||
'save', (5733888, 29645) | ||
'scale', (3892224, 29645) | ||
'search', (4248576, 29645) | ||
'security', (3921920, 29645) | ||
'separate', (3951616, 29645) | ||
'settings', (4635136, 29645) | ||
'shield', (5229056, 29645) | ||
'sizegrip', (3149824, 29645) | ||
'star_dark', (3684352, 29645) | ||
'text', (4843008, 29645) | ||
'treeview', (5555712, 29645) | ||
'triangle_down', (5822976, 29645) | ||
'triangle_left', (5941760, 29645) | ||
'triangle_right', (5050880, 29645) | ||
'triangle_up', (4367360, 29645) | ||
'undo', (3417088, 29645) | ||
'unpin', (4070400, 29645) | ||
'_formation', (2916352, 25317) | ||
'_dialog_info', (2941952, 29683) | ||
'_dialog_error', (2971648, 29683) | ||
'_dialog_warning', (3001344, 29683) | ||
'canvas_text', (3179520, 29645) | ||
'line', (3209216, 29645) | ||
'bitmap', (3506176, 29645) | ||
'polygon', (3862528, 29645) | ||
'arc', (4159488, 29645) | ||
'window', (4961792, 29645) | ||
'oval', (5318144, 29645) | ||
'cursor', (5852672, 29645) | ||
'rectangle', (6119936, 29645) | ||
'send_to_back', (6149632, 29645) | ||
'bring_to_front', (6179328, 29645) | ||
'maximize', (6209024, 29645) | ||
'minimize', (6238720, 29645) | ||
'_add', (0, 29691) | ||
'_bitmap', (29696, 29691) | ||
'_bring_to_front', (59392, 29691) | ||
'_button', (89088, 29691) | ||
'_canvas_text', (118784, 29691) | ||
'_checkbox', (148480, 29691) | ||
'_clipboard', (178176, 29691) | ||
'_close', (207872, 29691) | ||
'_copy', (237568, 29691) | ||
'_cut', (267264, 29691) | ||
'_delete', (296960, 29691) | ||
'_design', (326656, 29691) | ||
'_dialog_error', (356352, 29682) | ||
'_dialog_info', (386048, 29682) | ||
'_dialog_warning', (415744, 29682) | ||
'_dock_horizontal', (445440, 29691) | ||
'_dock_vertical', (475136, 29691) | ||
'_entry', (504832, 29691) | ||
'_file', (534528, 29691) | ||
'_file_json', (564224, 29691) | ||
'_file_xml', (593920, 29691) | ||
'_formation', (623616, 25310) | ||
'_frame', (649216, 29691) | ||
'_fullscreen', (678912, 29691) | ||
'_grid', (708608, 29691) | ||
'_image', (738304, 29691) | ||
'_label', (768000, 29691) | ||
'_labelframe', (797696, 29691) | ||
'_langauge', (827392, 29691) | ||
'_listbox', (857088, 29691) | ||
'_menubutton', (886784, 29691) | ||
'_message', (916480, 29691) | ||
'_object', (946176, 29691) | ||
'_oval', (975872, 29691) | ||
'_pack', (1005568, 29691) | ||
'_pane', (1035264, 29691) | ||
'_place', (1064960, 29691) | ||
'_play', (1094656, 29691) | ||
'_polygon', (1124352, 29691) | ||
'_polyline', (1154048, 29691) | ||
'_progressbar', (1183744, 29691) | ||
'_radiobutton', (1213440, 29691) | ||
'_recent', (1243136, 29691) | ||
'_rectangle', (1272832, 29691) | ||
'_redo', (1302528, 29691) | ||
'_reload', (1332224, 29691) | ||
'_remove', (1361920, 29691) | ||
'_save', (1391616, 29691) | ||
'_save_all', (1421312, 29691) | ||
'_save_as', (1451008, 29691) | ||
'_scale', (1480704, 29691) | ||
'_scrollbar', (1510400, 29691) | ||
'_send_to_back', (1540096, 29691) | ||
'_tabs', (1569792, 29691) | ||
'_text', (1599488, 29691) | ||
'_treeview', (1629184, 29691) | ||
'_undo', (1658880, 29691) | ||
'_undock', (1688576, 29691) | ||
'_window', (1718272, 29691) | ||
'arrow_down', (1747968, 36971) | ||
'arrow_left', (1785344, 36971) | ||
'arrow_right', (1822720, 36971) | ||
'arrow_up', (1860096, 36971) | ||
'blank', (1897472, 36944) | ||
'check', (1934848, 36971) | ||
'chevron_down', (1972224, 36971) | ||
'chevron_left', (2009600, 36971) | ||
'chevron_right', (2046976, 36971) | ||
'chevron_up', (2084352, 36971) | ||
'colorpicker', (2159104, 36971) | ||
'cursor', (2196480, 36971) | ||
'default', (2233856, 36971) | ||
'edit', (2271232, 36971) | ||
'line', (2345984, 36971) | ||
'maximize', (2383360, 36971) | ||
'minimize', (2420736, 36971) | ||
'ratio', (2458112, 36971) | ||
'search', (2495488, 36971) | ||
'settings', (2532864, 36971) | ||
'triangle_down', (2570240, 36971) | ||
'triangle_left', (2607616, 36971) | ||
'triangle_right', (2644992, 36971) | ||
'triangle_up', (2682368, 36971) | ||
'folder', (2757120, 36971) | ||
'move', (2831872, 36971) | ||
'_arc', (3018752, 29691) | ||
'close', (3459584, 36971) | ||
'image', (3496960, 36971) |
Binary file not shown.
Oops, something went wrong.