From 889913deba44353982eec693d413cb13d5394997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 May 2023 16:54:47 +0200 Subject: [PATCH 1/5] lockscreen: Remove superfluous can-focus properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Labels, clamps and boxes are unfocusable by default Signed-off-by: Guido Günther Part-of: --- src/ui/lockscreen.ui | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/ui/lockscreen.ui b/src/ui/lockscreen.ui index 1f754cde0..b9fce86bb 100644 --- a/src/ui/lockscreen.ui +++ b/src/ui/lockscreen.ui @@ -76,17 +76,14 @@ True vertical - False True True - False vertical True - False end 6 32 @@ -105,7 +102,6 @@ True - False 32 swipe-arrow-symbolic - - False - True - end - -- GitLab From b685c957c5fcb3ae32b429d7aad9168b3b93be44 Mon Sep 17 00:00:00 2001 From: Suraj Kumar Mahto Date: Fri, 12 May 2023 16:51:39 +0200 Subject: [PATCH 3/5] lockscreen: Remove currently unused emergency call button Emergency calls are reachable via long press. We'll look into adding a button right on the lock screen once the feature is deemded stable and hence enabled by default. Part-of: --- src/lockscreen.c | 2 -- src/ui/lockscreen.ui | 16 +--------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/lockscreen.c b/src/lockscreen.c index 7b60f3840..200cdb301 100644 --- a/src/lockscreen.c +++ b/src/lockscreen.c @@ -98,7 +98,6 @@ typedef struct { GtkGesture *long_press_del_gesture; GtkWidget *lbl_unlock_status; GtkWidget *btn_submit; - GtkWidget *btn_emergency; guint idle_timer; gint64 last_input; PhoshAuth *auth; @@ -861,7 +860,6 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass) gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, lbl_unlock_status); gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, long_press_del_gesture); gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, btn_submit); - gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, btn_emergency); gtk_widget_class_bind_template_callback (widget_class, long_press_del_cb); gtk_widget_class_bind_template_callback (widget_class, delete_button_clicked_cb); diff --git a/src/ui/lockscreen.ui b/src/ui/lockscreen.ui index 95d58f825..49c31e354 100644 --- a/src/ui/lockscreen.ui +++ b/src/ui/lockscreen.ui @@ -265,21 +265,7 @@ 16 16 center - - - False - Emergency - - - - False - True - start - - + True -- GitLab From 06ed3e8137a9ac463781a2394adb74da5914e17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 May 2023 18:55:34 +0200 Subject: [PATCH 4/5] layersurface: Add noop implementation for configure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This frees deriving classes from checking for NULL Signed-off-by: Guido Günther Part-of: --- src/layersurface.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/layersurface.c b/src/layersurface.c index 12d855885..bbc264cb4 100644 --- a/src/layersurface.c +++ b/src/layersurface.c @@ -348,6 +348,13 @@ phosh_layer_surface_unmap (GtkWidget *widget) } +static void +phosh_layer_surface_configured_impl (PhoshLayerSurface *layer_surface) +{ + /* Nothing todo here */ +} + + static void phosh_layer_surface_dispose (GObject *object) { @@ -366,6 +373,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass) { GObjectClass *object_class = (GObjectClass *)klass; GtkWidgetClass *widget_class = (GtkWidgetClass *)klass; + PhoshLayerSurfaceClass *layer_surface_class = PHOSH_LAYER_SURFACE_CLASS (klass); object_class->dispose = phosh_layer_surface_dispose; object_class->set_property = phosh_layer_surface_set_property; @@ -375,6 +383,8 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass) widget_class->map = phosh_layer_surface_map; widget_class->unmap = phosh_layer_surface_unmap; + layer_surface_class->configured = phosh_layer_surface_configured_impl; + props[PHOSH_LAYER_SURFACE_PROP_LAYER_SHELL] = g_param_spec_pointer ( "layer-shell", -- GitLab From b6002d32b1616956fa34389c6c6f6cf9b49ebef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 May 2023 18:55:35 +0200 Subject: [PATCH 5/5] lockscreen: Drop the top margin on smaller displays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to keep the keypad's box center aligned. Signed-off-by: Guido Günther Part-of: --- src/lockscreen.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/lockscreen.c b/src/lockscreen.c index 200cdb301..07e985cd0 100644 --- a/src/lockscreen.c +++ b/src/lockscreen.c @@ -39,6 +39,8 @@ #define LOCKSCREEN_LARGE_DATE_AND_TIME_CLASS "p-large" #define LOCKSCREEN_SMALL_DATE_AND_TIME_CLASS "p-small" +#define LOCKSCREEN_SMALL_DISPLAY 700 + /** * PhoshLockscreen: * @@ -797,11 +799,34 @@ phosh_lockscreen_dispose (GObject *object) } +static void +phosh_lockscreen_configured (PhoshLayerSurface *layer_surface) +{ + PhoshLockscreen *self = PHOSH_LOCKSCREEN (layer_surface); + PhoshLockscreenPrivate *priv; + guint height, margin = 100; + + g_return_if_fail (PHOSH_IS_LOCKSCREEN (self)); + + priv = phosh_lockscreen_get_instance_private (self); + height = phosh_layer_surface_get_configured_height (layer_surface); + + /* Avoid margin on smaller displays */ + if (height < LOCKSCREEN_SMALL_DISPLAY) + margin = 0; + + gtk_widget_set_margin_top (GTK_WIDGET (priv->box_unlock), margin); + + PHOSH_LAYER_SURFACE_CLASS (phosh_lockscreen_parent_class)->configured (layer_surface); +} + + static void phosh_lockscreen_class_init (PhoshLockscreenClass *klass) { GObjectClass *object_class = (GObjectClass *)klass; GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + PhoshLayerSurfaceClass *layer_surface_class = PHOSH_LAYER_SURFACE_CLASS (klass); object_class->constructed = phosh_lockscreen_constructed; object_class->dispose = phosh_lockscreen_dispose; @@ -809,6 +834,8 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass) object_class->set_property = phosh_lockscreen_set_property; object_class->get_property = phosh_lockscreen_get_property; + layer_surface_class->configured = phosh_lockscreen_configured; + props[PROP_CALLS_MANAGER] = g_param_spec_object ("calls-manager", "", -- GitLab