feat(a11y): keyboard navigation

This commit is contained in:
Evangelos Paterakis 2022-12-29 21:05:03 +02:00
parent a181b60843
commit 85064950c6
No known key found for this signature in database
GPG Key ID: FE5185F095BFC8C9
5 changed files with 4 additions and 26 deletions

View File

@ -42,7 +42,6 @@
<property name="sensitive">0</property>
<child>
<object class="GtkSwitch" id="multiple_columns">
<property name="can_focus">0</property>
<property name="valign">center</property>
</object>
</child>
@ -77,7 +76,6 @@
<property name="sensitive">0</property>
<child>
<object class="GtkSwitch" id="autostart">
<property name="can_focus">0</property>
<property name="valign">center</property>
</object>
</child>
@ -142,7 +140,6 @@
<child>
<object class="AdwActionRow">
<property name="sensitive" bind-source="live_updates" bind-property="state" bind-flags="sync-create"/>
<property name="can_focus">True</property>
<property name="title" translatable="yes">Stream public timelines</property>
<property name="activatable_widget">public_live_updates</property>
<property name="subtitle" translatable="yes">Warning: This will increase memory usage</property>
@ -155,7 +152,6 @@
</child>
<child>
<object class="AdwActionRow">
<property name="can_focus">True</property>
<property name="title" translatable="yes">Reveal spoilers by default</property>
<property name="activatable_widget">show_spoilers</property>
<child>

View File

@ -32,7 +32,6 @@
<object class="AdwClamp" id="clamp">
<property name="vexpand">1</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="maximum_size">670</property>
<property name="tightening_threshold">670</property>
<child>

View File

@ -2,10 +2,8 @@
<interface>
<requires lib="gtk" version="4.0"/>
<template class="ToothWidgetsStatus" parent="GtkListBoxRow">
<property name="can_focus">0</property>
<property name="child">
<object class="GtkGrid" id="grid">
<property name="can_focus">0</property>
<property name="margin-start">8</property>
<property name="margin-end">8</property>
<property name="margin_top">8</property>
@ -42,13 +40,11 @@
</child>
<child>
<object class="GtkGrid">
<property name="can_focus">0</property>
<property name="vexpand">1</property>
<property name="row_homogeneous">1</property>
<child>
<object class="ToothWidgetsRichLabelContainer" id="name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<!-- <property name="label" translatable="no">Name</property> -->
<!-- <property name="ellipsize">end</property> -->
@ -65,7 +61,6 @@
</child>
<child>
<object class="GtkLabel" id="handle_label">
<property name="can_focus">0</property>
<property name="label" translatable="no">Handle</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">1</property>
@ -83,7 +78,6 @@
</child>
<child>
<object class="GtkBox" id="indicators">
<property name="can_focus">0</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="margin_start">6</property>
@ -91,7 +85,6 @@
<child>
<object class="GtkImage" id="indicator">
<property name="visible">1</property>
<property name="can_focus">0</property>
<property name="icon_name">unknown</property>
<property name="icon_size">1</property>
<style>
@ -102,7 +95,6 @@
<child>
<object class="GtkImage" id="pin_indicator">
<property name="visible">0</property>
<property name="can_focus">0</property>
<property name="icon_name">tooth-pin-symbolic</property>
<property name="icon_size">1</property>
<property name="tooltip_text" translatable="yes">Pinned</property>
@ -114,7 +106,6 @@
<child>
<object class="GtkImage" id="edited_indicator">
<property name="visible">0</property>
<property name="can_focus">0</property>
<property name="icon_name">tooth-edit-symbolic</property>
<property name="icon_size">1</property>
<property name="tooltip_text" translatable="yes">Edited</property>
@ -125,7 +116,6 @@
</child>
<child>
<object class="GtkLabel" id="date_label">
<property name="can_focus">0</property>
<property name="label" translatable="no">Yesterday</property>
<property name="xalign">0</property>
<style>
@ -149,7 +139,6 @@
</child>
<child>
<object class="GtkBox" id="content_column">
<property name="can_focus">0</property>
<property name="margin_top">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
@ -160,7 +149,6 @@
<property name="spacing">6</property>
<child>
<object class="GtkImage">
<property name="can_focus">0</property>
<property name="icon_name">tooth-warning-symbolic</property>
</object>
</child>
@ -177,7 +165,6 @@
</child>
<child>
<object class="GtkStack" id="spoiler_stack">
<property name="can_focus">0</property>
<property name="vhomogeneous">0</property>
<property name="hhomogeneous">0</property>
<property name="transition_type">crossfade</property>
@ -192,7 +179,6 @@
<signal name="clicked" handler="toggle_spoiler" swapped="no"/>
<child>
<object class="GtkBox">
<property name="can_focus">0</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin_top">12</property>
@ -200,14 +186,12 @@
<property name="spacing">6</property>
<child>
<object class="GtkImage">
<property name="can_focus">0</property>
<property name="icon_name">tooth-warning-symbolic</property>
</object>
</child>
<child>
<object class="ToothWidgetsRichLabel" id="spoiler_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">Spoiler Text Here</property>
</object>
</child>
@ -225,13 +209,11 @@
<property name="name">content</property>
<property name="child">
<object class="GtkBox" id="content_box">
<property name="can_focus">0</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="ToothWidgetsMarkupView" id="content">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
</child>

View File

@ -14,8 +14,7 @@ public class Tooth.Views.ContentBase : Views.Base {
model.items_changed.connect (() => on_content_changed ());
content = new ListBox () {
selection_mode = SelectionMode.NONE,
can_focus = false
selection_mode = SelectionMode.NONE
};
content_box.append (content);
content.add_css_class ("content");

View File

@ -24,7 +24,9 @@ public class Tooth.Widgets.Attachment.Item : Adw.Bin {
badge.add_css_class ("osd");
badge.add_css_class ("heading");
overlay = new Overlay ();
overlay = new Overlay () {
can_focus = false // Double focus on overlay and button
};
overlay.child = button;
overlay.add_overlay (badge);