Skip to content

Commit b5c0e39

Browse files
committed
fix: add accessible names to quiet hours spin controls, voice choice, and rate slider
Adds SetName() calls so screen readers announce meaningful labels instead of just 'spin control' or raw values. Closes #21
1 parent 03347c7 commit b5c0e39

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/accessiclock/ui/dialogs/settings_dialog.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def _create_voice_tab(self, parent: wx.Notebook) -> wx.Panel:
162162
voices = ["(Default system voice)"]
163163

164164
self.voice_choice = wx.Choice(panel, choices=voices)
165+
self.voice_choice.SetName("Voice")
165166
self.voice_choice.SetSelection(0)
166167
sizer.Add(self.voice_choice, 0, wx.EXPAND | wx.ALL, 10)
167168

@@ -174,6 +175,7 @@ def _create_voice_tab(self, parent: wx.Notebook) -> wx.Panel:
174175
panel, value=150, minValue=50, maxValue=300,
175176
style=wx.SL_HORIZONTAL | wx.SL_VALUE_LABEL
176177
)
178+
self.rate_slider.SetName("Speech rate")
177179
rate_sizer.Add(self.rate_slider, 1, wx.EXPAND)
178180
sizer.Add(rate_sizer, 0, wx.EXPAND | wx.ALL, 10)
179181

@@ -226,6 +228,7 @@ def _create_quiet_hours_tab(self, parent: wx.Notebook) -> wx.Panel:
226228
self.quiet_start_hour = wx.SpinCtrl(
227229
panel, min=0, max=23, initial=22, size=(60, -1)
228230
)
231+
self.quiet_start_hour.SetName("Quiet hours start hour")
229232
start_sizer.Add(self.quiet_start_hour, 0, wx.RIGHT, 5)
230233

231234
start_colon = wx.StaticText(panel, label=":")
@@ -234,6 +237,7 @@ def _create_quiet_hours_tab(self, parent: wx.Notebook) -> wx.Panel:
234237
self.quiet_start_min = wx.SpinCtrl(
235238
panel, min=0, max=59, initial=0, size=(60, -1)
236239
)
240+
self.quiet_start_min.SetName("Quiet hours start minute")
237241
start_sizer.Add(self.quiet_start_min, 0)
238242

239243
time_sizer.Add(start_sizer, 0, wx.ALL, 5)
@@ -246,6 +250,7 @@ def _create_quiet_hours_tab(self, parent: wx.Notebook) -> wx.Panel:
246250
self.quiet_end_hour = wx.SpinCtrl(
247251
panel, min=0, max=23, initial=7, size=(60, -1)
248252
)
253+
self.quiet_end_hour.SetName("Quiet hours end hour")
249254
end_sizer.Add(self.quiet_end_hour, 0, wx.RIGHT, 5)
250255

251256
end_colon = wx.StaticText(panel, label=":")
@@ -254,6 +259,7 @@ def _create_quiet_hours_tab(self, parent: wx.Notebook) -> wx.Panel:
254259
self.quiet_end_min = wx.SpinCtrl(
255260
panel, min=0, max=59, initial=0, size=(60, -1)
256261
)
262+
self.quiet_end_min.SetName("Quiet hours end minute")
257263
end_sizer.Add(self.quiet_end_min, 0)
258264

259265
time_sizer.Add(end_sizer, 0, wx.ALL, 5)

0 commit comments

Comments
 (0)