[gnome-games] Reduce size of Tali window by:



commit eb59a7c4e9c4d0eb3114fc8c25a7f35963cba201
Author: Robert Ancell <robert ancell gmail com>
Date:   Tue Dec 15 16:18:12 2009 +1100

    Reduce size of Tali window by:
    - Not setting default window size
    - Defaulting to 4 players
    - Reducing size of icons

 gtali/clist.c          |    7 +++----
 gtali/gtali.schemas.in |    2 +-
 gtali/gyahtzee.c       |   15 +++++++++------
 3 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/gtali/clist.c b/gtali/clist.c
index 77f5036..3acd6c6 100644
--- a/gtali/clist.c
+++ b/gtali/clist.c
@@ -298,6 +298,7 @@ add_columns (GtkTreeView * tree)
     label = gtk_label_new (players[i].name);
     gtk_tree_view_column_set_widget (column, label);
     gtk_widget_show (label);
+    gtk_tree_view_column_set_visible (column, FALSE);
     gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
   }
   renderer = gtk_cell_renderer_text_new ();
@@ -340,10 +341,8 @@ initialize_column_titles (GtkTreeView * treeview)
     if (!label)
       continue;
 
-    if (i < NumberOfPlayers)
-      gtk_label_set_text (GTK_LABEL (label), players[i].name);
-    else
-      gtk_label_set_text (GTK_LABEL (label), "");
+    gtk_tree_view_column_set_visible (col, i < NumberOfPlayers);
+    gtk_label_set_text (GTK_LABEL (label), players[i].name);
     i++;
   }
   g_list_free (collist);
diff --git a/gtali/gtali.schemas.in b/gtali/gtali.schemas.in
index 4d6165f..55a0dd4 100644
--- a/gtali/gtali.schemas.in
+++ b/gtali/gtali.schemas.in
@@ -5,7 +5,7 @@
       <applyto>/apps/gtali/NumberOfComputerOpponents</applyto>
       <owner>gtali</owner>
       <type>int</type>
-      <default>5</default>
+      <default>3</default>
       <locale name="C">
         <short></short>
         <long></long>
diff --git a/gtali/gyahtzee.c b/gtali/gyahtzee.c
index 15e9e0f..1e1c57b 100644
--- a/gtali/gyahtzee.c
+++ b/gtali/gyahtzee.c
@@ -66,9 +66,6 @@ static gboolean ready_to_advance_player;
 #define DIE_SELECTED_PIXMAP  (NUMBER_OF_PIXMAPS-1)
 #define SCORES_CATEGORY (game_type == GAME_KISMET ? "Colors" : NULL)
 
-#define DEFAULT_WIDTH 640
-#define DEFAULT_HEIGHT 480
-
 static char *dicefiles[NUMBER_OF_PIXMAPS] = { "gnome-dice-1.svg",
   "gnome-dice-2.svg",
   "gnome-dice-3.svg",
@@ -674,8 +671,15 @@ LoadDicePixmaps (void)
           g_file_test (path_kismet, G_FILE_TEST_EXISTS)) {
 
       for (j = 0; j < NUMBER_OF_DICE; j++) {
-        dicePixmaps[j][i][GAME_YAHTZEE] = gtk_image_new_from_file (path);
-        dicePixmaps[j][i][GAME_KISMET] = gtk_image_new_from_file (path_kismet);
+        GdkPixbuf *pixbuf;
+
+        pixbuf = gdk_pixbuf_new_from_file_at_size (path, 60, 60, NULL);
+        dicePixmaps[j][i][GAME_YAHTZEE] = gtk_image_new_from_pixbuf (pixbuf);
+        gdk_pixbuf_unref (pixbuf);
+
+        pixbuf = gdk_pixbuf_new_from_file_at_size (path_kismet, 60, 60, NULL);
+        dicePixmaps[j][i][GAME_KISMET] = gtk_image_new_from_pixbuf (pixbuf);
+        gdk_pixbuf_unref (pixbuf);
       }
 
     } /* FIXME: What happens if the file isn't found. */
@@ -769,7 +773,6 @@ GyahtzeeCreateMainWindow (void)
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (window), _(appName));
 
-  gtk_window_set_default_size (GTK_WINDOW (window), DEFAULT_WIDTH, DEFAULT_HEIGHT);
   games_conf_add_window (GTK_WINDOW (window), NULL);
 
   g_signal_connect (G_OBJECT (window), "delete_event",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]