added theme buttons
[livewp] / applet / src / livewp-settings.c
index 12a7abf..3f0c7b2 100644 (file)
@@ -67,6 +67,34 @@ create_theme_selector (void)
 }
 /*******************************************************************************/
 GtkWidget *
+create_image_button (gchar *theme)
+{
+    GtkWidget *button;
+    GtkWidget *image;
+    gchar * str;
+    GdkPixbuf * pixbuf;
+    
+    button = hildon_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
+                                    HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+    str = g_strdup_printf( "%s/%s/%s", THEME_PATH, 
+                        theme, "icon.png");
+    pixbuf = gdk_pixbuf_new_from_file_at_size (str, 
+                                             100, 
+                                             60, 
+                                             NULL);
+    if (str)
+        g_free(str);
+    if (pixbuf){
+        image = gtk_image_new_from_pixbuf (pixbuf);
+        g_object_unref(G_OBJECT(pixbuf));
+    }
+    hildon_button_set_image (HILDON_BUTTON (button), image);
+    //hildon_button_set_image_position (HILDON_BUTTON (button), GTK_POS_RIGHT);
+    return button;
+
+}
+/********************************************************************************/
+GtkWidget *
 create_themes_button (gchar *theme){
 
     GtkWidget *button;
@@ -123,7 +151,61 @@ show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv){
 }
 /*******************************************************************************/
 void 
-lw_settings(Animation_WallpaperPrivate *priv, gpointer data){
+lw_main_settings(Animation_WallpaperPrivate *priv, gpointer data){
+    gint result;
+    GtkWidget *window = NULL;
+    GtkWidget *theme_button1;
+    GtkWidget *theme_button2;
+    GtkWidget *theme_button3;
+    GtkWidget *theme_button4;
+    GtkWidget *hbox;
+
+    window = gtk_dialog_new();
+
+    gtk_window_set_title(GTK_WINDOW(window), _("Live Wallpaper Settings"));
+    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+    gtk_window_set_modal(GTK_WINDOW(window), TRUE);
+    /* Create Theme button */
+    hbox = gtk_hbox_new(FALSE, 5);
+    theme_button1 = create_image_button("Matrix");
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button1, TRUE, TRUE, 5);
+    theme_button2 = create_image_button("Matrix");
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button2, TRUE, TRUE, 5);
+    theme_button3 = create_image_button("Matrix");
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button3, TRUE, TRUE, 5);
+    theme_button4 = create_image_button("Matrix");
+    gtk_box_pack_start(GTK_BOX(hbox),
+                                   theme_button4, TRUE, TRUE, 5);
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox),
+                                   hbox, TRUE, TRUE, 5);
+
+    gtk_widget_show (theme_button1);
+    gtk_widget_show (theme_button2);
+    gtk_widget_show (theme_button3);
+    gtk_widget_show (theme_button4);
+    gtk_widget_show_all (hbox);
+    gtk_widget_show (window);
+    gtk_dialog_add_button(GTK_DIALOG(window), _("About"), GTK_RESPONSE_NO);
+
+    result = gtk_dialog_run(GTK_DIALOG(window));
+
+    switch(result){
+        case GTK_RESPONSE_NO:
+            gtk_widget_destroy(window);
+            window = NULL;
+            lw_about();
+        break;
+    }
+    if (window)
+        gtk_widget_destroy(window);
+}
+
+/*******************************************************************************/
+void 
+lw_theme_settings(Animation_WallpaperPrivate *priv, gpointer data){
     gint result;
     GtkWidget *window = NULL;
     GtkWidget *save_button;