From ffb2aaabe75247373c79019ac58785dafb022b34 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Sun, 12 Feb 2017 13:34:50 +0100 Subject: [PATCH] user-accounts: Drop the user photo selector arrow https://bugzilla.gnome.org/show_bug.cgi?id=778458 --- panels/user-accounts/um-photo-dialog.c | 6 --- panels/user-accounts/um-utils.c | 56 -------------------------- panels/user-accounts/um-utils.h | 7 ---- 3 files changed, 69 deletions(-) diff --git a/panels/user-accounts/um-photo-dialog.c b/panels/user-accounts/um-photo-dialog.c index 2ff11a327..7feed255e 100644 --- a/panels/user-accounts/um-photo-dialog.c +++ b/panels/user-accounts/um-photo-dialog.c @@ -541,12 +541,6 @@ popup_button_draw (GtkWidget *widget, !gtk_widget_is_focus (widget)) { return; } - - down_arrow (gtk_widget_get_style_context (widget), - cr, - gtk_widget_get_allocated_width (widget) - 12, - gtk_widget_get_allocated_height (widget) - 12, - 12, 12); } static void diff --git a/panels/user-accounts/um-utils.c b/panels/user-accounts/um-utils.c index 94c940a77..72eada438 100644 --- a/panels/user-accounts/um-utils.c +++ b/panels/user-accounts/um-utils.c @@ -404,62 +404,6 @@ rounded_rectangle (cairo_t *cr, cairo_close_path (cr); } -void -down_arrow (GtkStyleContext *context, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height) -{ - GtkStateFlags flags; - GdkRGBA fg_color; - gdouble vertical_overshoot; - gint diameter; - gdouble radius; - gdouble x_double, y_double; - gdouble angle; - gint line_width; - - flags = gtk_style_context_get_state (context); - - gtk_style_context_get_color (context, flags, &fg_color); - - line_width = 1; - angle = G_PI / 2; - vertical_overshoot = line_width / 2.0 * (1. / tan (G_PI / 8)); - if (line_width % 2 == 1) - vertical_overshoot = ceil (0.5 + vertical_overshoot) - 0.5; - else - vertical_overshoot = ceil (vertical_overshoot); - diameter = (gint) MAX (3, width - 2 * vertical_overshoot); - diameter -= (1 - (diameter + line_width) % 2); - radius = diameter / 2.; - x_double = floor ((x + width / 2) - (radius + line_width) / 2.) + (radius + line_width) / 2.; - - y_double = (y + height / 2) - 0.5; - - cairo_save (cr); - - cairo_translate (cr, x_double, y_double); - cairo_rotate (cr, angle); - - cairo_move_to (cr, - radius / 2., - radius); - cairo_line_to (cr, radius / 2., 0); - cairo_line_to (cr, - radius / 2., radius); - - cairo_close_path (cr); - - cairo_set_line_width (cr, line_width); - - gdk_cairo_set_source_rgba (cr, &fg_color); - - cairo_fill_preserve (cr); - cairo_stroke (cr); - - cairo_restore (cr); -} - static guint get_login_name_max (void) { diff --git a/panels/user-accounts/um-utils.h b/panels/user-accounts/um-utils.h index bb328da81..fb405a08f 100644 --- a/panels/user-accounts/um-utils.h +++ b/panels/user-accounts/um-utils.h @@ -59,13 +59,6 @@ void rounded_rectangle (cairo_t *cr, gdouble width, gdouble height); -void down_arrow (GtkStyleContext *context, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height); - gboolean is_valid_name (const gchar *name); gboolean is_valid_username (const gchar *name, gchar **tip);