Commit Graph

220 Commits

Author SHA1 Message Date
Emmanuele Bassi
b46fdb2d13 calendar: Handle invalid dates
GtkCalendar can have an invalid date — mostly at initialization. This
means that GDateTime construction may fail. We need to handle that case
gracefully, like the old code did.

This fixes the `notify` test suite, which started failing with:

/Notification/GtkCalendar:
GLib-CRITICAL **: g_date_time_get_day_of_week: assertion 'datetime != NULL' failed

inside the Continuous builder.
2015-01-02 23:15:55 +00:00
Matthias Clasen
d216d89d6f GtkCalendar: Slightly change overflow behaviour
If the first of the month was falling on a Sunday, we would not
render any days of the previous month, and instead show two weeks
of the next month at the bottom. Improve this by showing one week
of each.

https://bugzilla.gnome.org/show_bug.cgi?id=301835
2014-12-23 21:49:21 -05:00
Matthias Clasen
6ae93f5c46 GtkCalendar: Use GDateTime for calculations
Instead of old copy-paste code, use GDateTime to determine week
numbers and days of week.
2014-12-23 20:28:49 -05:00
Benjamin Otte
d3c147a62d stylecontext: Split render functions out into gtkrender.[ch] 2014-10-03 06:18:05 +02:00
Matthias Clasen
7b2e526c3a GtkCalendar: deal better with a large allocation
When allocated more than the requested height, GtkCalendar
was 'falling apart'. Not only was the main part rendered
at the far end of the allocation, clicking on days was
broken in this scenario.

Fix this by always placing the main part directly under
the header and day names.

https://bugzilla.gnome.org/show_bug.cgi?id=737670
2014-10-01 20:09:10 -04:00
Matthias Clasen
b46cef1809 Trivial formatting fix 2014-10-01 19:52:04 -04:00
Matthias Clasen
09551bf37a Fix a typo 2014-10-01 19:30:12 -04:00
Matthias Clasen
d5c56ea780 GtkCalendar: Use G_PARAM_EXPLICIT_NOTIFY
And make sure we correctly notify for all properties.
2014-06-09 13:30:53 -04:00
Matthias Clasen
53b37b8f71 Fix GtkCalendar drawing
A gtk_widget_get_allocation call was unintentionally
dropped in 5cb43c70f7.
2014-05-14 20:38:55 -04:00
Cosimo Cecchi
0ff3f16da1 calendar: don't use focus-line-width 2014-05-09 11:02:44 -07:00
Cosimo Cecchi
5cb43c70f7 calendar: simplify code
Always use the newly introduced get_component_paddings() instead of
doing the work manually every time.
2014-05-09 11:02:44 -07:00
Cosimo Cecchi
1e66a7ccdb calendar: use CSS paddings instead of focus pad for day/week areas
focus-padding is going away.
2014-05-09 11:02:44 -07:00
Carlos Garnacho
efb4f2db50 calendar: grab focus first, emit signals after
It may be unusual, but handlers of day-selected may want to transfer
focus somewhere else, without getting it reset back right after by/to
the calendar. This makes popovers demo work on the calendar again, for
one...
2014-03-07 02:50:27 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
66071234f6 docs: list items require blank lines 2014-02-01 05:35:43 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Carlos Garnacho
2927218a26 calendar: Set GDK_SCROLL_MASK explicitly
selecting for button press/release doesn't suffice anymore to
get scroll events.
2012-03-01 16:29:00 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garcia Campos
c5d9c6f27c gtkcalendar: Use symbolic names for button numbers 2012-01-27 09:47:42 +01:00
Rui Matos
5f5d4db034 calendar: Use the widget state flags as a base for drawing arrows
This allows drawing calendar arrows in all possible states the main widget may
be in.

The arrow_state array is converted into a bit field since it only really needs
to store boolean information about prelight for each arrow.
2011-12-19 19:21:15 +00:00
Rui Matos
d84021a870 calendar: Use the widget state flags as a base for drawing days
Instead of building a set of state flags specifically for drawing days, base
it on the underlying widget state flags.
2011-12-19 19:21:15 +00:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Benjamin Otte
8815ccf5c4 calendar: Use gtk_widget_class_accessible_set_role() 2011-07-18 18:30:50 +02:00
Matthias Clasen
6aedf8f066 Remove GailCalendar
This was just setting a role, which we can do just as well
in get_accessible().
2011-07-05 16:08:10 -04:00
Javier Jardón
a817b4763d gtkcalendar: Remove unused variable 2011-05-02 14:59:53 +01:00
Cosimo Cecchi
b52394adca calendar: make sure to call gtk_style_context_restore()
https://bugzilla.gnome.org/show_bug.cgi?id=647086
2011-04-08 20:33:58 -04:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Sebastian Pölsterl
34b573b07c Fixed gtk_calendar_get_date annotations: Added missing (out) 2011-01-18 16:21:10 +01:00
Carlos Garnacho
162380fca5 Make GtkCalendar use GtkStyleContext 2011-01-10 20:49:34 +01:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
e515bd4f71 Some more calendar doc additions
Proposed by Nikos Kouremenos

https://bugzilla.gnome.org/show_bug.cgi?id=321958
2011-01-04 11:44:09 -05:00
Matthias Clasen
336d355c2a Some documentation additions
Proposed by Bruno Piguet.

https://bugzilla.gnome.org/show_bug.cgi?id=559503
2011-01-04 11:36:42 -05:00
Matthias Clasen
5c2f407935 Fix problems with window handling in GtkCalendar
After the window removal a while ago, the calendar main window
was not properly moved in size_allocate. Also, we ought to hide/show
the windows in map/unmap, not keep them visible at all times.

Bug 634657
2010-12-20 17:12:02 -05:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Matthias Clasen
f85543af98 Remove size_request from GtkCalendar 2010-10-26 21:06:40 -04:00
Matthias Clasen
52a7553b2c GtkCalendar: turn into a no-window widget
After these changes, GtkCalendar only has a few input-only windows
left for catching input events. All drawing goes to the parent
window now.
2010-10-24 14:43:05 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
e13d93a707 calendar: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:45 +02:00
Benjamin Otte
7125712299 calendar: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
9233a08991 calendar: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
725749cd14 calendar: Fix drawing order for windows 2010-09-26 15:11:35 +02:00
Benjamin Otte
02572cdf7e calendar: Create one cairo_t per expose event and pass it around 2010-09-26 15:11:35 +02:00