After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737670 - GtkCalendar days cannot be selected if vertical size is greater than preferred (e.g when inside a fill container)
GtkCalendar days cannot be selected if vertical size is greater than preferre...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkCalendar
3.10.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-09-30 16:45 UTC by Leo Ufimtsev
Modified: 2014-10-02 00:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk2 vs gtk3 (38.20 KB, image/png)
2014-09-30 16:46 UTC, Leo Ufimtsev
Details
Screen shot with annotation outlining selection issue (53.59 KB, image/png)
2014-10-01 15:32 UTC, Leo Ufimtsev
Details
issue in grid layout (1.34 KB, text/x-csrc)
2014-10-01 15:37 UTC, Leo Ufimtsev
Details
Screenshot with annotation for gtk_grid_calendar.c (53.39 KB, image/png)
2014-10-01 15:37 UTC, Leo Ufimtsev
Details

Description Leo Ufimtsev 2014-09-30 16:45:07 UTC
As of Gtk3 (tested on 3.10) GtkCalendar days become unseletable if GtkCalendar is inside a vertical-fill box.
Comment 1 Leo Ufimtsev 2014-09-30 16:46:23 UTC
Created attachment 287470 [details]
gtk2 vs gtk3
Comment 2 Leo Ufimtsev 2014-09-30 16:48:46 UTC
Below is a bit of sample code to show the issue. 

In gtk3, the days shift to the bottom. The first two row of days (31 1 2 3 ...) can be selected, but anything below cannot. 

Tested on Fedora Linux 20. GtkVersion 3.10.9 



#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{
    //------------------ INIT
	GtkWidget *window;
	GtkWidget *vbox;
	GtkCalendar *calendar;

    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), "GtkCalendar GTK3");
    gtk_window_set_default_size(window, 300, 350);
    gtk_container_set_border_width (GTK_CONTAINER (window), 5);

    //--- Vertical Layout:
    vbox = gtk_vbox_new (FALSE, 10);
    gtk_container_add (GTK_CONTAINER (window), vbox);

    //------------------ ADD ELEMENTS
    calendar=gtk_calendar_new ();
    gtk_container_add (GTK_CONTAINER (vbox), calendar);

    //------------------ POST LOOP
    gtk_widget_show_all (window);
    gtk_main ();

    return 0;
}
Comment 3 Leo Ufimtsev 2014-09-30 18:33:43 UTC
Once bug is fixed, could someone please reply in:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=445539

(SWT DateTime is affected by this). 

Thank you
Comment 4 Matthias Clasen 2014-10-01 02:25:53 UTC
If you want the calendar to stay at the top, just set the valign:

gtk_widget_set_valign (calendar, GTK_ALIGN_START);
Comment 5 Matthias Clasen 2014-10-01 15:27:19 UTC
reopening; we should still try to improve the rendering with valign = FILL, and possibly there is some problem with clicking on days too
Comment 6 Leo Ufimtsev 2014-10-01 15:32:49 UTC
Created attachment 287524 [details]
Screen shot with annotation outlining selection issue

thank you for your comments, 
for clarification, attached is a screen shot with annotation showing the selection issue
Comment 7 Leo Ufimtsev 2014-10-01 15:37:21 UTC
Created attachment 287525 [details]
issue in grid layout

I read that gtk_vbox is deprecated as of gtk3.2:
https://developer.gnome.org/gtk3/stable/GtkVBox.html#gtk-vbox-new
It suggests to switch over to grid instead.

If of use, I wrote a bit of code with 'grid' layout where the issue occurs also. (attached).
Comment 8 Leo Ufimtsev 2014-10-01 15:37:51 UTC
Created attachment 287526 [details]
Screenshot with annotation for gtk_grid_calendar.c