Don't behave as if avail_d was not hardcoded, it is hardcoded
[claws.git] / src / plugins / vcalendar / month-view.c
index b7fd6a59e6d8e1c0309a356d08e7dee406e8ad8b..430f6e77598f56af0faa3ea3ff4fc60bc9aca965 100644 (file)
@@ -753,20 +753,21 @@ static void build_month_view_colours(month_win *mw)
     gdk_colormap_alloc_color(pic1_cmap, &mw->bg2, FALSE, TRUE);
 
     if (!gdk_color_parse("white", &mw->line_color)) {
+        g_warning("color parse failed: white");
         mw->line_color.red =  239 * (65535/255);
         mw->line_color.green = 235 * (65535/255);
         mw->line_color.blue = 230 * (65535/255);
     }
 
     if (!gdk_color_parse("blue", &mw->fg_sunday)) {
-        g_warning("color parse failed: red\n");
+        g_warning("color parse failed: blue");
         mw->fg_sunday.red = 10 * (65535/255);
         mw->fg_sunday.green = 10 * (65535/255);
         mw->fg_sunday.blue = 255 * (65535/255);
     }
 
     if (!gdk_color_parse("gold", &mw->bg_today)) {
-        g_warning("color parse failed: gold\n");
+        g_warning("color parse failed: gold");
         mw->bg_today.red = 255 * (65535/255);
         mw->bg_today.green = 215 * (65535/255);
         mw->bg_today.blue = 115 * (65535/255);
@@ -814,32 +815,31 @@ static void build_month_view_table(month_win *mw)
     GtkWidget *vp;
     time_t t = time(NULL);
     GtkWidget *arrow;
-    int avail_w = 0, avail_d = 0;
+    int avail_w = 0, avail_d = 7;
     int avail_h = 0;
     int weekoffset = -1;
     GDate *date;
-    int first_week=0;
+    int first_week = 0;
 
     if (mainwindow_get_mainwindow()) {
-        GtkAllocation allocation;
-       SummaryView *summaryview = mainwindow_get_mainwindow()->summaryview;
-       GTK_EVENTS_FLUSH();
-       allocation = summaryview->mainwidget_book->allocation;
-       
-       avail_w = allocation.width - 25 - 2*(mw->hour_req.width);
-       avail_h = allocation.height - 20;
-       if (avail_h < 250)
-               avail_h = 250;
-       avail_d = avail_w / mw->StartDate_button_req.width;
-    }
-    avail_d = 7;
+               GtkAllocation allocation;
+               SummaryView *summaryview = mainwindow_get_mainwindow()->summaryview;
+               GTK_EVENTS_FLUSH();
+               allocation = summaryview->mainwidget_book->allocation;
+
+               avail_w = allocation.width - 25 - 2*(mw->hour_req.width);
+               avail_h = allocation.height - 20;
+               if (avail_h < 250)
+                       avail_h = 250;
+               /* avail_d = avail_w / mw->StartDate_button_req.width; */
+       }
+
     gtk_widget_set_size_request(mw->StartDate_button, avail_w / avail_d, 
                        (avail_h)/6);
     gtk_widget_size_request(mw->StartDate_button, &mw->StartDate_button_req);
    
     /* initial values */
-    if (avail_d)
-        gtk_spin_button_set_value(GTK_SPIN_BUTTON(mw->day_spin), avail_d);
+    gtk_spin_button_set_value(GTK_SPIN_BUTTON(mw->day_spin), avail_d);
 
 #ifdef G_OS_WIN32
        if (t < 0)