Compare commits
20 Commits
wip-vulkan
...
3.18.2
Author | SHA1 | Date | |
---|---|---|---|
|
1ed442180d | ||
|
8342724022 | ||
|
78a59caed9 | ||
|
5d70f4bd44 | ||
|
c1b1e41ddb | ||
|
a8dc876e02 | ||
|
7394270efa | ||
|
cbc8d4a88a | ||
|
da2f672c11 | ||
|
ca9440c21e | ||
|
bd46d285d3 | ||
|
3b0056ae1a | ||
|
d19b3d2c74 | ||
|
47cee3521a | ||
|
b06cb4b9d1 | ||
|
f561bdb3eb | ||
|
d4e644ec52 | ||
|
ee856fd30d | ||
|
b9d4591949 | ||
|
e1ec1497a8 |
17
NEWS
17
NEWS
@@ -1,3 +1,20 @@
|
||||
Overview of Changes in GTK+ 3.18.2
|
||||
==================================
|
||||
|
||||
* Bug fixes:
|
||||
753371 Bad focus order in GtkFlowBox
|
||||
755413 Bug in _gtk_text_btree_get_iter_at_last_toggle()
|
||||
755791 GtkSwitch: unclip css box-shadow on the slider
|
||||
755927 Occasional "stuck key" after closing window using keyboard shortcut...
|
||||
755988 gtk printer dialog won't print jobs with names exceeding 255 charac...
|
||||
756042 GtkAssistant: Segfault after g_object_run_dispose(page)
|
||||
756195 GtkColorChooser: Plus/checkmark icons are blurry in hidpi
|
||||
756338 applications segfaults on 3.18.1 when using external themes
|
||||
|
||||
* Translation updates:
|
||||
Finnish
|
||||
German
|
||||
|
||||
Overview of Changes in GTK+ 3.18.1
|
||||
==================================
|
||||
|
||||
|
@@ -109,7 +109,7 @@ copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\gli
|
||||
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas
|
||||
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas
|
||||
echo "Compiling gsettings XML Files..."
|
||||
$(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
|
||||
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
|
||||
</GtkDoInstall>
|
||||
<GtkDoInstallBroadwayHeaders>
|
||||
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
|
||||
|
@@ -112,7 +112,7 @@ copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\s
|
||||
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas

|
||||
|
||||
echo "Compiling gsettings XML Files..."

|
||||
$(CopyDir)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas

|
||||
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas

|
||||
"
|
||||
/>
|
||||
<UserMacro
|
||||
|
@@ -10,8 +10,8 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [18])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_interface_age], [1])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
|
@@ -1191,15 +1191,14 @@ keyboard_handle_leave (void *data,
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||
return;
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
|
||||
/* gdk_window_is_destroyed() might already return TRUE for
|
||||
* device->keyboard_focus here, which would happen if we destroyed the
|
||||
* window before loosing keyboard focus.
|
||||
*/
|
||||
|
||||
stop_key_repeat (device);
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
@@ -29,7 +29,7 @@
|
||||
/**
|
||||
* gdk_win32_display_set_cursor_theme:
|
||||
* @display: (type GdkWin32Display): a #GdkDisplay
|
||||
* @theme: (allow-none) the name of the cursor theme to use, or %NULL to unset
|
||||
* @name: (allow-none) the name of the cursor theme to use, or %NULL to unset
|
||||
* a previously set value
|
||||
* @size: the cursor size to use, or 0 to keep the previous size
|
||||
*
|
||||
|
@@ -52,7 +52,7 @@ GType gdk_win32_display_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_3_18
|
||||
void gdk_win32_display_set_cursor_theme (GdkDisplay *display,
|
||||
const gchar *theme,
|
||||
const gchar *name,
|
||||
gint size);
|
||||
|
||||
G_END_DECLS
|
||||
|
@@ -88,6 +88,7 @@ struct _GtkAssistantPage
|
||||
|
||||
gchar *title;
|
||||
|
||||
GtkWidget *box;
|
||||
GtkWidget *page;
|
||||
GtkWidget *regular_title;
|
||||
GtkWidget *current_title;
|
||||
@@ -184,7 +185,7 @@ static void on_assistant_cancel (GtkWidget *wid
|
||||
GtkAssistant *assistant);
|
||||
static void on_assistant_last (GtkWidget *widget,
|
||||
GtkAssistant *assistant);
|
||||
static void assistant_remove_page_cb (GtkNotebook *notebook,
|
||||
static void assistant_remove_page_cb (GtkContainer *container,
|
||||
GtkWidget *page,
|
||||
GtkAssistant *assistant);
|
||||
|
||||
@@ -1113,7 +1114,7 @@ on_page_notify_visibility (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
assistant_remove_page_cb (GtkNotebook *notebook,
|
||||
assistant_remove_page_cb (GtkContainer *container,
|
||||
GtkWidget *page,
|
||||
GtkAssistant *assistant)
|
||||
{
|
||||
@@ -1122,15 +1123,6 @@ assistant_remove_page_cb (GtkNotebook *notebook,
|
||||
GList *page_node;
|
||||
GList *element;
|
||||
|
||||
if (GTK_IS_BOX (page))
|
||||
{
|
||||
GList *children;
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (page));
|
||||
page = GTK_WIDGET (children->data);
|
||||
g_list_free (children);
|
||||
}
|
||||
|
||||
element = find_page (assistant, page);
|
||||
if (!element)
|
||||
return;
|
||||
@@ -1367,7 +1359,7 @@ find_page (GtkAssistant *assistant,
|
||||
while (child)
|
||||
{
|
||||
GtkAssistantPage *page_info = child->data;
|
||||
if (page_info->page == page)
|
||||
if (page_info->page == page || page_info->box == page)
|
||||
return child;
|
||||
|
||||
child = child->next;
|
||||
@@ -1816,9 +1808,12 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
|
||||
gtk_widget_show (box);
|
||||
gtk_box_pack_start (GTK_BOX (box), page, TRUE, TRUE, 0);
|
||||
g_object_set (box, "margin", 12, NULL);
|
||||
g_signal_connect (box, "remove", G_CALLBACK (assistant_remove_page_cb), assistant);
|
||||
|
||||
gtk_notebook_insert_page (GTK_NOTEBOOK (priv->content), box, NULL, position);
|
||||
|
||||
page_info->box = box;
|
||||
|
||||
if (gtk_widget_get_mapped (GTK_WIDGET (assistant)))
|
||||
{
|
||||
update_buttons_state (assistant);
|
||||
@@ -2415,7 +2410,7 @@ gtk_assistant_set_page_has_padding (GtkAssistant *assistant,
|
||||
{
|
||||
page_info->has_padding = has_padding;
|
||||
|
||||
g_object_set (gtk_widget_get_parent (page),
|
||||
g_object_set (page_info->box,
|
||||
"margin", has_padding ? 12 : 0,
|
||||
NULL);
|
||||
|
||||
|
@@ -118,6 +118,7 @@ swatch_draw (GtkWidget *widget,
|
||||
GtkBorder border, padding;
|
||||
GdkRectangle rect;
|
||||
GtkIconInfo *icon_info = NULL;
|
||||
gint scale;
|
||||
|
||||
theme = gtk_icon_theme_get_default ();
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
@@ -168,11 +169,13 @@ swatch_draw (GtkWidget *widget,
|
||||
|
||||
gtk_render_frame (context, cr, 0, 0, width, height);
|
||||
|
||||
scale = gtk_widget_get_scale_factor (widget);
|
||||
if (swatch->priv->icon)
|
||||
{
|
||||
icon_info = gtk_icon_theme_lookup_icon (theme, swatch->priv->icon, PIXBUF_SIZE,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK
|
||||
| GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
icon_info = gtk_icon_theme_lookup_icon_for_scale (theme, swatch->priv->icon, PIXBUF_SIZE,
|
||||
scale,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK
|
||||
| GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
}
|
||||
else if ((state & GTK_STATE_FLAG_SELECTED) != 0)
|
||||
{
|
||||
@@ -182,9 +185,10 @@ swatch_draw (GtkWidget *widget,
|
||||
/* fallback for themes that don't have object-select-symbolic */
|
||||
g_themed_icon_append_name (G_THEMED_ICON (gicon), "gtk-apply");
|
||||
|
||||
icon_info = gtk_icon_theme_lookup_by_gicon (theme, gicon, PIXBUF_SIZE,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK
|
||||
| GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, gicon, PIXBUF_SIZE,
|
||||
scale,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK
|
||||
| GTK_ICON_LOOKUP_USE_BUILTIN);
|
||||
g_object_unref (gicon);
|
||||
}
|
||||
|
||||
@@ -206,14 +210,16 @@ swatch_draw (GtkWidget *widget,
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info, context,
|
||||
NULL, NULL);
|
||||
|
||||
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info, context, NULL, NULL);
|
||||
if (pixbuf != NULL)
|
||||
{
|
||||
gtk_render_icon (context, cr, pixbuf,
|
||||
rect.x + (rect.width - gdk_pixbuf_get_width (pixbuf)) / 2,
|
||||
rect.y + (rect.height - gdk_pixbuf_get_height (pixbuf)) / 2);
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, scale, gtk_widget_get_window (widget));
|
||||
gtk_render_icon_surface (context, cr, surface,
|
||||
rect.x + (rect.width - (gdk_pixbuf_get_width (pixbuf) / scale)) / 2,
|
||||
rect.y + (rect.height - (gdk_pixbuf_get_height (pixbuf) / scale)) / 2);
|
||||
cairo_surface_destroy (surface);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
|
@@ -947,7 +947,10 @@ _gtk_file_consider_as_remote (GFile *file)
|
||||
const gchar *type;
|
||||
|
||||
type = g_file_info_get_attribute_string (info, "filesystem::type");
|
||||
is_remote = g_strv_contains (remote_types, type);
|
||||
if (type != NULL)
|
||||
is_remote = g_strv_contains (remote_types, type);
|
||||
else
|
||||
is_remote = FALSE;
|
||||
|
||||
g_object_unref (info);
|
||||
}
|
||||
|
@@ -292,6 +292,23 @@ gtk_flow_box_child_focus (GtkWidget *widget,
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
/* Without "can-focus" flag try to pass the focus to the child immediately */
|
||||
if (!gtk_widget_get_can_focus (widget))
|
||||
{
|
||||
if (child)
|
||||
{
|
||||
if (gtk_widget_child_focus (child, direction))
|
||||
{
|
||||
GtkFlowBox *box;
|
||||
box = gtk_flow_box_child_get_box (GTK_FLOW_BOX_CHILD (widget));
|
||||
if (box)
|
||||
gtk_flow_box_update_cursor (box, GTK_FLOW_BOX_CHILD (widget));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_object_get (widget, "has-focus", &had_focus, NULL);
|
||||
if (had_focus)
|
||||
{
|
||||
@@ -3193,6 +3210,12 @@ gtk_flow_box_focus (GtkWidget *widget,
|
||||
GSequenceIter *iter;
|
||||
GtkFlowBoxChild *next_focus_child;
|
||||
|
||||
/* Without "can-focus" flag fall back to the default behavior immediately */
|
||||
if (!gtk_widget_get_can_focus (widget))
|
||||
{
|
||||
return GTK_WIDGET_CLASS (gtk_flow_box_parent_class)->focus (widget, direction);
|
||||
}
|
||||
|
||||
focus_child = gtk_container_get_focus_child (GTK_CONTAINER (box));
|
||||
next_focus_child = NULL;
|
||||
|
||||
@@ -3313,7 +3336,7 @@ gtk_flow_box_toggle_cursor_child (GtkFlowBox *box)
|
||||
gtk_flow_box_select_and_activate (box, priv->cursor_child);
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
GtkMovementStep step,
|
||||
gint count)
|
||||
@@ -3331,6 +3354,10 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
GtkAdjustment *adjustment;
|
||||
gboolean vertical;
|
||||
|
||||
/* Without "can-focus" flag fall back to the default behavior immediately */
|
||||
if (!gtk_widget_get_can_focus (GTK_WIDGET (box)))
|
||||
return FALSE;
|
||||
|
||||
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
|
||||
|
||||
if (vertical)
|
||||
@@ -3479,17 +3506,25 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
|
||||
if (!gtk_widget_keynav_failed (GTK_WIDGET (box), direction))
|
||||
{
|
||||
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
|
||||
|
||||
if (toplevel)
|
||||
gtk_widget_child_focus (toplevel,
|
||||
direction == GTK_DIR_UP ?
|
||||
GTK_DIR_TAB_BACKWARD :
|
||||
GTK_DIR_TAB_FORWARD);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* If the child has its "can-focus" property set to FALSE then it will
|
||||
* not grab the focus. We must pass the focus to its child directly.
|
||||
*/
|
||||
if (!gtk_widget_get_can_focus (GTK_WIDGET (child)))
|
||||
{
|
||||
GtkWidget *subchild;
|
||||
|
||||
subchild = gtk_bin_get_child (GTK_BIN (child));
|
||||
if (subchild)
|
||||
{
|
||||
GtkDirectionType direction = count < 0 ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD;
|
||||
gtk_widget_child_focus (subchild, direction);
|
||||
}
|
||||
}
|
||||
|
||||
get_current_selection_modifiers (GTK_WIDGET (box), &modify, &extend);
|
||||
@@ -3497,6 +3532,7 @@ gtk_flow_box_move_cursor (GtkFlowBox *box,
|
||||
gtk_flow_box_update_cursor (box, child);
|
||||
if (!modify)
|
||||
gtk_flow_box_update_selection (box, child, FALSE, extend);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Selection {{{2 */
|
||||
@@ -3845,8 +3881,6 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
|
||||
* The ::move-cursor signal is a
|
||||
* [keybinding signal][GtkBindingSignal]
|
||||
* which gets emitted when the user initiates a cursor movement.
|
||||
* If the cursor is not visible in @text_view, this signal causes
|
||||
* the viewport to be moved instead.
|
||||
*
|
||||
* Applications should not connect to it, but may emit it with
|
||||
* g_signal_emit_by_name() if they need to control the cursor
|
||||
@@ -3859,14 +3893,17 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
|
||||
* - Arrow keys move by individual children
|
||||
* - Home/End keys move to the ends of the box
|
||||
* - PageUp/PageDown keys move vertically by pages
|
||||
*
|
||||
* Returns: %TRUE to stop other handlers from being invoked for the event.
|
||||
* %FALSE to propagate the event further.
|
||||
*/
|
||||
signals[MOVE_CURSOR] = g_signal_new (I_("move-cursor"),
|
||||
GTK_TYPE_FLOW_BOX,
|
||||
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
||||
G_STRUCT_OFFSET (GtkFlowBoxClass, move_cursor),
|
||||
NULL, NULL,
|
||||
_gtk_marshal_VOID__ENUM_INT,
|
||||
G_TYPE_NONE, 2,
|
||||
_gtk_marshal_BOOLEAN__ENUM_INT,
|
||||
G_TYPE_BOOLEAN, 2,
|
||||
GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT);
|
||||
/**
|
||||
* GtkFlowBox::select-all:
|
||||
|
@@ -61,7 +61,7 @@ struct _GtkFlowBoxClass
|
||||
void (*selected_children_changed) (GtkFlowBox *box);
|
||||
void (*activate_cursor_child) (GtkFlowBox *box);
|
||||
void (*toggle_cursor_child) (GtkFlowBox *box);
|
||||
void (*move_cursor) (GtkFlowBox *box,
|
||||
gboolean (*move_cursor) (GtkFlowBox *box,
|
||||
GtkMovementStep step,
|
||||
gint count);
|
||||
void (*select_all) (GtkFlowBox *box);
|
||||
|
@@ -698,6 +698,8 @@ static void
|
||||
do_post_parse_initialization (int *argc,
|
||||
char ***argv)
|
||||
{
|
||||
GdkDisplayManager *display_manager;
|
||||
|
||||
if (gtk_initialized)
|
||||
return;
|
||||
|
||||
@@ -737,7 +739,11 @@ do_post_parse_initialization (int *argc,
|
||||
_gtk_modules_init (argc, argv, NULL);
|
||||
}
|
||||
|
||||
g_signal_connect (gdk_display_manager_get (), "notify::default-display",
|
||||
display_manager = gdk_display_manager_get ();
|
||||
if (gdk_display_manager_get_default_display (display_manager) != NULL)
|
||||
_gtk_accessibility_init ();
|
||||
|
||||
g_signal_connect (display_manager, "notify::default-display",
|
||||
G_CALLBACK (default_display_notify_cb),
|
||||
NULL);
|
||||
}
|
||||
|
@@ -871,6 +871,11 @@ gtk_popover_update_shape (GtkPopover *popover)
|
||||
GdkWindow *win;
|
||||
cairo_t *cr;
|
||||
|
||||
#ifdef GDK_WINDOWING_WAYLAND
|
||||
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
|
||||
return;
|
||||
#endif
|
||||
|
||||
win = gtk_widget_get_window (widget);
|
||||
surface =
|
||||
gdk_window_create_similar_surface (win,
|
||||
|
@@ -1606,6 +1606,7 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
|
||||
const gchar *job_name)
|
||||
{
|
||||
GtkPrintOperationPrivate *priv;
|
||||
gchar *end;
|
||||
|
||||
g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
|
||||
g_return_if_fail (job_name != NULL);
|
||||
@@ -1613,7 +1614,25 @@ gtk_print_operation_set_job_name (GtkPrintOperation *op,
|
||||
priv = op->priv;
|
||||
|
||||
g_free (priv->job_name);
|
||||
priv->job_name = g_strdup (job_name);
|
||||
/*
|
||||
* according to http://datatracker.ietf.org/doc/rfc2911/,
|
||||
* job names MUST NOT exceed 255 (MAX) octets.
|
||||
*
|
||||
* CUPS will not print jobs with names exceeding 255 chars.
|
||||
*/
|
||||
if (strlen (job_name) > 255)
|
||||
{
|
||||
end = g_utf8_find_prev_char (job_name, job_name + 255);
|
||||
priv->job_name = g_utf8_substring (job_name,
|
||||
0,
|
||||
g_utf8_pointer_to_offset (job_name,
|
||||
end));
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->job_name = g_strdup (job_name);
|
||||
}
|
||||
|
||||
|
||||
g_object_notify (G_OBJECT (op), "job-name");
|
||||
}
|
||||
|
@@ -1402,9 +1402,9 @@ gtk_style_context_list_classes (GtkStyleContext *context)
|
||||
|
||||
classes = gtk_css_node_list_classes (priv->cssnode, &n_classes);
|
||||
|
||||
for (i = n_classes; i-- > n_classes;)
|
||||
for (i = n_classes; i > 0; i--)
|
||||
{
|
||||
quark_str = g_quark_to_string (classes[i]);
|
||||
quark_str = g_quark_to_string (classes[i - 1]);
|
||||
classes_list = g_list_prepend (classes_list, (gchar *) quark_str);
|
||||
}
|
||||
|
||||
@@ -1621,6 +1621,9 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
||||
|
||||
priv = context->priv;
|
||||
|
||||
/* ensure the style cache is valid by forcing a validation */
|
||||
gtk_style_context_lookup_style (context);
|
||||
|
||||
key.widget_type = widget_type;
|
||||
key.pspec = pspec;
|
||||
|
||||
|
@@ -52,6 +52,8 @@
|
||||
#include "a11y/gtkswitchaccessible.h"
|
||||
#include "gtkactionhelper.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkcssshadowsvalueprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
|
||||
#include "fallback-c89.c"
|
||||
|
||||
@@ -447,6 +449,9 @@ gtk_switch_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
|
||||
GtkStyleContext *context;
|
||||
GtkBorder extents;
|
||||
GtkAllocation clip;
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
@@ -457,7 +462,26 @@ gtk_switch_size_allocate (GtkWidget *widget,
|
||||
allocation->width,
|
||||
allocation->height);
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, NULL);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
gtk_style_context_save (context);
|
||||
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TROUGH);
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
|
||||
|
||||
_gtk_css_shadows_value_get_extents (_gtk_style_context_peek_property (context,
|
||||
GTK_CSS_PROPERTY_BOX_SHADOW),
|
||||
&extents);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
|
||||
clip = *allocation;
|
||||
clip.x -= extents.left;
|
||||
clip.y -= extents.top;
|
||||
clip.width += extents.left + extents.right;
|
||||
clip.height += extents.top + extents.bottom;
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -5648,14 +5648,21 @@ _gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree,
|
||||
GtkTextIter *iter,
|
||||
GtkTextTag *tag)
|
||||
{
|
||||
gboolean found;
|
||||
|
||||
g_return_val_if_fail (iter != NULL, FALSE);
|
||||
g_return_val_if_fail (tree != NULL, FALSE);
|
||||
|
||||
_gtk_text_btree_get_end_iter (tree, iter);
|
||||
gtk_text_iter_backward_to_tag_toggle (iter, tag);
|
||||
|
||||
if (gtk_text_iter_toggles_tag (iter, tag))
|
||||
found = TRUE;
|
||||
else
|
||||
found = gtk_text_iter_backward_to_tag_toggle (iter, tag);
|
||||
|
||||
check_invariants (iter);
|
||||
|
||||
return TRUE;
|
||||
return found;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
3361
po-properties/de.po
3361
po-properties/de.po
File diff suppressed because it is too large
Load Diff
@@ -366,6 +366,46 @@ test_widget_path_parent (void)
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
static void
|
||||
test_style_classes (void)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GList *classes;
|
||||
|
||||
context = gtk_style_context_new ();
|
||||
|
||||
classes = gtk_style_context_list_classes (context);
|
||||
g_assert_null (classes);
|
||||
|
||||
gtk_style_context_add_class (context, "A");
|
||||
|
||||
classes = gtk_style_context_list_classes (context);
|
||||
g_assert (classes);
|
||||
g_assert_null (classes->next);
|
||||
g_assert_cmpstr (classes->data, ==, "A");
|
||||
g_list_free (classes);
|
||||
|
||||
gtk_style_context_add_class (context, "B");
|
||||
|
||||
classes = gtk_style_context_list_classes (context);
|
||||
g_assert (classes);
|
||||
g_assert_cmpstr (classes->data, ==, "A");
|
||||
g_assert (classes->next);
|
||||
g_assert_cmpstr (classes->next->data, ==, "B");
|
||||
g_assert_null (classes->next->next);
|
||||
g_list_free (classes);
|
||||
|
||||
gtk_style_context_remove_class (context, "A");
|
||||
|
||||
classes = gtk_style_context_list_classes (context);
|
||||
g_assert (classes);
|
||||
g_assert_null (classes->next);
|
||||
g_assert_cmpstr (classes->data, ==, "B");
|
||||
g_list_free (classes);
|
||||
|
||||
g_object_unref (context);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@@ -379,6 +419,7 @@ main (int argc, char *argv[])
|
||||
g_test_add_func ("/style/invalidate-saved", test_invalidate_saved);
|
||||
g_test_add_func ("/style/set-widget-path-saved", test_set_widget_path_saved);
|
||||
g_test_add_func ("/style/widget-path-parent", test_widget_path_parent);
|
||||
g_test_add_func ("/style/classes", test_style_classes);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user