Commit Graph

240 Commits

Author SHA1 Message Date
Matthias Clasen
68c1e83cf0 More label and image sizing fixes
Go back to respecting GtkMisc::xpad/ypad. Not doing so breaks
the misc-alignment reftest. As long as we still derive from
GtkMisc, we may as well do this.
2014-05-27 06:00:21 -04:00
Matthias Clasen
3b30cfa344 Fix up GtkLabel and GtkImage sizing
When GtkMisc was removed, I forgot to apply the style context
padding. This caused the info-bar-message-types reftest to fail.
2014-05-27 00:22:40 -04:00
Benjamin Otte
0430ae0ca5 image: Draw the image again
An important line of code was removed in
54d5b426fc that lead to an undefined
variable. Add that line back.
2014-05-24 19:38:56 +02:00
Benjamin Otte
b03d54b75f image: Remove unused variable 2014-05-24 16:16:32 +02:00
Matthias Clasen
54d5b426fc GtkImage: Drop use of GtkMisc::x/yalign
Instead, use GtkWidget::h/valign to position the image inside
the allocation. And just stop using GtkMisc::x/ypad.

https://bugzilla.gnome.org/show_bug.cgi?id=730613
2014-05-24 00:04:41 -04:00
Matthias Clasen
ec0a60a248 Deprecate GtkMisc
This has been dangling ever since 3.0.
2014-05-13 08:45:00 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
William Jon McCann
37a8ee6e95 docs: fully break lines in examples
Try to do a better job of keeping example content
from being too wide. It is often rendered as <pre>
text so the only time we can wrap it is in the source.

It is best to full break lines at all punctuation and
to try to keep the width under 70 chars or so.
2014-02-12 18:42:50 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
a3bad427c7 docs: don't use <application> tags 2014-02-04 18:01:24 -05:00
William Jon McCann
63e887e165 docs: replace all <examples> with markdown headings 2014-02-04 16:58:54 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
22586ea7c2 docs: use #*-struct instead of <structname> 2014-01-27 19:59:55 -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
Matthias Clasen
e5317f0f9a Improve struct packing in various places 2013-09-21 23:50:55 -04:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Kjell Ahlstedt
4d86472b92 Continue the deprecation of GtkIconSet
Deprecate gtk_icon_set_render_icon_surface() and gtk_image_get_icon_set(),
which take parameters of the deprecated GtkIconSet.

https://bugzilla.gnome.org/show_bug.cgi?id=703616
2013-07-09 06:54:27 -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
William Jon McCann
72c3879893 Add missing G_PARAM_DEPRECATED to stock deprecations 2013-07-08 15:39:55 -04:00
Alexander Larsson
31fc70721e GtkImage: Add new_from_surface() and set_from_surface() 2013-07-03 14:39:26 +02:00
Alexander Larsson
e042ffa71e GtkImage: Set the window on the gtkiconhelper 2013-07-03 14:39:26 +02:00
William Jon McCann
aef9dca9d5 Deprecate GtkIconFactory, GtkIconSet, GtkIconSource
We want to use GtkIconTheme instead. It is worth noting that
the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
2013-06-26 20:02:27 -04:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
William Jon McCann
02c793f24a Start migrating internals away from GtkStock 2013-06-24 22:20:49 -04:00
Matthias Clasen
c9ec4ba5a1 GtkImage: Fix the initial value of icon-size
Since we are pulling the icon-size out of the icon helper now,
we should set its icon-size when constructing it.
2013-06-15 20:23:01 -04:00
Paolo Borelli
d35596fe92 GtkImage: do not leak metrics in baseline align
https://bugzilla.gnome.org/show_bug.cgi?id=699020
2013-04-27 13:59:29 +02:00
Alexander Larsson
c630804647 GtkImage: Reuse previously calculated baseline_align in draw()
No need to recalculate this every time we draw.
2013-04-23 05:58:08 +02:00
Alexander Larsson
7523b25942 GtkImage: Support baselines
This uses the current font metrics to guess the baseline of the image.
Without this any non-centered baseline in buttons with images look weird.
2013-04-23 05:50:38 +02:00
Benjamin Otte
d1c642d1f5 image: Make gtk_image_new_from_resource() load animations
Requires new gdk-pixbuf APIs to load animations from resources.
2013-02-01 17:42:44 +01:00
Jasper St. Pierre
86f024ba0d gtkimage: Add GtkImage::resource property
This is designed for GtkBuilder scenarios:

    <object class="GtkImage" id="blah">
        <property name="resource">/org/myapp/blah.png</property>
    </object>

https://bugzilla.gnome.org/show_bug.cgi?id=692481
2013-01-24 17:47:34 -05:00
Dan Vrátil
4243c3a1e2 Fix a memory leak in GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=678175
2012-06-20 08:27:01 +02:00
Pavel Holejsovsky
7572325efb GtkImage: fix get_property('stock')
The code was trying to get icon's name instead of icon's stock-id.

https://bugzilla.gnome.org/show_bug.cgi?id=678407
2012-06-19 15:58:11 +02:00
Benjamin Otte
49c618c59c image: Don't add border twice
Failed to delete these lines in d40c496e6e
2012-06-15 03:30:52 +02:00
Benjamin Otte
d40c496e6e image: background and border should be drawn around the widget
... not around the contents. If you want the widget to not be larger
than the contents, don't use ALIGN_FILL.
2012-06-14 20:06:39 +02:00
Michael Vogt
19e55d620f GtkImage: Move g_clear_object() to gtk_image_finalize()
This moves the freeing of the icon_helper from the destory to the finalize
function to avoid segfaults when trying to access a destroyed object before it
is disposed. This often happens in signal handlers which get called
asynchronously after destroy.

https://bugzilla.gnome.org/show_bug.cgi?id=674050
2012-04-16 06:51:43 +02:00
Benjamin Otte
917ca6a802 gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
2012-04-05 15:48:51 +02:00
Cosimo Cecchi
e24fd5f463 image: handle PROP_STORAGE_TYPE in get_property()
Fallout from GtkIconHelper transition.
2012-03-02 12:48:52 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
4c2e53a468 Silence a compiler warning 2012-01-24 00:41:26 -05:00
Paolo Borelli
1326466309 Render background of a GtkImage
Useful to e.g. style the bg color of a symbolic icon
2012-01-23 21:03:05 +01:00
Paolo Borelli
e34589ddea Factor out _gtk_misc_get_padding_and_border
The new semi-private function will allow to implement support for css
padding and border in widgets inheriting from GtkMisc.
Use the new function for GtkLabel, GtkArrow and GtkImage.
2012-01-22 13:36:47 +01:00
Benjamin Otte
a213b0b33e image: Fix gcc warnings 2012-01-16 18:39:52 +01:00
Alexander Larsson
622b78c000 Add GtkImage constructors from resources
Atm you can't read back the resource path like
you can with filenames. Maybe we should add that.
2012-01-16 14:19:18 +01:00
Rui Matos
e3d38708ab image: Stop setting state flags on the style context for drawing 2011-12-19 19:21:16 +00:00
Cosimo Cecchi
1e23a74a95 image: take misc padding into account when calculating x/y draw coords
This fixes the misc-alignment.ui reftest.
2011-12-12 12:30:27 +01:00
Cosimo Cecchi
b215aeacc8 image: add gtk_image_get_preferred_size()
Add a function to query the preferred size of the GtkImage, and use it
in the get_preferred_width/height implementations.
2011-12-12 12:29:21 +01:00
Cosimo Cecchi
58b1f24d6d image: use the default icon size if no icon size is provided
If no icon size is provided (e.g. when setting icon-name or stock-id
using the GObject property directly), use the default icon size. This
matches the previous GtkImage behavior.
2011-11-30 19:47:52 -05:00
Cosimo Cecchi
0c68227270 image: minor cleanup 2011-11-30 19:47:52 -05:00
Cosimo Cecchi
772459979f image: simplify code
We can unconditionally call into the icon helper methods now that we
removed the g_return_val_if_fail() checks.
2011-11-30 19:06:38 -05:00
Cosimo Cecchi
f085dde830 image: port to GtkIconHelper
Use newly introduced GtkIconHelper to render pixbufs in GtkImage.
2011-11-30 16:39:59 -05:00
Matthias Clasen
2152424541 Convert GailImage to GtkImageAccessible 2011-07-05 16:08:53 -04:00
Juan A. Suarez Romero
c903ece96b image: Initialize variable 2011-06-14 09:49:23 +00:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Cosimo Cecchi
e6a3257b55 image: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Colin Walters
b90e8cfc36 gtkdnd: Add API that takes GIcon
This will be useful for me to port gnome-panel to gnome-menus 4, which
uses GAppInfo, which in turn returns icon references as GIcon.

https://bugzilla.gnome.org/show_bug.cgi?id=649295
2011-05-03 12:53:46 -04:00
Matthias Clasen
a65e25df83 GtkImagePrivate: Improve struct packing 2011-04-12 12:33:45 -04:00
Benjamin Otte
1483145806 API: image: Move private struct definitions into private header
They weren't privatized because the dnd code used them, too. But a
private header can allow the dnd code to be nasty, so go dnd code!
2011-02-08 08:58:49 +01:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Pavel Holejsovsky
6d5cdad56e [GI] Annotate strings holding file paths as (type filename) 2011-01-18 17:29:40 +01:00
Bastien Nocera
714d9bc407 GtkImage: Add "use-fallback" property
So that icon-name and GIcon type of GtkImages can use automatic
fallback names.
2011-01-18 16:14:05 +00:00
Carlos Garnacho
18502518f3 Make GtkImage use GtkStyleContext 2011-01-10 03:50:00 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Carlos Garcia Campos
2dde04140d GtkImage: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:13:43 +01:00
Matthias Clasen
53c2114356 Deprecate gtk_icon_info_load_symbolic_for_style
We might end removing it altogether since it is a bit silly to have
Since: 3.0
Deprecated: 3.0
2010-12-04 15:39:45 +01:00
Matthias Clasen
4ca87168d4 Remove size_reuqest from GtkImage 2010-10-26 23:16:40 -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
18e489fedd image: Fix up draw function
The previous port to the draw function was a tiny bit incomplete. This
patch should fix the remaining issues and remove unused variables.
2010-09-26 17:51:05 +02:00
Benjamin Otte
8929321cba image: Add a default case to switch statement to avoid gcc warnings 2010-09-26 15:11:42 +02:00
Benjamin Otte
7121ec2880 image: Port to draw vfunc 2010-09-26 15:11:35 +02:00
Benjamin Otte
c76221426a image: Always render the whole image
Otherwise effects like blur etc will have funny seams on repaints.
Oh, and also, the draw vfunc doesn't have an equivalent to event->area
;)
2010-09-26 15:11:35 +02:00
Benjamin Otte
b370cb0d4c API: image: Remove ability to set image from a pixmap 2010-09-26 15:11:11 +02:00
Javier Jardón
a48d28848e gtk/gtkimage.c: use accessor functions to access GtkWidget 2010-09-08 21:13:03 +02:00
Tristan Van Berkom
9934007420 Completely removed requisition cache from GtkWidget instance structure.
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().
2010-09-08 18:50:24 +02:00
Tor Lillqvist
4491bdbb9d Drop Win32 DLL ABI compatibility cruft
No need for that any longer as we are changing DLL name.
2010-08-30 14:57:48 +03:00
Javier Jardón
1e5d7c0225 Use GtkFooPrivate instead GtkFooPriv 2010-08-27 04:48:23 +02:00
Benjamin Otte
24a867f8da image: remove GdkImage as a possible image type
GdkImage is about to be deprecated.
2010-08-10 21:02:25 +02:00
Benjamin Otte
8f6a014de4 image: Use Cairo instead of gdk_draw_drawable() 2010-07-26 16:42:46 +02:00
Benjamin Otte
847d401df3 image: replace gdk_draw_pixbuf() call with Cairo equivalent 2010-07-26 16:42:46 +02:00
Javier Jardón
978a031b76 Use accessor functions to access GtkMisc 2010-07-13 19:40:49 +02:00
Javier Jardón
86f0bd5cc9 GtkImage: move public members to private structure 2010-07-13 19:40:48 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Matthias Clasen
e9fc660d7e Add a variant of gtk_icon_theme_load_symbolic that takes a style
As proposed by Owen in bug 621578 to reduce code duplication.
2010-06-14 23:46:46 -04:00
Christian Dywan
7fd68866fe Remove deprecated GtkImage functions 2010-05-03 01:39:49 +02:00
Matthias Clasen
6b939d57c7 Support 'symbolic' themed icons
Add gtk_icon_info_load_symbolic() to load symbolic icons, and
theme their background/foreground colours to match the
colours used in the theme.

Adds the gtk_icon_info_load_symbolic() function, explicit
support in GtkImage and GtkCellRendererPixbuf, and test cases
for those 2 widgets.

With help from Bastien Nocera <hadess@hadess.net>

https://bugzilla.gnome.org/show_bug.cgi?id=614711
2010-04-28 12:02:05 +01:00
Javier Jardón
32b9aeaadd Don't use GTK_WIDGET_STATE in internal code anymore
Use gtk_widget_get/set_state() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-09 02:40:17 +01:00
Javier Jardón
24bafd8693 Don't use GTK_WIDGET_*SET_FLAGS (wid, GTK_NO_WINDOW)
Use new API instead: gtk_widget_set_has_window ()

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-06 11:37:06 +01:00
Javier Jardón
1fe7d3cefd Deprecate widget flag: GTK_WIDGET_MAPPED
Use gtk_widget_get_mapped() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-03 20:19:03 +01:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Javier Jardón
e62e7f76c9 Move documentation to inline comments: GtkImage
https://bugzilla.gnome.org/show_bug.cgi?id=597865
2009-12-21 06:34:10 +01:00
Dan Winship
0b4af241b6 Change GtkIconSize to int in params/return values
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.

https://bugzilla.gnome.org/show_bug.cgi?id=604895
2009-12-19 10:32:35 +01:00
Dan Winship
6afa3b9507 Fix out/transfer annotations on GtkImage getters
https://bugzilla.gnome.org/show_bug.cgi?id=604895
2009-12-19 10:32:35 +01:00
Colin Walters
6529c07614 [introspection] Merge in Gtk-custom.c annotations
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations.  Merge those into the GTK source files.

Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-12-16 17:22:01 -02:00
Christian Persch
ba218a7789 Make setting the icon-size property on GTK_IMAGE_GICON images work
Bug #602725.
2009-11-23 17:03:55 +01:00
Matthias Clasen
1dbfcf484b Fix a problem in GtkImage size allocation
When GtkMisc padding is set on an image, the optimization for only
recalculating size after a clear() breaks, since the requisition is
not (0, 0). We need a separate 'need_calc' flag.
2009-10-18 01:38:44 -04:00