1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-13 16:07:36 +00:00

ui: Remove explicit can-focus

Glade misleads us into thinking we need these, but the
property is somewhat confusing in GTK3. In general we don't
want `can-focus` to be true for containers, as that will
break keynav for the children. For non-containers, the
defaults are appropriate.

Instead of manually setting `can-focus`, we should just
use the default values. GTK has sane defaults.

Fixes https://gitlab.gnome.org/GNOME/calls/-/issues/366
This commit is contained in:
Christopher Davis 2021-11-30 11:52:36 -08:00
parent 3e22ef8c74
commit 50847dfe43
9 changed files with 0 additions and 59 deletions

View file

@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.20"/>
<template class="CallsCallRecordRow" parent="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
<child>
@ -13,11 +12,9 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="HdyAvatar" id="avatar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">8</property>
<property name="margin_top">8</property>
<property name="margin_bottom">8</property>
@ -32,7 +29,6 @@
<child>
<object class="GtkImage" id="type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">8</property>
</object>
<packing>
@ -42,7 +38,6 @@
<child>
<object class="GtkLabel" id="target">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
<property name="ellipsize">middle</property>
</object>
@ -83,7 +78,6 @@
<child>
<object class="GtkLabel" id="time">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">8</property>
<property name="justify">right</property>
<style>

View file

@ -4,29 +4,24 @@
<requires lib="gtk+" version="3.20"/>
<template class="CallsCallSelectorItem" parent="GtkEventBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_window">False</property>
<property name="above_child">True</property>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkBox" id="main_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">3</property>
<property name="label">+441234567890</property>
</object>
@ -39,7 +34,6 @@
<child>
<object class="GtkLabel" id="status">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">3</property>
<property name="label" translatable="yes">On hold</property>
</object>

View file

@ -3,7 +3,6 @@
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="CallsCallWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<!-- <property name="decorated">False</property> -->
<property name="hide_titlebar_when_maximized">True</property>
<property name="show_menubar">False</property>
@ -12,30 +11,24 @@
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child type="overlay">
<object class="CallsInAppNotification" id="in_app_notification">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkStack" id="main_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkFlowBox" id="call_selector">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<property name="column_spacing">12</property>
@ -54,7 +47,6 @@
<child>
<object class="GtkStack" id="call_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
</object>
<packing>
@ -68,12 +60,10 @@
<child type="titlebar">
<object class="GtkStack" id="header_bar_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_child_name" bind-source="main_stack" bind-property="visible_child_name" bind-flags="bidirectional|sync-create"/>
<child>
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="name">calls</property>
@ -82,18 +72,15 @@
<child>
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="show_calls">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<signal name="clicked" handler="show_calls_clicked_cb" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">system-switch-user-symbolic</property>
</object>
</child>

View file

@ -5,20 +5,16 @@
<requires lib="libhandy" version="0.0"/>
<template class="CallsContactsBox" parent="GtkBin">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expand">True</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="margin-top">12</property>
@ -28,7 +24,6 @@
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
</child>
<child>
@ -37,11 +32,9 @@
<child>
<object class="GtkListBox" id="contacts_listbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child type="placeholder">
<object class="GtkBox" id="placeholder_empty">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
@ -51,7 +44,6 @@
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixel_size">128</property>
<property name="icon_name">edit-find-symbolic</property>
<style>
@ -62,7 +54,6 @@
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="wrap-mode">word-char</property>
<property name="justify">center</property>

View file

@ -16,16 +16,13 @@
<child>
<object class="GtkScrolledWindow">
<property name="can_focus">False</property>
<property name="visible">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyClamp">
<property name="can_focus">False</property>
<property name="visible">True</property>
<child>
<object class="GtkListBox" id="history">
<property name="can_focus">False</property>
<property name="visible">True</property>
<property name="margin">12</property>
<property name="valign">start</property>

View file

@ -9,17 +9,14 @@
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="calls_in_app_notification_hide" swapped="yes"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">window-close-symbolic</property>
</object>
</child>
@ -34,7 +31,6 @@
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="wrap">True</property>
<property name="margin-left">24</property>
<property name="margin-right">24</property>

View file

@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsMainWindow" parent="HdyApplicationWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Calls</property>
<property name="hide_titlebar_when_maximized">True</property>
<property name="show_menubar">False</property>
@ -17,13 +16,11 @@
<object class="HdyHeaderBar">
<property name="visible">True</property>
<property name="centering_policy">strict</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
<child type="title">
<object class="HdyViewSwitcherTitle" id="title_switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">main_stack</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
</object>
@ -31,12 +28,10 @@
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="popover">menu_popover</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
</child>
@ -50,29 +45,24 @@
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child type="overlay">
<object class="CallsInAppNotification" id="in_app_notification">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkRevealer" id="permanent_error_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="reveal_child">True</property>
<child>
<object class="GtkLabel" id="permanent_error_label">
<property name="justify">center</property>
<property name="wrap">True</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="error-state-message"/>
</style>
@ -83,7 +73,6 @@
<child>
<object class="GtkStack" id="main_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">False</property>
<property name="expand">True</property>
</object>
@ -91,7 +80,6 @@
<child>
<object class="HdyViewSwitcherBar" id="switcher_bar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">main_stack</property>
<property name="reveal" bind-source="title_switcher" bind-property="title-visible" bind-flags="sync-create"/>
</object>
@ -218,7 +206,6 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="can_focus">False</property>
<property name="margin">12</property>
<property name="spacing">6</property>
<child>

View file

@ -4,7 +4,6 @@
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsNewCallBox" parent="GtkBox">
<property name="can_focus">False</property>
<property name="margin_bottom">16</property>
<property name="margin_left">24</property>
<property name="margin_right">24</property>
@ -81,12 +80,10 @@
<child>
<object class="GtkBox">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create"/>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<child type="center">
<object class="GtkButton" id="dial">
<property name="always_show_image">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="visible">True</property>
<signal name="clicked" handler="dial_clicked_cb" swapped="yes"/>

View file

@ -2,7 +2,6 @@
<interface>
<requires lib="gtk+" version="3.22"/>
<template class="CallsNewCallHeaderBar" parent="GtkHeaderBar">
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
<property name="title" translatable="yes">New Call</property>
<property name="visible">True</property>
@ -34,7 +33,6 @@
</child>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="can_focus">False</property>
<property name="visible">True</property>
</object>
</child>