Skip to content

Commit

Permalink
[2095] Standardize vertical Padding
Browse files Browse the repository at this point in the history
- Standardizes vertical Padding.
- Fixes issues with the disabled and outdated Plugin list.
- Part of EDCD#2095
  • Loading branch information
Phoebe committed Nov 17, 2023
1 parent e878453 commit 8063cf0
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 108 deletions.
2 changes: 1 addition & 1 deletion plugins/coriolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr
# LANG: Settings>Coriolis: Help/hint for changing coriolis URLs
nb.Label(conf_frame, text=_(
"Set the URL to use with coriolis.io ship loadouts. Note that this MUST end with '/import?data='"
)).grid(sticky=tk.EW, row=cur_row, column=0, columnspan=3)
)).grid(sticky=tk.EW, row=cur_row, column=0, padx=PADX, columnspan=3)
cur_row += 1

# LANG: Settings>Coriolis: Label for 'NOT alpha/beta game version' URL
Expand Down
7 changes: 4 additions & 3 deletions plugins/eddn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
"""
PADX = 10 # noqa: N806
BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons
PADY = 2

Check warning on line 2092 in plugins/eddn.py

View workflow job for this annotation

GitHub Actions / push_checks

N806 variable 'PADY' in function should be lowercase

if prefsVersion.shouldSetDefaults('0.0.0.0', not bool(config.get_int('output'))):
output: int = config.OUT_EDDN_SEND_STATION_DATA | config.OUT_EDDN_SEND_NON_STATION # default settings
Expand Down Expand Up @@ -2116,7 +2117,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
variable=this.eddn_station,
command=prefsvarchanged
) # Output setting
this.eddn_station_button.grid(row=cur_row, padx=BUTTONX, pady=(5, 0), sticky=tk.W)
this.eddn_station_button.grid(row=cur_row, padx=BUTTONX, pady=PADY, sticky=tk.W)
cur_row += 1

this.eddn_system = tk.IntVar(value=(output & config.OUT_EDDN_SEND_NON_STATION) and 1)
Expand All @@ -2128,7 +2129,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
variable=this.eddn_system,
command=prefsvarchanged
)
this.eddn_system_button.grid(row=cur_row, padx=BUTTONX, pady=(5, 0), sticky=tk.W)
this.eddn_system_button.grid(row=cur_row, padx=BUTTONX, pady=PADY, sticky=tk.W)
cur_row += 1

this.eddn_delay = tk.IntVar(value=(output & config.OUT_EDDN_DELAY) and 1)
Expand All @@ -2139,7 +2140,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
text=_('Delay sending until docked'),
variable=this.eddn_delay
)
this.eddn_delay_button.grid(row=cur_row, padx=BUTTONX, sticky=tk.W)
this.eddn_delay_button.grid(row=cur_row, padx=BUTTONX, pady=PADY, sticky=tk.W)

return eddnframe

Expand Down
5 changes: 4 additions & 1 deletion plugins/edsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr
PADX = 10 # noqa: N806
BUTTONX = 12 # noqa: N806
PADY = 2 # noqa: N806
SEPY = 10 # noqa: N806

Check failure on line 297 in plugins/edsm.py

View workflow job for this annotation

GitHub Actions / push_checks

E261 at least two spaces before inline comment

frame = nb.Frame(parent)
frame.columnconfigure(1, weight=1)
Expand All @@ -319,7 +320,9 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr
this.log_button.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W)
cur_row += 1

nb.Label(frame).grid(row=cur_row, sticky=tk.W) # big spacer
ttk.Separator(frame, orient=tk.HORIZONTAL).grid(
columnspan=2, padx=PADX, pady=SEPY, sticky=tk.EW, row=cur_row
)
cur_row += 1

this.label = HyperlinkLabel(
Expand Down
23 changes: 13 additions & 10 deletions plugins/inara.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,18 @@ def toggle_password_visibility():

def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
"""Plugin Preferences UI hook."""
x_padding = 10
x_button_padding = 12 # indent Checkbuttons and Radiobuttons
y_padding = 2 # close spacing
PADX = 10

Check warning on line 250 in plugins/inara.py

View workflow job for this annotation

GitHub Actions / push_checks

N806 variable 'PADX' in function should be lowercase
BUTTONX = 12 # indent Checkbuttons and Radiobuttons

Check warning on line 251 in plugins/inara.py

View workflow job for this annotation

GitHub Actions / push_checks

N806 variable 'BUTTONX' in function should be lowercase
PADY = 2 # close spacing

Check warning on line 252 in plugins/inara.py

View workflow job for this annotation

GitHub Actions / push_checks

N806 variable 'PADY' in function should be lowercase
SEPY = 10 # seperator line spacing

Check warning on line 253 in plugins/inara.py

View workflow job for this annotation

GitHub Actions / push_checks

N806 variable 'SEPY' in function should be lowercase
cur_row = 0

frame = nb.Frame(parent)
frame.columnconfigure(1, weight=1)

HyperlinkLabel(
frame, text='Inara', background=nb.Label().cget('background'), url='https://inara.cz/', underline=True
).grid(row=cur_row, columnspan=2, padx=x_padding, sticky=tk.W) # Don't translate
).grid(row=cur_row, columnspan=2, padx=PADX, sticky=tk.W) # Don't translate
cur_row += 1

this.log = tk.IntVar(value=config.get_int('inara_out') and 1)
Expand All @@ -268,10 +269,12 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
command=prefsvarchanged
)

this.log_button.grid(row=cur_row, columnspan=2, padx=x_button_padding, pady=(5, 0), sticky=tk.W)
this.log_button.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W)
cur_row += 1

nb.Label(frame).grid(row=cur_row, sticky=tk.W) # big spacer
ttk.Separator(frame, orient=tk.HORIZONTAL).grid(
columnspan=2, padx=PADX, pady=SEPY, sticky=tk.EW, row=cur_row
)
cur_row += 1

# Section heading in settings
Expand All @@ -283,14 +286,14 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
underline=True
)

this.label.grid(row=cur_row, columnspan=2, padx=x_padding, sticky=tk.W)
this.label.grid(row=cur_row, columnspan=2, padx=PADX, sticky=tk.W)
cur_row += 1

# LANG: Inara API key label
this.apikey_label = nb.Label(frame, text=_('API Key')) # Inara setting
this.apikey_label.grid(row=cur_row, padx=x_padding, sticky=tk.W)
this.apikey_label.grid(row=cur_row, padx=PADX, sticky=tk.W)
this.apikey = nb.Entry(frame, show="*", width=50)
this.apikey.grid(row=cur_row, column=1, padx=x_padding, pady=y_padding, sticky=tk.EW)
this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW)
cur_row += 1

prefs_cmdr_changed(cmdr, is_beta)
Expand All @@ -302,7 +305,7 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame:
variable=show_password_var,
command=toggle_password_visibility,
)
show_password_checkbox.grid(row=cur_row, columnspan=2, padx=x_padding, pady=(5, 0), sticky=tk.W)
show_password_checkbox.grid(row=cur_row, columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W)

return frame

Expand Down
Loading

0 comments on commit 8063cf0

Please sign in to comment.