[gnome-packagekit] Resize the deps list in a better way. Fixes rh#517662
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Resize the deps list in a better way. Fixes rh#517662
- Date: Fri, 21 Aug 2009 15:04:57 +0000 (UTC)
commit ade4632b2013122173ef766255f84301e26a3d31
Author: Richard Hughes <richard hughsie com>
Date: Fri Aug 21 15:30:28 2009 +0100
Resize the deps list in a better way. Fixes rh#517662
src/gpk-dialog.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/gpk-dialog.c b/src/gpk-dialog.c
index 768471a..4ccc4ce 100644
--- a/src/gpk-dialog.c
+++ b/src/gpk-dialog.c
@@ -176,7 +176,7 @@ gpk_dialog_embed_package_list_widget (GtkDialog *dialog, PkPackageList *list)
GtkListStore *store;
GtkWidget *widget;
guint length;
- gboolean sffm;
+ const guint row_height = 48;
/* convert to a store */
store = gpk_dialog_package_list_to_list_store (list);
@@ -195,15 +195,12 @@ gpk_dialog_embed_package_list_widget (GtkDialog *dialog, PkPackageList *list)
/* add some spacing to conform to the GNOME HIG */
gtk_container_set_border_width (GTK_CONTAINER (scroll), 6);
- /* are we a normal size desktop, in which case, give the package list more space */
- sffm = gpk_window_get_small_form_factor_mode ();
- if (!sffm) {
- length = pk_package_list_get_size (list);
- if (length > 5) {
- gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, 300);
- } else if (length > 1) {
- gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, 150);
- }
+ /* only allow more space if there are a large number of items */
+ length = pk_package_list_get_size (list);
+ if (length > 5) {
+ gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, (row_height * 5) + 8);
+ } else if (length > 1) {
+ gtk_widget_set_size_request (GTK_WIDGET (scroll), -1, (row_height * length) + 8);
}
/* add scrolled window */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]