From 262d6a6e7a99c93bd29983bc9ec040c922fe4d37 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 8 Jul 2022 10:33:05 -0300 Subject: [PATCH] project: Remove most can-focus properties In GTK4, can-focus usage is much more specific to widget subclasses, and in almost all cases it's not necessary to set it. Remove it everywhere, except in one case where it still needs to be manually set to False. --- libmalcontent-ui/user-controls.ui | 3 --- malcontent-control/application.c | 7 +------ malcontent-control/carousel.ui | 5 +---- malcontent-control/main.ui | 3 --- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/libmalcontent-ui/user-controls.ui b/libmalcontent-ui/user-controls.ui index 3e452cf..96d38de 100644 --- a/libmalcontent-ui/user-controls.ui +++ b/libmalcontent-ui/user-controls.ui @@ -36,7 +36,6 @@ 0 - True end center @@ -85,7 +84,6 @@ 0 - True end center @@ -106,7 +104,6 @@ 0 - True end center right diff --git a/malcontent-control/application.c b/malcontent-control/application.c index b327ad5..89e7541 100644 --- a/malcontent-control/application.c +++ b/malcontent-control/application.c @@ -427,12 +427,7 @@ update_main_stack (MctApplication *self) gtk_stack_set_visible_child_name (self->main_stack, new_page_name); if (new_focus_widget != NULL && !g_str_equal (old_page_name, new_page_name)) - { - if (gtk_widget_get_can_focus (new_focus_widget)) - gtk_widget_grab_focus (new_focus_widget); - else - gtk_widget_child_focus (new_focus_widget, GTK_DIR_TAB_FORWARD); - } + gtk_widget_grab_focus (new_focus_widget); } static void diff --git a/malcontent-control/carousel.ui b/malcontent-control/carousel.ui index 02a4992..4e03dad 100644 --- a/malcontent-control/carousel.ui +++ b/malcontent-control/carousel.ui @@ -28,14 +28,12 @@ False - True center - False 4 go-previous-symbolic @@ -53,14 +51,12 @@ - True center - False 4 go-next-symbolic @@ -80,6 +76,7 @@ + False GTK_ALIGN_END