* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Mathias Hasselmann
palette->priv->text_size_group = NULL;
}
+ if (palette->priv->settings_connection > 0)
+ {
+ g_signal_handler_disconnect (palette->priv->settings, palette->priv->settings_connection);
+ palette->priv->settings_connection = 0;
+ }
+
+ g_clear_object (&palette->priv->settings);
+
G_OBJECT_CLASS (gtk_tool_palette_parent_class)->dispose (object);
}
gint remaining_space = 0;
gint expand_space = 0;
- gint page_start, page_size = 0;
+ gint total_size, page_size;
gint offset = 0;
guint i;
guint border_width;
child_allocation.y += border_width;
child_allocation.y += offset;
- page_start = child_allocation.y;
+ total_size = child_allocation.y;
}
else
{
x += border_width;
x += offset;
- page_start = x;
+ total_size = x;
}
/* update the scrollbar to match the displayed adjustment */
if (adjustment)
{
- gdouble value, lower, upper;
+ gdouble lower, upper;
+
+ total_size = MAX (0, total_size);
+ page_size = MIN (total_size, page_size);
if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation ||
GTK_TEXT_DIR_LTR == direction)
{
lower = 0;
- upper = MAX (0, page_start);
-
- value = MIN (offset, upper - page_size);
- gtk_adjustment_clamp_page (adjustment, value, offset + page_size);
+ upper = total_size;
}
else
{
- lower = page_size - MAX (0, page_start);
+ lower = page_size - total_size;
upper = page_size;
offset = -offset;
-
- value = MAX (offset, lower);
- gtk_adjustment_clamp_page (adjustment, offset, value + page_size);
}
gtk_adjustment_configure (adjustment,
- value,
+ offset,
lower,
upper,
page_size * 0.1,
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
- | GDK_BUTTON_MOTION_MASK;
+ | GDK_BUTTON_MOTION_MASK
+ | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
+ | GDK_TOUCH_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
- gdk_window_set_user_data (window, widget);
+ gtk_widget_register_window (widget, window);
gtk_style_context_set_background (gtk_widget_get_style_context (widget),
window);
if (old_settings)
{
g_signal_handler_disconnect (old_settings, priv->settings_connection);
+ priv->settings_connection = 0;
g_object_unref (old_settings);
}
* GtkToolPalette:icon-size:
*
* The size of the icons in a tool palette is normally determined by
- * the #GtkSettings:toolbar-icon-size setting. When this property is set,
+ * the #GtkSettings:gtk-toolbar-icon-size setting. When this property is set,
* it overrides the setting.
*
* This should only be used for special-purpose tool palettes, normal
return palette->priv->style;
}
-gint
-_gtk_tool_palette_compare_groups (gconstpointer a,
- gconstpointer b)
+static gint
+gtk_tool_palette_compare_groups (gconstpointer a,
+ gconstpointer b)
{
const GtkToolItemGroupInfo *group_a = a;
const GtkToolItemGroupInfo *group_b = b;
group_new->pos = position;
group_old->pos = old_position;
- g_ptr_array_sort (palette->priv->groups, _gtk_tool_palette_compare_groups);
+ g_ptr_array_sort (palette->priv->groups, gtk_tool_palette_compare_groups);
gtk_widget_queue_resize (GTK_WIDGET (palette));
}
/**
* gtk_tool_palette_set_drag_source:
* @palette: a #GtkToolPalette
- * @targets: the #GtkToolPaletteDragTarget<!-- -->s
+ * @targets: the #GtkToolPaletteDragTargets
* which the widget should support
*
* Sets the tool palette as a drag source.
* @widget: a #GtkWidget which should be a drag destination for @palette
* @flags: the flags that specify what actions GTK+ should take for drops
* on that widget
- * @targets: the #GtkToolPaletteDragTarget<!-- -->s which the widget
+ * @targets: the #GtkToolPaletteDragTargets which the widget
* should support
* @actions: the #GdkDragAction<!-- -->s which the widget should suppport
*