Skip to content

Commit

Permalink
GUI Bugfix - Stop settings colors leaking into analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Mar 16, 2021
1 parent cff0f56 commit 11009bf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 36 deletions.
13 changes: 10 additions & 3 deletions lib/gui/popup_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _build_header(self):
lbl_header = ttk.Label(lbl_frame,
textvariable=self._tk_vars["header"],
anchor=tk.W,
style=".SPanel.Header1.TLabel")
style="SPanel.Header1.TLabel")
lbl_header.pack(fill=tk.X, expand=True, side=tk.LEFT)

sep = ttk.Frame(header_frame, height=2, relief=tk.RIDGE)
Expand Down Expand Up @@ -285,14 +285,21 @@ def _fix_styles(cls):
"""
theme = get_config().user_theme["settings_popup"]
style = ttk.Style()

# Fix a bug in Tree-view that doesn't show alternate foreground on selection
fix_map = lambda o: [elm for elm in style.map("Treeview", query_opt=o) # noqa
if elm[:2] != ("!disabled", "!selected")]
style.map("Treeview", foreground=fix_map("foreground"), background=fix_map("background"))
style.map('Treeview', background=[('selected', theme["header_color"])])

# Remove the Borders
style.configure("ConfigNav.Treeview", bd=0, background="#F0F0F0")
style.layout("ConfigNav.Treeview", [('ConfigNav.Treeview.treearea', {'sticky': 'nswe'})])

# Set colors
style.map("ConfigNav.Treeview",
foreground=fix_map("foreground"),
background=fix_map("background"))
style.map('ConfigNav.Treeview', background=[('selected', theme["header_color"])])

def _build_tree(self, parent, configurations, name):
""" Build the configuration pop-up window.
Expand Down
67 changes: 34 additions & 33 deletions plugins/train/model/dlight_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,37 @@
"(Adapted from https://github.com/dfaker/df)")


_DEFAULTS = {
"features": {
"default": "best",
"info": "Higher settings will allow learning more features such as tatoos, piercing,"
"\nand wrinkles."
"\nStrongly affects VRAM usage.",
"datatype": str,
"choices": ["lowmem", "fair", "best"],
"gui_radio": True,
"fixed": True,
},
"details": {
"default": "good",
"info": "Defines detail fidelity. Lower setting can appear 'rugged' while 'good' "
"might take onger time to train."
"\nAffects VRAM usage.",
"datatype": str,
"choices": ["fast", "good"],
"gui_radio": True,
"fixed": True,
},
"output_size": {
"default": 256,
"info": "Output image resolution (in pixels).\nBe aware that larger resolution will "
"increase VRAM requirements.\nNB: Must be either 128, 256, or 384.",
"datatype": int,
"rounding": 128,
"min_max": (128, 384),
"choices": [],
"gui_radio": False,
"fixed": True,
},
}
_DEFAULTS = dict(
features=dict(
default="best",
info="Higher settings will allow learning more features such as tatoos, piercing and "
"wrinkles.\nStrongly affects VRAM usage.",
datatype=str,
choices=["lowmem", "fair", "best"],
group="settings",
gui_radio=True,
fixed=True,
),
details=dict(
default="good",
info="Defines detail fidelity. Lower setting can appear 'rugged' while 'good' might take "
"a longer time to train.\nAffects VRAM usage.",
datatype=str,
choices=["fast", "good"],
group="settings",
gui_radio=True,
fixed=True,
),
output_size=dict(
default=256,
info="Output image resolution (in pixels).\nBe aware that larger resolution will increase "
"VRAM requirements.\nNB: Must be either 128, 256, or 384.",
datatype=int,
rounding=128,
min_max=(128, 384),
choices=[],
group="settings",
gui_radio=False,
fixed=True,
),
)

0 comments on commit 11009bf

Please sign in to comment.