Some UI tweaking in unlock/switch dialog
- From: Luca Ferretti <elle uca libero it>
- To: screensaver-list gnome org
- Subject: Some UI tweaking in unlock/switch dialog
- Date: Wed, 02 Nov 2005 21:41:53 +0100
Can someone review this patch? Ideas are from
https://wiki.ubuntu.com/ScreenSaver
* Use <big>UserName</big>\n<small>RealName</small> in unlock
dialog (points 2 and 3 in section Unlocking)
* Don't use <big> in "Switch to user" label (point 3 in section
Switching)
* Use <big>UserName</big>\n<small>RealName</small> in switch list
(point 9 in section Switching) [1]
* Reduce fading time to 2 secs. (point 2 in section Post-Breezy)
Please note that:
* 'user(s)' is still here, better IMHO then 'account' [2]
* Access keys (_) are still here, 'cause it's a GNOME HIG and a11y
request
[1] Of course also something like <b>Username</b>\nRealname could be good
[2] Note that account is yet used in Evolution for
POP/IMAP/Exchange/Groupwise stuff. IMHO is better keep if for this
purpose and use 'user' in screensaver/login/switch dialogs
diff -Naur /usr/src/GNOME/CVS/gnome-screensaver/src/gs-lock-plug.c gnome-screensaver/src/gs-lock-plug.c
--- /usr/src/GNOME/CVS/gnome-screensaver/src/gs-lock-plug.c 2005-10-26 15:21:24.000000000 +0200
+++ gnome-screensaver/src/gs-lock-plug.c 2005-11-02 16:27:01.000000000 +0100
@@ -1034,6 +1034,7 @@
gboolean is_active;
guint n_displays;
DisplayChangedData *ddata;
+ char* name;
user = users->data;
@@ -1050,14 +1051,19 @@
http://bugzilla.gnome.org/show_bug.cgi?id=310418 */
pixbuf = fusa_user_render_icon (user, plug->priv->user_treeview, icon_size, is_active);
+ name = g_strdup_printf ("<span size=\"xx-large\">%s</span>\n<small>%s</small>",
+ fusa_user_get_user_name (user), fusa_user_get_display_name (user));
+
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
NAME_COLUMN, fusa_user_get_user_name (user),
- DISPLAY_NAME_COLUMN, fusa_user_get_display_name (user),
+ DISPLAY_NAME_COLUMN, name,
ACTIVE_COLUMN, is_active,
PIXBUF_COLUMN, pixbuf,
-1);
+ g_free (name);
+
ddata = g_new0 (DisplayChangedData, 1);
ddata->iter = iter;
ddata->tree = plug->priv->user_treeview;
@@ -1208,7 +1214,7 @@
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Name", renderer,
- "text", DISPLAY_NAME_COLUMN,
+ "markup", DISPLAY_NAME_COLUMN,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (plug->priv->user_treeview), column);
@@ -1273,42 +1279,6 @@
pango_attr_list_unref (pattrlist);
}
-static void
-label_set_bigger (GtkLabel *label)
-{
- PangoAttrList *pattrlist;
- PangoAttribute *attr;
-
- pattrlist = pango_attr_list_new ();
-
- attr = pango_attr_scale_new (1.4);
- attr->start_index = 0;
- attr->end_index = G_MAXINT;
- pango_attr_list_insert (pattrlist, attr);
-
- gtk_label_set_attributes (label, pattrlist);
-
- pango_attr_list_unref (pattrlist);
-}
-
-static void
-label_set_big (GtkLabel *label)
-{
- PangoAttrList *pattrlist;
- PangoAttribute *attr;
-
- pattrlist = pango_attr_list_new ();
-
- attr = pango_attr_scale_new (1.2);
- attr->start_index = 0;
- attr->end_index = G_MAXINT;
- pango_attr_list_insert (pattrlist, attr);
-
- gtk_label_set_attributes (label, pattrlist);
-
- pango_attr_list_unref (pattrlist);
-}
-
static gboolean
check_user_file (const gchar *filename,
uid_t user,
@@ -1420,18 +1390,20 @@
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
- plug->priv->username_label = gtk_label_new (get_user_display_name ());
- gtk_misc_set_alignment (GTK_MISC (plug->priv->username_label), 0.5, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->username_label, FALSE, FALSE, 0);
-
- label_set_bigger (GTK_LABEL (plug->priv->username_label));
-
- str = g_strdup_printf ("(%s)", g_get_user_name ());
+ str = g_strdup_printf ("<span size=\"xx-large\">%s</span>", g_get_user_name ());
widget = gtk_label_new (str);
g_free (str);
gtk_misc_set_alignment (GTK_MISC (widget), 0.5, 0.5);
+ gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 0);
+ str = g_strdup_printf ("<span size=\"small\">%s</span>", get_user_display_name ());
+ plug->priv->username_label = gtk_label_new (str);
+ g_free (str);
+ gtk_misc_set_alignment (GTK_MISC (plug->priv->username_label), 0.5, 0.5);
+ gtk_label_set_use_markup (GTK_LABEL (plug->priv->username_label), TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->username_label, FALSE, FALSE, 0);
+
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
@@ -1466,7 +1438,8 @@
static void
create_page_two (GSLockPlug *plug)
{
- GtkWidget *widget;
+ GtkWidget *header_label;
+ GtkWidget *userlist_scroller;
GtkWidget *vbox;
profile_start ("start", "page two");
@@ -1474,23 +1447,23 @@
vbox = gtk_vbox_new (FALSE, 6);
gtk_notebook_append_page (GTK_NOTEBOOK (plug->priv->notebook), vbox, NULL);
- widget = gtk_label_new (_("Switch to user:"));
- gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+ header_label = gtk_label_new_with_mnemonic (_("S_witch to user:"));
+ gtk_misc_set_alignment (GTK_MISC (header_label), 0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), header_label, FALSE, FALSE, 0);
- label_set_big (GTK_LABEL (widget));
-
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (widget),
+ userlist_scroller = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (userlist_scroller),
GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (userlist_scroller),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (vbox), widget, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), userlist_scroller, TRUE, TRUE, 0);
plug->priv->user_treeview = gtk_tree_view_new ();
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (plug->priv->user_treeview), FALSE);
- gtk_container_add (GTK_CONTAINER (widget), plug->priv->user_treeview);
+ gtk_container_add (GTK_CONTAINER (userlist_scroller), plug->priv->user_treeview);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL (header_label), plug->priv->user_treeview);
g_idle_add ((GSourceFunc)setup_treeview_idle, plug);
diff -Naur /usr/src/GNOME/CVS/gnome-screensaver/src/gs-manager.c gnome-screensaver/src/gs-manager.c
--- /usr/src/GNOME/CVS/gnome-screensaver/src/gs-manager.c 2005-10-30 11:10:00.000000000 +0100
+++ gnome-screensaver/src/gs-manager.c 2005-11-02 16:36:41.000000000 +0100
@@ -34,6 +34,8 @@
#include "fade.h"
+#define FADE_TIME 1
+
static void gs_manager_class_init (GSManagerClass *klass);
static void gs_manager_init (GSManager *manager);
static void gs_manager_finalize (GObject *object);
@@ -903,7 +905,7 @@
/* fade to black and show windows */
do_fade = TRUE;
if (do_fade) {
- fade_screens_and_show (3, 20, TRUE, manager->priv->windows);
+ fade_screens_and_show (FADE_TIME, 20, TRUE, manager->priv->windows);
} else {
show_windows (manager->priv->windows);
}
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]