Better buttons in adapter properties
PATCH 1/1 Better buttons in adapter properties
Before:
http://img369.imageshack.us/my.php?image=screenshotbluetoothprefoa6.png
After:
http://img233.imageshack.us/my.php?image=screenshotbluetoothprefby0.png
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=465398 (No labels in buttons)
http://bugzilla.gnome.org/show_bug.cgi?id=505606 (trust toggle button appears/disappears)
And the discussion that were recently made on the list about having a shorter dialogue for EeePCs.
Quoted 1 line
From
a394c15d8d1f904bbd4399aa2b7baf8db40d5b4cMon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Tue, 14 Oct 2008 16:08:23 +0100
Subject: [PATCH] Fixes for adapter specific buttons
- Add labels to the adapter buttons, otherwise people wonder what each one is for.
- Always show the buttons, just make sure they're
disabled if no devices is selected.
- Remove the difference in look for the extra buttons
--- properties/adapter.c | 43 +++++++++++++------------------------------ 1 files changed, 13 insertions(+), 30 deletions(-)
properties/adapter.c +13 -30
@@ -246,15 +246,8 @@ static void select_callback(GtkTreeSelection *selection, gpointer user_data)update_buttons (adapter, paired, trusted, connected); -if (selected == TRUE) { -gtk_widget_show (adapter->button_disconnect); -gtk_widget_show (adapter->button_trusted); -gtk_widget_show (adapter->button_delete); - }else { -gtk_widget_hide (adapter->button_disconnect); -gtk_widget_hide (adapter->button_trusted); -gtk_widget_hide (adapter->button_delete); - } +gtk_widget_set_sensitive (adapter->button_trusted, selected); +gtk_widget_set_sensitive (adapter->button_delete, selected); } static void row_callback(GtkTreeModel *model, GtkTreePath *path,
@@ -646,61 +639,51 @@ static void create_adapter(struct adapter_data *adapter)gtk_box_set_homogeneous (GTK_BOX (buttonbox), FALSE);gtk_box_pack_start (GTK_BOX (vbox), buttonbox, FALSE, FALSE,0 ); - button =gtk_button_new (); + button =gtk_button_new_with_label (_ ("Setup new device..." )); image =gtk_image_new_from_stock (GTK_STOCK_ADD ,GTK_ICON_SIZE_BUTTON ); -gtk_container_add (GTK_CONTAINER (button), image); -gtk_container_set_border_width (GTK_CONTAINER (button),0 ); +gtk_button_set_image (GTK_BUTTON (button), image);gtk_box_pack_start (GTK_BOX (buttonbox), button, FALSE, FALSE,0 );g_signal_connect (G_OBJECT (button),"clicked" ,G_CALLBACK (wizard_callback), adapter); - button =gtk_button_new (); -gtk_button_set_relief (GTK_BUTTON (button),GTK_RELIEF_NONE ); + button =gtk_button_new_with_label (_ ("Disconnect" )); image =gtk_image_new_from_stock (GTK_STOCK_DISCONNECT ,GTK_ICON_SIZE_BUTTON ); -gtk_container_add (GTK_CONTAINER (button), image); -gtk_container_set_border_width (GTK_CONTAINER (button),0 ); -gtk_widget_set_no_show_all (button, TRUE); -gtk_widget_show (image); +gtk_button_set_image (GTK_BUTTON (button), image);gtk_box_pack_end (GTK_BOX (buttonbox), button, FALSE, FALSE,0 );gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (buttonbox), button, TRUE); +gtk_widget_set_sensitive (button, FALSE);g_signal_connect (G_OBJECT (button),"clicked" ,G_CALLBACK (disconnect_callback), adapter); adapter->button_disconnect = button; - button =gtk_button_new (); -gtk_button_set_relief (GTK_BUTTON (button),GTK_RELIEF_NONE ); + button =gtk_button_new_with_label (_ ("Add to Trusted" )); image =gtk_image_new_from_stock (GTK_STOCK_ABOUT ,GTK_ICON_SIZE_BUTTON ); -gtk_container_add (GTK_CONTAINER (button), image); -gtk_container_set_border_width (GTK_CONTAINER (button),0 ); -gtk_widget_set_no_show_all (button, TRUE); -gtk_widget_show (image); +gtk_button_set_image (GTK_BUTTON (button), image);gtk_box_pack_end (GTK_BOX (buttonbox), button, FALSE, FALSE,0 );gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (buttonbox), button, TRUE); +gtk_widget_set_sensitive (button, FALSE);g_signal_connect (G_OBJECT (button),"clicked" ,G_CALLBACK (trusted_callback), adapter); adapter->button_trusted = button; - button =gtk_button_new (); -gtk_button_set_relief (GTK_BUTTON (button),GTK_RELIEF_NONE ); + button =gtk_button_new_with_label (_ ("Delete" )); image =gtk_image_new_from_stock (GTK_STOCK_DELETE ,GTK_ICON_SIZE_BUTTON ); -gtk_container_add (GTK_CONTAINER (button), image); -gtk_container_set_border_width (GTK_CONTAINER (button),0 ); -gtk_widget_set_no_show_all (button, TRUE); -gtk_widget_show (image); +gtk_button_set_image (GTK_BUTTON (button), image);gtk_box_pack_end (GTK_BOX (buttonbox), button, FALSE, FALSE,0 );gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (buttonbox), button, TRUE); +gtk_widget_set_sensitive (button, FALSE);g_signal_connect (G_OBJECT (button),"clicked" ,G_CALLBACK (delete_callback), adapter);
Signature · 1 line
1.5.5.2
Quoted 1 line
From
161b2023faa95b6d777c3cbaac902365548babf3Mon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Tue, 14 Oct 2008 17:37:51 +0100
Subject: [PATCH] Move the adapter button list to the side
This makes the dialogue wider, rather than tall, which is useful for computers with small displays.
--- properties/adapter.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
properties/adapter.c +10 -6
@@ -437,6 +437,7 @@ static void create_adapter(struct adapter_data *adapter)GtkWidget *mainbox;GtkWidget *vbox; +GtkWidget *table;GtkWidget *label;GtkWidget *image;GtkWidget *button;
@@ -602,18 +603,20 @@ static void create_adapter(struct adapter_data *adapter)g_signal_connect (G_OBJECT (entry),"focus-out-event" ,G_CALLBACK (focus_callback), adapter); - vbox =gtk_vbox_new (FALSE,6 ); -gtk_box_pack_start (GTK_BOX (mainbox), vbox, TRUE, TRUE,0 ); + table =gtk_table_new (2 ,2 , FALSE); +gtk_box_pack_start (GTK_BOX (mainbox), table, TRUE, TRUE,0 ); label =create_label (_ ("Known devices" )); -gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE,0 ); +gtk_table_attach (GTK_TABLE (table), label,0 ,2 ,0 ,1 , +GTK_EXPAND |GTK_FILL ,GTK_EXPAND |GTK_FILL ,0 ,6 ); scrolled =gtk_scrolled_window_new (NULL ,NULL );gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),GTK_POLICY_AUTOMATIC ,GTK_POLICY_AUTOMATIC );gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),GTK_SHADOW_OUT ); -gtk_container_add (GTK_CONTAINER (vbox), scrolled); +gtk_table_attach (GTK_TABLE (table), scrolled,0 ,1 ,1 ,2 , +GTK_EXPAND |GTK_FILL ,GTK_EXPAND |GTK_FILL ,6 ,6 ); model =bluetooth_client_get_device_filter_model (client, adapter->proxy, device_filter,NULL ,NULL );
@@ -632,12 +635,13 @@ static void create_adapter(struct adapter_data *adapter)gtk_container_add (GTK_CONTAINER (scrolled), tree); - buttonbox =gtk_hbutton_box_new (); + buttonbox =gtk_vbutton_box_new ();gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonbox),GTK_BUTTONBOX_START );gtk_box_set_spacing (GTK_BOX (buttonbox),6 );gtk_box_set_homogeneous (GTK_BOX (buttonbox), FALSE); -gtk_box_pack_start (GTK_BOX (vbox), buttonbox, FALSE, FALSE,0 ); +gtk_table_attach (GTK_TABLE (table), buttonbox,1 ,2 ,1 ,2 , +GTK_FILL ,GTK_FILL ,6 ,6 ); button =gtk_button_new_with_label (_ ("Setup new device..." )); image = gtk_image_new_from_stock(GTK_STOCK_ADD,
Signature · 1 line
1.5.5.2
Quoted 1 line
From
a99222b4c0b505f5a0fc2a564977bf3be71a6c86Mon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Tue, 14 Oct 2008 17:59:58 +0100
Subject: [PATCH] Fix trust button
The trust button toggles the trust for a device, so the label should reflect the action to take when clicked. Changed the label to "Trust"/"Distrust" to avoid the widgets moving about when toggling the trust status.
--- properties/adapter.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
properties/adapter.c +6 -1
@@ -216,6 +216,11 @@ static gboolean focus_callback(GtkWidget *editable,static void update_buttons (struct adapter_data *adapter,gboolean bonded,gboolean trusted,gboolean connected) { +if (trusted) { +gtk_button_set_label (GTK_BUTTON (adapter->button_trusted),_ ("Distrust" )); + }else { +gtk_button_set_label (GTK_BUTTON (adapter->button_trusted),_ ("Trust" )); + }gtk_widget_set_sensitive (adapter->button_delete, bonded);gtk_widget_set_sensitive (adapter->button_disconnect, connected); }
@@ -666,7 +671,7 @@ static void create_adapter(struct adapter_data *adapter) adapter->button_disconnect = button; - button =gtk_button_new_with_label (_ ("Add to Trusted" )); + button =gtk_button_new_with_label (_ ("Trust" )); image =gtk_image_new_from_stock (GTK_STOCK_ABOUT ,GTK_ICON_SIZE_BUTTON );gtk_button_set_image (GTK_BUTTON (button), image);
Signature · 1 line
1.5.5.2
Quoted 5 lines · Bastien Nocera
Before:
http://img369.imageshack.us/my.php?image=screenshotbluetoothprefoa6.png
After:
http://img233.imageshack.us/my.php?image=screenshotbluetoothprefby0.png
Quoted 8 lines
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=465398 (No labels in buttons)
http://bugzilla.gnome.org/show_bug.cgi?id=505606 (trust toggle button appears/disappears)
And the discussion that were recently made on the list about having a shorter dialogue for EeePCs.
It's an improvement. I've attached what it looks like (in relatively stock EeePC 701 environment).
It's still too tall to see the Delete button and the Close button without dragging the window up and down.
Of course, it's not the only thing that produces windows too tall for this display :)
Quoted 14 lines · David Sainty
Quoted 5 lines · Bastien Nocera
Before:
http://img369.imageshack.us/my.php?image=screenshotbluetoothprefoa6.png
After:
http://img233.imageshack.us/my.php?image=screenshotbluetoothprefby0.pngQuoted 8 lines
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=465398 (No labels in buttons)
http://bugzilla.gnome.org/show_bug.cgi?id=505606 (trust toggle button appears/disappears)
And the discussion that were recently made on the list about having a shorter dialogue for EeePCs.
Quoted 2 lines
It's an improvement. I've attached what it looks like (in relatively stock EeePC 701 environment).
You haven't attached anything :) I would recommend Evolution's attachment reminder plugin :)
Quoted 5 lines
It's still too tall to see the Delete button and the Close button without dragging the window up and down.
Of course, it's not the only thing that produces windows too tall for this display :)
There might be some spacing issue still, as well as a too high default size. What's the size of the display on the EeePC again?
Quoted 4 lines · Bastien Nocera
You haven't attached anything :) I would recommend Evolution's attachment reminder plugin :)
Huh! It previewed with it attached... I think it's a Thunderbird feature. Oh yeah, I attached it inline and Thunderbird stripped the image out when I sent the email in text :) Amusing. Oh look, and I've already deleted the image from my file system too.
Lets try again...
Quoted 8 lines
Quoted 4 lines
It's still too tall to see the Delete button and the Close button without dragging the window up and down.
Of course, it's not the only thing that produces windows too tall for this display :)
There might be some spacing issue still, as well as a too high default size. What's the size of the display on the EeePC again?
800x480 full screen. But the standard window manager decorations on the EeePC make anything taller than 422 pixels start to not fit.
On Wed, 2008-10-15 at 12:25 +1300, David Sainty wrote:
<snip>
Quoted 2 lines
800x480 full screen. But the standard window manager decorations on the EeePC make anything taller than 422 pixels start to not fit.
I think we can easily reduce the space taken by the visibility and friendly name sections. I'll try to get a patch ready tomorrow.
Cheers
Marcel Holtmann
maintainerHi Bastien,
Quoted 5 lines
Quoted 2 lines
800x480 full screen. But the standard window manager decorations on the EeePC make anything taller than 422 pixels start to not fit.
I think we can easily reduce the space taken by the visibility and friendly name sections. I'll try to get a patch ready tomorrow.
any updates here that I might have missed?
Regards
Marcel
Quoted 9 lines · Marcel Holtmann
Hi Bastien,
Quoted 5 lines
Quoted 2 lines
800x480 full screen. But the standard window manager decorations on the EeePC make anything taller than 422 pixels start to not fit.
I think we can easily reduce the space taken by the visibility and friendly name sections. I'll try to get a patch ready tomorrow.
any updates here that I might have missed?
Not since my rant about the discoverable preferences. The patched version doesn't take any more space than the current layout, and fixes discovery problems with the labels, so I would urge you to merge it.
I'll try to have a patch ready for squeezing the rest of the UI when I've had more of a think about it.
Cheers