Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nse-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mary Kuzmichova
nse-gui
Commits
1840b9a4
Commit
1840b9a4
authored
10 months ago
by
Maryshca
Browse files
Options
Downloads
Patches
Plain Diff
before tabs removal
parent
88aba049
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dpg_gui_tabs.py
+8
-24
8 additions, 24 deletions
dpg_gui_tabs.py
with
8 additions
and
24 deletions
dpg_gui_tabs.py
+
8
−
24
View file @
1840b9a4
...
...
@@ -2,12 +2,10 @@ import dearpygui.dearpygui as dpg
import
re
import
ctypes
from
dpg_gui_styles
import
GuiStyle
,
INDENT
from
config_manager
import
ConfigManager
ctypes
.
windll
.
shcore
.
SetProcessDpiAwareness
(
1
)
FONT_PATH
=
"
D:
\\
fonts
\\
Montserrat
\\
static
\\
Montserrat-Medium.ttf
"
ACCENT_COLOR
=
(
0
,
119
,
200
,
100
)
class
ConfigEditor
:
def
__init__
(
self
):
dpg
.
create_context
()
...
...
@@ -16,32 +14,18 @@ class ConfigEditor:
self
.
styles
=
GuiStyle
()
# self.cfg_manager = ConfigManager()
dpg
.
bind_font
(
self
.
styles
.
montserrat_font
)
dpg
.
bind_theme
(
self
.
styles
.
main_theme
)
self
.
config_data
=
[]
dpg
.
create_viewport
(
title
=
'
config file editor
'
,
width
=
800
,
height
=
600
)
dpg
.
setup_dearpygui
()
dpg
.
show_viewport
()
dpg
.
set_primary_window
(
"
main
"
,
True
)
self
.
config_data
=
[]
self
.
tabs
=
{}
def
set_default_styles
(
self
,
sender
,
value
):
if
value
:
dpg
.
bind_theme
(
None
)
else
:
dpg
.
bind_theme
(
self
.
styles
.
main_theme
)
def
set_default_font
(
self
,
sender
,
value
):
if
value
:
dpg
.
bind_font
(
None
)
else
:
dpg
.
bind_font
(
self
.
styles
.
montserrat_font
)
def
open_file_dialog
(
self
):
dpg
.
show_item
(
"
file_dialog
"
)
def
open_file
(
self
,
sender
,
app_data
,
user_data
):
file_path
=
app_data
[
'
file_path_name
'
]
...
...
@@ -62,11 +46,11 @@ class ConfigEditor:
with
dpg
.
window
(
label
=
"
config file editor
"
,
width
=
800
,
height
=
600
,
tag
=
"
main
"
):
with
dpg
.
menu_bar
():
with
dpg
.
menu
(
label
=
"
file
"
):
dpg
.
add_menu_item
(
label
=
"
open config file
"
,
callback
=
self
.
open_
file_dialog
,
tag
=
"
open_file_btn
"
)
dpg
.
add_menu_item
(
label
=
"
open config file
"
,
callback
=
lambda
_
:
dpg
.
show_item
(
"
file_dialog
"
)
,
tag
=
"
open_file_btn
"
)
with
dpg
.
menu
(
label
=
"
view
"
):
dpg
.
add_menu_item
(
label
=
"
use default theme
"
,
check
=
True
,
callback
=
self
.
set_default_styles
,
default_value
=
False
)
dpg
.
add_menu_item
(
label
=
"
use default font
"
,
check
=
True
,
callback
=
self
.
set_defaul
t_font
,
default_value
=
False
)
dpg
.
add_menu_item
(
label
=
"
use default theme
"
,
check
=
True
,
callback
=
lambda
_
,
v
:
dpg
.
bind_theme
(
None
if
v
else
self
.
styles
.
main_theme
)
,
default_value
=
False
)
dpg
.
add_menu_item
(
label
=
"
use default font
"
,
check
=
True
,
callback
=
lambda
_
,
v
:
dpg
.
bind_font
(
None
if
v
else
self
.
styles
.
montserra
t_font
)
,
default_value
=
False
)
dpg
.
add_menu_item
(
label
=
"
show theme editor
"
,
callback
=
dpg
.
show_style_editor
)
with
dpg
.
file_dialog
(
directory_selector
=
False
,
show
=
False
,
callback
=
self
.
open_file
,
tag
=
"
file_dialog
"
,
width
=
500
,
height
=
400
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment