[gthumb] added a general function to adapt dialogs to small screens
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] added a general function to adapt dialogs to small screens
- Date: Wed, 19 May 2010 18:53:52 +0000 (UTC)
commit df2d962d4785085bfa83f29c7db630c21c24cb65
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed May 19 20:19:40 2010 +0200
added a general function to adapt dialogs to small screens
extensions/facebook/dlg-export-to-facebook.c | 2 ++
extensions/flicker/dlg-export-to-flickr.c | 2 ++
extensions/flicker/dlg-import-from-flickr.c | 2 ++
extensions/photo_importer/dlg-photo-importer.c | 13 +------------
extensions/picasaweb/dlg-export-to-picasaweb.c | 12 +-----------
extensions/picasaweb/dlg-import-from-picasaweb.c | 2 ++
gthumb/gtk-utils.c | 17 +++++++++++++++++
gthumb/gtk-utils.h | 2 ++
8 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/extensions/facebook/dlg-export-to-facebook.c b/extensions/facebook/dlg-export-to-facebook.c
index b173d4f..869c225 100644
--- a/extensions/facebook/dlg-export-to-facebook.c
+++ b/extensions/facebook/dlg-export-to-facebook.c
@@ -532,6 +532,8 @@ dlg_export_to_facebook (GthBrowser *browser,
g_free (text);
g_free (total_size_formatted);
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 500);
+
/* Set the widget data */
data->list_view = gth_file_list_new (GTH_FILE_LIST_TYPE_NO_SELECTION, FALSE);
diff --git a/extensions/flicker/dlg-export-to-flickr.c b/extensions/flicker/dlg-export-to-flickr.c
index e3d6b13..b4affb1 100644
--- a/extensions/flicker/dlg-export-to-flickr.c
+++ b/extensions/flicker/dlg-export-to-flickr.c
@@ -526,6 +526,8 @@ dlg_export_to_flickr (FlickrServer *server,
g_free (text);
g_free (total_size_formatted);
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 500);
+
/* Set the widget data */
data->list_view = gth_file_list_new (GTH_FILE_LIST_TYPE_NO_SELECTION, FALSE);
diff --git a/extensions/flicker/dlg-import-from-flickr.c b/extensions/flicker/dlg-import-from-flickr.c
index bb7304b..44b40fc 100644
--- a/extensions/flicker/dlg-import-from-flickr.c
+++ b/extensions/flicker/dlg-import-from-flickr.c
@@ -576,6 +576,8 @@ dlg_import_from_flickr (FlickrServer *server,
gtk_window_set_title (GTK_WINDOW (data->dialog), title);
g_free (title);
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 500);
+
/* Set the signals handlers. */
g_signal_connect (G_OBJECT (data->dialog),
diff --git a/extensions/photo_importer/dlg-photo-importer.c b/extensions/photo_importer/dlg-photo-importer.c
index 4b091ee..b8099b6 100644
--- a/extensions/photo_importer/dlg-photo-importer.c
+++ b/extensions/photo_importer/dlg-photo-importer.c
@@ -476,7 +476,6 @@ dlg_photo_importer (GthBrowser *browser,
{
DialogData *data;
GtkCellRenderer *renderer;
- GdkScreen *screen;
GthFileDataSort *sort_type;
GList *tests, *scan;
char *general_filter;
@@ -499,20 +498,10 @@ dlg_photo_importer (GthBrowser *browser,
/* Get the widgets. */
data->dialog = _gtk_builder_get_widget (data->builder, "photo_importer_dialog");
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 580);
gth_browser_set_dialog (browser, "photo_importer", data->dialog);
g_object_set_data (G_OBJECT (data->dialog), "dialog_data", data);
- screen = gtk_widget_get_screen (data->dialog);
- if (screen && gdk_screen_get_height (screen) < 768) {
- /* maximize on netbooks */
- gtk_window_maximize (GTK_WINDOW (data->dialog));
- } else {
- /* This should fit on a XGA/WXGA (height 768) screen
- * with top and bottom panels */
- gtk_window_set_default_size (GTK_WINDOW (data->dialog),
- 580, 670);
- }
-
data->source_store = gtk_list_store_new (SOURCE_LIST_COLUMNS, G_TYPE_OBJECT, G_TYPE_ICON, G_TYPE_STRING);
data->source_list = gtk_combo_box_new_with_model (GTK_TREE_MODEL (data->source_store));
gtk_widget_show (data->source_list);
diff --git a/extensions/picasaweb/dlg-export-to-picasaweb.c b/extensions/picasaweb/dlg-export-to-picasaweb.c
index d3eb495..a14c094 100644
--- a/extensions/picasaweb/dlg-export-to-picasaweb.c
+++ b/extensions/picasaweb/dlg-export-to-picasaweb.c
@@ -861,7 +861,6 @@ dlg_export_to_picasaweb (GthBrowser *browser,
{
DialogData *data;
GtkTreeSelection *selection;
- GdkScreen *screen;
GList *scan;
int n_total;
goffset total_size;
@@ -900,16 +899,7 @@ dlg_export_to_picasaweb (GthBrowser *browser,
NULL);
}
- screen = gtk_widget_get_screen (data->dialog);
- if (screen && gdk_screen_get_height (screen) < 768) {
- /* maximize on netbooks */
- gtk_window_maximize (GTK_WINDOW (data->dialog));
- } else {
- /* This should fit on a XGA/WXGA (height 768) screen
- * with top and bottom panels */
- gtk_window_set_default_size (GTK_WINDOW (data->dialog),
- 580, 670);
- }
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 500);
data->file_list = NULL;
n_total = 0;
diff --git a/extensions/picasaweb/dlg-import-from-picasaweb.c b/extensions/picasaweb/dlg-import-from-picasaweb.c
index 5cd9420..b63d446 100644
--- a/extensions/picasaweb/dlg-import-from-picasaweb.c
+++ b/extensions/picasaweb/dlg-import-from-picasaweb.c
@@ -943,6 +943,8 @@ dlg_import_from_picasaweb (GthBrowser *browser)
NULL);
}
+ _gtk_window_resize_to_fit_screen_height (data->dialog, 500);
+
/* Set the widget data */
data->file_list = gth_file_list_new (GTH_FILE_LIST_TYPE_NORMAL, FALSE);
diff --git a/gthumb/gtk-utils.c b/gthumb/gtk-utils.c
index 867a082..388425c 100644
--- a/gthumb/gtk-utils.c
+++ b/gthumb/gtk-utils.c
@@ -1097,3 +1097,20 @@ _g_launch_command (GtkWidget *parent,
g_object_unref (app_info);
}
+
+
+void
+_gtk_window_resize_to_fit_screen_height (GtkWidget *window,
+ int default_width)
+{
+ GdkScreen *screen;
+
+ screen = gtk_widget_get_screen (window);
+ if ((screen != NULL) && (gdk_screen_get_height (screen) < 768))
+ /* maximize on netbooks */
+ gtk_window_maximize (GTK_WINDOW (window));
+ else
+ /* This should fit on a XGA/WXGA (height 768) screen
+ * with top and bottom panels */
+ gtk_window_set_default_size (GTK_WINDOW (window), default_width, 670);
+}
diff --git a/gthumb/gtk-utils.h b/gthumb/gtk-utils.h
index 83716e4..377147b 100644
--- a/gthumb/gtk-utils.h
+++ b/gthumb/gtk-utils.h
@@ -121,6 +121,8 @@ void _g_launch_command (GtkWidget *parent,
const char *command,
const char *name,
GList *files);
+void _gtk_window_resize_to_fit_screen_height (GtkWidget *window,
+ int default_width);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]