Seems commit 7b42d4feda makes
GtkSpinner a direct subclass of GtkWidget but forgets to
update the header file to include gtkwidget.h instead and
declare the instance and class structures properly (assuming
this was just a missed file in the commit).
Originally the GtkSizeRequestIface patches left GtkSizeGroup working
only by bumping the minimum sizes - this commit fixes size groups to take
both minimum and natural requests into account.
Since the location button is hidden in save mode, we need to add the
path bar to the size group too. The location button still has to be in
the group though, because it's larger than the path bar (when
shown). Instead of using the recent/search icons, add their hboxes so
that themed widget spacings don't introduce variations.
With this new approach at request and allocate time, the average child size
is used to determine a good guess at how many columns will fit the box
width; afterwards extra columns are appended and checked to fit.
Then the row heights are calculated based on height-for-width of each
child in the row which now may have individual widths.
The detail strings now have more "detail" by default, so gtkstyle.c
needed to be updated to properly handle this. Tests like testtreeview,
testtreesort now have proper background drawing again.
This strncmp trick was the best I could think of so quickly, if anybody
has an idea to do this in a better way, let me know.
h-align = START,END,CENTER,FILL
v-align = START,END,CENTER,FILL
margin-left,right,top,bottom
margin
These should obsolete all such similar properties on
layout containers, GtkMisc, GtkAlignment, GtkContainer::border-width
Margin is outside the size request.
If margin were not outside the set_size_request() it would not work the
same way as container-supplied (child property) padding.
Conceptually set_size_request() forces the value from the subclass
(the original unadjusted request) and then we go on to adjust
the request further by adding the margin.
A subclass calls gtk_container_class_handle_border_width()
in its class_init
This marks the subclass as expecting GtkContainer to deal with
border width automatically, which GtkContainer then does.
Use these new methods to handle set_size_request (aka aux_info)
inside gtkwidget.c, instead of having external code mess with it.
The virtual functions can be used for other purposes in the
future. For example, GtkContainer::border_width could be
automatically implemented for all container subclasses.
Did not update uses in other files because the plan is to
get rid of those other uses anyhow. So don't want to make
this function available in the header.
This is better than peeking aux info then testing != NULL
in several ways:
- it returns const aux info so if we don't create we can't write
- it ensures that the default we assume if aux_info is NULL is
the same as the default we set if we've created the aux info
- it avoids typing in != NULL checks
We are not re-entrant and there is no reason for widgets to
do this, most likely they'll just get unexpected bugs because
the wrappers may modify the request.
Computing the request should logically rely only on the
widget itself, not on any adjustments caused by set_size_request,
size groups, and so forth.
https://bugzilla.gnome.org/show_bug.cgi?id=628829
In GtkBin and GtkWidget we tried to provide handy defaults that
call get_width if there's no get_width_for_height and
get_height for get_height_for_width.
However, they used the wrapper API on GtkSizeRequest instead of
chaining directly to the other method implementation.
This could result in all kinds of surprising behavior, for example,
get_width_for_height() would now already include the effects of set_size_request().
If nothing else it's inefficient. But it's just conceptually wrong,
because to chain to another implementation, we should call the other
implementation, not call a wrapper around the other implementation
(when we're already inside a previous invocation of the wrapper,
i.e. compute_size_for_orientation() ends up reinvoking itself
in the same orientation on the same object which it pretty
likely isn't intending to do)
https://bugzilla.gnome.org/show_bug.cgi?id=628829
32K of border ought to be enough for any pixel dimensions. At least
until screens are so huge we start using doubles.
This saves a nice 64 bits of space when we have a GtkBorder
stored somewhere.
Signed integers are used to avoid surprising unsigned math
issues. Just search GTK's whole git log from inception
for "unsigned" if you want to find any number of commits
fixing signed/unsigned bugs.
https://bugzilla.gnome.org/show_bug.cgi?id=629387
When writing the original code I erroneously assumed that the current
point of the cairo context would be saved by cairo_save/restore(), but
of course the current point is part of the path and therefor isn't
saved.
Also do a cairo_new_path() before rendering any text so that we are sure
the text ends up at the right spot.
gtk_widget_set_window() does not add a reference to the
owned window... this is an exception to most gtk_foo_set_bar()
functions where as it acts as if it were named gtk_widget_take_window().
Adding note to the docs to avoid people giving the window to the
widget and naturally proceeding to unref the window.
Fixed issues in my previous patch for bug 626939 removing GtkRequisition
cache: these widgets monitor the previous requested size and decide whether
to queue a resize when the content changes based on it's prior request.
Now that we have a private data installed directly on
the GtkWidget instance it makes no sense to cache the size
requests on widget qdata. This change will generally make
GTK+ memory less fragmented as well as significantly speed
up the size request process.
Rename the gtk_major_version() etc functions I introduced yesterday to
start with gtk_get. Avoids misleading results in client programs whose
developers that don't notice the change or the compiler warnings, and
when recompiling against gtk3 then use the function addresses as the
version numbers.
With the demise of GtkList and GtkTree, it has GtkMenuItem as sole
derived class, and is not really adding any value as a separate class.
Its few useful features have been merged into GtkMenuItem.
Bug 629104
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.
For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.
Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
Especially the gtk_*_type ones in gtktexttypes.h were mentioned in
gtk.symbols presumably by accident. That header isn't even installed,
so no way can they be supposed to be public.
gtk_text_attr_appearance_type is from the installed but "semi-private"
gtktextlayout.h, so drop that one too from gtk.symbols for now.
The use of gtk_text_unknown_char_utf8 is bit of a mess. Code in a few
files knew implicitly that it is three bytes. Define a symbolic name
for the length of it instead. Add an exported function
gtk_text_unknown_char_utf8_gtk_tests_only() that returns a pointer to
it just for the sake of gtk/tests/textbuffer.c. Prefix the variable
with an underscore.
I doubt the usefulness of the test_utf8() in textbuffer.c. If it could
be dropped, gtk_text_unknown_char_utf8_gtk_tests_only() could be
dropped, too.
Preferrably should be made just into a local variable for libgtk like
_gdk_debug_flags for libgdk. But for now used by
gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
Having variables exported from a DLL is slightly painful and
potentially error-prone on Windows, so let's try get rid of them now
when we can. Starting with these.
Since we have a new mechanism for requesting sizes: GtkSizeRequestIface;
it makes no sense to maintain this cache on the GtkWidget structure...
removing the requisition cache however does not break the old "size-request"
signal which is there for backwards compatability reasons.
In any case widget->requisition should not have been accessed,
gtk_widget_get_child_requisition() would have been the correct way
to consult the cache.
This commit also deprecates the newly added gtk_widget_get_requisition()
API and makes it fallback on gtk_size_request_get_size().
* this mirrors the committed change for gtk_radio_action_join_group in
commit 85b53969b2
* Due to object ownership issues it is impossible to correctly use
get_group/set_group from a GI binding
* join_group is safer because at the binding level it works with individual
GtkRadioButton objects and not with the list of objects that gets
modified in the library
https://bugzilla.gnome.org/show_bug.cgi?id=628935
These members of GtkWidgetAuxData can no longer be set after
the removal of deprecated gtk_widget_set_uposition(), now removed
these members completely and removed the access to them from
gtk_widget_size_allocate().
_gtk_window_reposition() was only some extra confusing code, internally
it only calls the public API gtk_window_move()... replaced calls to
_gtk_window_reposition() with direct calls to gtk_window_move() and
removed the redundant internal API (probably there only for some historical
reason).
This recovers 10 bits, since state and saved_state as uint8 both
wasted 5 bits. Now we can add 10 more flags.
Also, a possible future patch could just do 1-bit bitfields
for the private flags instead of using manual bit twiddling.
https://bugzilla.gnome.org/show_bug.cgi?id=628884
Made an enum GtkWrapBoxPacking for the expand/fill horizontal/vertical
boolean options... changed xpadding/ypadding to be horizontal-padding
and vertical-padding for a more consistent api and better readablility.
GtkNotebook was filling widget->requisition directly at "size-request"
time instead of filling in the *requsition argument, also (more importantly)
at size_allocate time GtkNotebook was consulting the action widget's
widget->requisition directly instead of safely calling
gtk_widget_get_child_requisition(). This commit closes bgo #628068.
Rename the ::orientation property of GtkIconView to item-orientation,
which is both clearer and avoids the conflict with the orientation
property of GtkOrientable implementations.
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
This was a style property to let theme engines 'opt-in' to more
correct behaviour while maintaining compatibility with existing
themes. GTK+ 3 engines are expected to handle the more correct
behaviour.
It seems with latest GSEAL work for widget->window access a
call to gtk_widget_set_window() was missed (added the window
assignment and now the palette shows up in Glade again).
The GtkSubmenuDirection and GtkSubmenuPlacement enumerations
have been deprecated as public API for a while, but are still used
internally in the menu code. Move them to a private header. This
also prevents to generation of GObject boilerplate for these enums.
We had code that tried to prevent selecting the text in the label
if we end up focusing a label, but it didn't take effect, because
we were moving the focus into the label again afterwards.
When a file was inserted during the period that the editable row was
active, the node IDs would not get updated correctly.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
gtk_window_get_group() never returns NULL; if the window isn't in a group,
a default window group is returned instead. Use gtk_window_has_group() instead.
This fixes some previous commits to use accessors to access GtkWindow.
Reported by Philip Withnall in bug
https://bugzilla.gnome.org/show_bug.cgi?id=627828