Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/calculadora.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Calculadora(object):
e selecionar uma de suas classes de estilo.
"""


def __init__(self, master):
self.master = master
self.calc = Calculador()
Expand Down Expand Up @@ -71,9 +72,11 @@ def __init__(self, master):
self._create_menu(self.master)

@staticmethod

def _load_settings():
settings_path = os.path.join(os.path.dirname(__file__), 'settings/settings.json')
"""Utilitário para carregar o arquivo de confirgurações da calculadora."""
with open('./app/settings/settings.json', mode='r', encoding='utf-8') as f:
with open(settings_path, mode='r', encoding='utf-8') as f:
settings = json_load(f)

return settings
Expand Down Expand Up @@ -122,8 +125,8 @@ def _create_menu(self, master):

def _change_theme_to(self, name='Dark'):
self.settings['current_theme'] = name

with open('./app/settings/settings.json', 'w') as outfile:
settings_path = os.path.join(os.path.dirname(__file__), 'settings/settings.json')
with open(settings_path, 'w') as outfile:
json_dump(self.settings, outfile, indent=4)

self._realod_app()
Expand Down
4 changes: 2 additions & 2 deletions app/settings/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"current_theme": "Dark",
"current_theme": "Ocean",
"global": {
"borderwidth": 0,
"highlightthickness": 0,
Expand Down Expand Up @@ -313,4 +313,4 @@
}
}
]
}
}