Skip to content

Commit cfa97dc

Browse files
authored
fix(a11y): add colons to file list and toolbar field labels (#108)
* fix(a11y): add colons to local/remote file list labels and toolbar field labels - 'Local Files' → 'Local:' / 'Remote Files' → 'Remote:' (StaticText + SetLabel) - Toolbar fields now read 'Protocol:', 'Host:', 'Port:', 'Username:', 'Password:' (both StaticText label and SetName) * test: update toolbar label assertions to include colons
1 parent d658ac5 commit cfa97dc

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/portkeydrop/app.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,38 +244,38 @@ def _bind_label(lbl: wx.StaticText, ctrl: wx.Window) -> None:
244244
if hasattr(lbl, "SetLabelFor"):
245245
lbl.SetLabelFor(ctrl)
246246

247-
protocol_lbl = wx.StaticText(toolbar_panel, label="&Protocol")
247+
protocol_lbl = wx.StaticText(toolbar_panel, label="&Protocol:")
248248
self.tb_protocol = wx.Choice(toolbar_panel, choices=["sftp", "ftp", "ftps"])
249249
self.tb_protocol.SetSelection(0)
250-
self.tb_protocol.SetName("Protocol")
250+
self.tb_protocol.SetName("Protocol:")
251251
_bind_label(protocol_lbl, self.tb_protocol)
252252
sizer.Add(protocol_lbl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
253253
sizer.Add(self.tb_protocol, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
254254

255-
host_lbl = wx.StaticText(toolbar_panel, label="&Host")
255+
host_lbl = wx.StaticText(toolbar_panel, label="&Host:")
256256
self.tb_host = wx.TextCtrl(toolbar_panel, size=(150, -1))
257-
self.tb_host.SetName("Host")
257+
self.tb_host.SetName("Host:")
258258
_bind_label(host_lbl, self.tb_host)
259259
sizer.Add(host_lbl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 8)
260260
sizer.Add(self.tb_host, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
261261

262-
port_lbl = wx.StaticText(toolbar_panel, label="P&ort")
262+
port_lbl = wx.StaticText(toolbar_panel, label="P&ort:")
263263
self.tb_port = wx.TextCtrl(toolbar_panel, value="22", size=(50, -1))
264-
self.tb_port.SetName("Port")
264+
self.tb_port.SetName("Port:")
265265
_bind_label(port_lbl, self.tb_port)
266266
sizer.Add(port_lbl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 8)
267267
sizer.Add(self.tb_port, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
268268

269-
username_lbl = wx.StaticText(toolbar_panel, label="&Username")
269+
username_lbl = wx.StaticText(toolbar_panel, label="&Username:")
270270
self.tb_username = wx.TextCtrl(toolbar_panel, size=(100, -1))
271-
self.tb_username.SetName("Username")
271+
self.tb_username.SetName("Username:")
272272
_bind_label(username_lbl, self.tb_username)
273273
sizer.Add(username_lbl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 8)
274274
sizer.Add(self.tb_username, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
275275

276-
password_lbl = wx.StaticText(toolbar_panel, label="Pass&word")
276+
password_lbl = wx.StaticText(toolbar_panel, label="Pass&word:")
277277
self.tb_password = wx.TextCtrl(toolbar_panel, size=(100, -1), style=wx.TE_PASSWORD)
278-
self.tb_password.SetName("Password")
278+
self.tb_password.SetName("Password:")
279279
_bind_label(password_lbl, self.tb_password)
280280
sizer.Add(password_lbl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 8)
281281
sizer.Add(self.tb_password, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 4)
@@ -297,7 +297,7 @@ def _build_dual_pane(self) -> None:
297297
local_panel = wx.Panel(pane_container)
298298
local_sizer = wx.BoxSizer(wx.VERTICAL)
299299

300-
local_label = wx.StaticText(local_panel, label="Local Files")
300+
local_label = wx.StaticText(local_panel, label="Local:")
301301
local_sizer.Add(local_label, 0, wx.LEFT | wx.TOP, 4)
302302

303303
self.local_path_bar = wx.TextCtrl(
@@ -307,7 +307,7 @@ def _build_dual_pane(self) -> None:
307307
local_sizer.Add(self.local_path_bar, 0, wx.EXPAND | wx.ALL, 2)
308308

309309
self.local_file_list = wx.ListCtrl(local_panel, style=wx.LC_REPORT | wx.LC_SINGLE_SEL)
310-
self.local_file_list.SetLabel("Local Files")
310+
self.local_file_list.SetLabel("Local:")
311311
self.local_file_list.InsertColumn(0, "Name", width=200)
312312
self.local_file_list.InsertColumn(1, "Size", width=80)
313313
self.local_file_list.InsertColumn(2, "Type", width=70)
@@ -320,15 +320,15 @@ def _build_dual_pane(self) -> None:
320320
remote_panel = wx.Panel(pane_container)
321321
remote_sizer = wx.BoxSizer(wx.VERTICAL)
322322

323-
remote_label = wx.StaticText(remote_panel, label="Remote Files")
323+
remote_label = wx.StaticText(remote_panel, label="Remote:")
324324
remote_sizer.Add(remote_label, 0, wx.LEFT | wx.TOP, 4)
325325

326326
self.remote_path_bar = wx.TextCtrl(remote_panel, value="/", style=wx.TE_PROCESS_ENTER)
327327
self.remote_path_bar.SetName("Remote Path")
328328
remote_sizer.Add(self.remote_path_bar, 0, wx.EXPAND | wx.ALL, 2)
329329

330330
self.remote_file_list = wx.ListCtrl(remote_panel, style=wx.LC_REPORT | wx.LC_SINGLE_SEL)
331-
self.remote_file_list.SetLabel("Remote Files")
331+
self.remote_file_list.SetLabel("Remote:")
332332
self.remote_file_list.InsertColumn(0, "Name", width=200)
333333
self.remote_file_list.InsertColumn(1, "Size", width=80)
334334
self.remote_file_list.InsertColumn(2, "Type", width=70)

tests/test_app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,11 @@ def SetLabelFor(self, control):
662662
app.MainFrame._build_toolbar(frame)
663663

664664
assert [label.label for label in created_labels[:5]] == [
665-
"&Protocol",
666-
"&Host",
667-
"P&ort",
668-
"&Username",
669-
"Pass&word",
665+
"&Protocol:",
666+
"&Host:",
667+
"P&ort:",
668+
"&Username:",
669+
"Pass&word:",
670670
]
671671
assert created_labels[0]._label_for is frame.tb_protocol
672672
assert created_labels[1]._label_for is frame.tb_host

0 commit comments

Comments
 (0)