… GimpIntComboBox "value" property.
For this, I connect to the "changed" signal, which is equivalent anyway.
Otherwise the link was not bidirectionnal, so selecting a new item in
the combo list was not actually changing the internal value, hence the
binding set by gimp_prop_int_combo_box_new() was not complete either.
Not sure how I missed that. Hopefully not missing anything else!
… and have gimp_prop_int_combo_box_new() bind to "value" instead of
"active".
The "active" property is defined by GtkComboBox and is the index of the
combo box, not its values, whereas with gimp_prop_int_combo_box_new(),
we want to bind an int property to the combobox value. Therefore the
commit 0828a371c2 was only properly working when we were creating a
combo box with values starting at 0 and incremented by 1.
By adding a "value" property to GimpIntComboBox, I allow binding any
property to the int value rather than the index.
See also !265 where the issue was raised as it affected our HEIF
plug-in.
to match gimp_int_combo_box_new(), and add gimp_int_store_new_valist().
Move the va_list of (name, value) parsing code to
gimp_int_store_new_valist() and use it from
gimp_int_combo_box_new_valist().
This makes the entire GimpIntStore/GimpIntComboBox stuff useable much
more generically for the price of an incompatible change of a public
function that is used exactly once outside of libgimpwidgets.
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.
Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
The old hack doesn't work any longer, there is only one cell layout in
GTK+ 3.x, not separate ones for the button and the popup. Switch back
to recreating the cells in notify::popup-shown.
Also simplify the code, we only need to remember one cell renderer in
our struct, and remove manual resizing code that was only needed in
older GTK+ 2.x vrsions.
even if we don't have private members (yet). Also make class padding 8
pointers in all headers. This commit moves nothing to private, it just
makes all headers consistent and adjusts .c files accordigly.
The "layout" proerty controls the combo-box layout (but not its
menu layout), and can be one of:
- ICON_ONLY: Only show icons.
- ABBREVIATED: Show icons and abbreviated labels (or full
labels, when there is no abbreviation).
- FULL: Show icons and full labels. Default.
Avoid reconstructing the combo's cell-layout when the menu is
shown/hidden, by maintaining the combo's cell-layout and the menu's
cell-layout separately (probably a terrible hack, but one we already
use :P).
Use a GType for the PROP_SYMMETRY property of GimpImage, and create
a default "identity" symmetry for an image.
I still use a GimpIntComboBox but store the property value in the
user-data column because gpointer isn't a subset of gint.
Adds in libgimpwidgets:
- gimp_int_combo_box_set_active_by_user_data()
- gimp_int_combo_box_get_active_user_data()
- gimp_int_store_lookup_by_user_data()
- gimp_prop_pointer_combo_box_new() to create a GimpIntComboBox and
attach it to a gpointer property.
Thanks Massimo and Mitch for reviewing my code.
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
If set, the label is displayed left-aligned inside the combo box, and
the normal content moves to the right. Reconfigure the combo's
contents when the popup is shown/hidden, so the popup widget is not
affected by the label. This requires an evil hack because of a bug in
GtkCellView. The hack automatically disables itself once GTK+ 2.24.19
(which has a fix) is used.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-12-28 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_init):
use
the canonical spelling for the 'stock-id' property.
svn path=/trunk/; revision=27839
2006-01-25 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.[ch]
* libgimpwidgets/gimppageselector.[ch]
* libgimpwidgets/gimpzoommodel.[ch]: added a priv pointer to the
instance struct and changed the GET_PRIVATE() macro to access the
private data via that pointer.
* libgimpwidgets/gimpscrolledpreview.[ch]
* libgimpwidgets/gimpwidgets.def: added a priv pointer to the
instance struct and moved all private data to the
GimpScrolledPreviewPrivate struct. Added freeze/thaw methods so
that derived widgets can be implemented without accessing private
data.
* libgimp/gimpzoompreview.c: changed accordingly.
* libgimp/gimpfontselectbutton.[ch]: let the priv pointer be an
anonymous void pointer.
2005-12-20 Michael Natterer <mitch@gimp.org>
* libgimp/*.c
* libgimpconfig/*.c
* libgimpmodule/*.c
* libgimpthumb/*.c
* libgimpwidgets/*.c: port to G_DEFINE_TYPE() and friends. Some
related cleanup.
2005-09-27 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c: document how to construct an
empty GimpIntComboBox using g_object_new().
* plug-ins/common/aa.c
* plug-ins/common/channel_mixer.c
* plug-ins/common/compose.c
* plug-ins/common/decompose.c
* plug-ins/common/newsprint.c
* plug-ins/common/spheredesigner.c
* plug-ins/gflare/gflare.c
* plug-ins/pagecurl/pagecurl.c: use g_object_new() to construct an
empty GimpIntComboBox. The old way of doing it caused warnings.
2005-06-23 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_new_valist)
(gimp_int_combo_box_new_array): no need to create a new list store;
gimp_int_combo_box_init() already did that for us.
2005-02-27 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c: added an "ellipsize" construct
property and changed the default behaviour back to not doing
ellipsation on the text.
* libgimp/gimpimagecombobox.c
* libgimp/gimpdrawablecombobox.c: set "ellipsize" to middle for
drawable and image combo boxes.
2005-02-17 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontainercombobox.c
* libgimpwidgets/gimpintcombobox.c: set the "ellipsize" property
on the text cell-renderer. Not sure if it's a good idea to
hardcode this for GimpIntComboBox, but let's give it a try. Fixes
bug #136676.
2004-04-22 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.c (gimp_int_combo_box_new):
removed the check for first_label != NULL. Passing a NULL label
makes a perfect empty combo_box.
* plug-ins/common/newsprint.c
* plug-ins/common/spheredesigner.c: ported from GtkOptioMenu to
GimpIntComboBox.