generated from IvanNazaruk/DPG-Template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
39 lines (31 loc) · 1.03 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import darkdetect
import dearpygui.dearpygui as dpg
import DearPyGui_DragAndDrop as dpg_dnd
import DearPyGui_Animations as dpg_anim
import DearPyGui_Theme as dpg_theme
import fonts
import settings
from DearPyGui_Addons import title_bar
dpg.create_context()
dpg_dnd.initialize()
dpg.bind_theme(dpg_theme.initialize())
dpg.bind_font(fonts.load(show=False))
settings.load_settings()
settings.start_up()
def start():
import gui
main_widow = gui.MainWindow()
dpg.set_primary_window(main_widow.window, True)
dpg.set_frame_callback(2, start)
dpg.setup_dearpygui()
dpg.create_viewport(title="Converter", width=fonts.font_size * 26, height=fonts.font_size * 21, vsync=True,
clear_color=dpg_theme.get_current_theme_color_value(dpg.mvThemeCol_WindowBg))
dpg.show_viewport()
is_dark = settings.DarkTitleBar.get()
if settings.UseSystemColor.get():
is_dark = darkdetect.isDark()
title_bar.set_dark_mode(is_dark)
while dpg.is_dearpygui_running():
dpg_anim.update()
dpg.render_dearpygui_frame()
dpg.destroy_context()