Compare commits

...

8 Commits

Author SHA1 Message Date
Matthias Clasen
e72d54c8a7 3.22.24 2017-10-04 08:09:26 -04:00
Matthias Clasen
899cfb3c50 Fix several issues with resizing
Some of the border windows were not placed correctly.

Patch by Jan Steffens.
2017-10-04 07:35:45 -04:00
Matthias Clasen
223a709403 wayland: Fix a typo
We were not setting the right tiling hint in some cases.

Patch by Jan Steffens.
2017-10-04 07:35:45 -04:00
Daniel Boles
b9989e554b ComboBox: Don’t try to remove grab on NULL device
gtk_device_grab_remove() quite rightly expects a non-NULL GdkDevice, and
we already have a branch ensuring that, into which we can move this call
2017-10-04 12:23:49 +01:00
Daniel Boles
fa4d814462 TreeMenu: Remove accidentally duplicated doc lines
Not that it actually matters, as this is not public anymore, but this
was done accidentally. Also, sync a property description to ComboBox.
2017-10-04 12:03:55 +01:00
Daniel Boles
3783934436 testcombo: Test grid :row- and :column-span-column
Ditch two items that were white and so weren’t visible on our standard
theme anyway, and use the new space to test extra grid-mode properties.

Note that if we do this then, as before, we set the ListStore on the
ComboBox before appending to it, that produced runtime warnings like:

Gtk-CRITICAL **: gtk_menu_attach: assertion 'left_attach < right_attach' failed

I didn’t look into that yet, but it may indicate that attaching items
vs. recognising their spans don’t occur in the correct order. For the
purposes of testing this, I just create the CB after filling its model.
2017-10-04 11:04:52 +01:00
Daniel Boles
4163a53630 ComboBox|TreeMenu: Slightly clarify wrap-width doc 2017-10-04 10:21:18 +01:00
Daniel Boles
7559eaf5f9 ComboBox|TreeMenu: Clarify :row|column-span-column
ComboBox and TreeMenu warned in the doc for :row-span-column that the
value must not exceed :wrap-width, but :wrap-width does not interact
with the number of rows; it’s the :column-span-column that’s relevant.

Also: Warn that spans must be > 0 for rows too, and that column spans <=
:wrap-width are also not useful for items at menu column positions > 0.

Finally, refer to items having spans, not values, as we were already
talking about values in the model (and rows in the menu).
2017-10-04 10:21:01 +01:00
7 changed files with 67 additions and 66 deletions

8
NEWS
View File

@@ -1,3 +1,11 @@
Overview of Changes in GTK+ 3.22.24
===================================
* Bugs fixed:
Combobox: Don't try to remove grabs on NULL devices
Fix some issues with the new resizable tiling
Overview of Changes in GTK+ 3.22.23
===================================

View File

@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [22])
m4_define([gtk_micro_version], [23])
m4_define([gtk_interface_age], [23])
m4_define([gtk_micro_version], [24])
m4_define([gtk_interface_age], [24])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],

View File

@@ -3004,7 +3004,7 @@ gtk_surface_configure_edges (void *data,
new_state |= GDK_WINDOW_STATE_TOP_RESIZABLE;
break;
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_RIGHT:
new_state |= GDK_WINDOW_STATE_TOP_TILED;
new_state |= GDK_WINDOW_STATE_RIGHT_RESIZABLE;
break;
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_BOTTOM:
new_state |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE;

View File

@@ -911,9 +911,8 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
/**
* GtkComboBox:wrap-width:
*
* If wrap-width is set to a positive value, the list will be
* displayed in multiple columns, the number of columns is
* determined by wrap-width.
* If wrap-width is set to a positive value, items in the popup will be laid
* out along multiple columns, starting a new row on reaching the wrap width.
*
* Since: 2.4
*/
@@ -932,11 +931,9 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
* GtkComboBox:row-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model.
*
* The values of that column are used to determine how many rows a value in
* the list will span. Therefore, the values in the model column pointed to
* by this property must be greater than zero and not larger than wrap-width.
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many rows that item will span in the popup. Therefore,
* values in this column must be greater than zero.
*
* Since: 2.4
*/
@@ -955,10 +952,10 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
* GtkComboBox:column-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model.
*
* The values of that column are used to determine how many columns a value
* in the list will span.
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many columns that item will span in the popup.
* Therefore, values in this column must be greater than zero, and the sum of
* an items column position + span should not exceed #GtkComboBox:wrap-width.
*
* Since: 2.4
*/
@@ -2442,9 +2439,11 @@ gtk_combo_box_popdown (GtkComboBox *combo_box)
return;
if (priv->grab_pointer)
gdk_seat_ungrab (gdk_device_get_seat (priv->grab_pointer));
{
gdk_seat_ungrab (gdk_device_get_seat (priv->grab_pointer));
gtk_device_grab_remove (priv->popup_window, priv->grab_pointer);
}
gtk_device_grab_remove (priv->popup_window, priv->grab_pointer);
gtk_widget_hide (priv->popup_window);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button),
FALSE);

View File

@@ -327,9 +327,8 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
/*
* GtkTreeMenu:wrap-width:
*
* If wrap-width is set to a positive value, the list will be
* displayed in multiple columns, the number of columns is
* determined by wrap-width.
* If wrap-width is set to a positive value, items in the popup will be laid
* out along multiple columns, starting a new row on reaching the wrap width.
*
* Since: 3.0
*/
@@ -347,11 +346,9 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
* GtkTreeMenu:row-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model.
*
* The values of that column are used to determine how many rows a value in
* the list will span. Therefore, the values in the model column pointed to
* by this property must be greater than zero and not larger than wrap-width.
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many rows that item will span in the popup. Therefore,
* values in this column must be greater than zero.
*
* Since: 3.0
*/
@@ -369,10 +366,10 @@ _gtk_tree_menu_class_init (GtkTreeMenuClass *class)
* GtkTreeMenu:column-span-column:
*
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model.
*
* The values of that column are used to determine how many columns a value
* in the list will span.
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many columns that item will span in the popup.
* Therefore, values in this column must be greater than zero, and the sum of
* an items column position + span should not exceed #GtkTreeMenu:wrap-width.
*
* Since: 3.0
*/

View File

@@ -6855,7 +6855,7 @@ update_corner_windows (GtkWindow *window,
region, 0, 0);
cairo_region_destroy (region);
gdk_window_hide (priv->border_window[GDK_WINDOW_EDGE_NORTH_EAST]);
gdk_window_show_unraised (priv->border_window[GDK_WINDOW_EDGE_NORTH_EAST]);
}
else
{
@@ -7065,13 +7065,13 @@ update_border_windows (GtkWindow *window)
if (resize_n)
{
y += window_border.top;
y += window_border.top + handle_v;
h -= window_border.top + handle_v;
}
if (resize_w)
{
x += window_border.left;
x += window_border.left + handle_h;
w -= window_border.left + handle_h;
}
@@ -7084,9 +7084,9 @@ update_border_windows (GtkWindow *window)
/* North */
if (resize_n)
{
gdk_window_move_resize (priv->border_window[GDK_WINDOW_EDGE_SOUTH],
x, window_border.top + height,
w, border.bottom);
gdk_window_move_resize (priv->border_window[GDK_WINDOW_EDGE_NORTH],
x, window_border.top - border.top,
w, border.top);
gdk_window_show_unraised (priv->border_window[GDK_WINDOW_EDGE_NORTH]);
}
@@ -7096,7 +7096,7 @@ update_border_windows (GtkWindow *window)
}
/* South */
if (resize_n)
if (resize_s)
{
gdk_window_move_resize (priv->border_window[GDK_WINDOW_EDGE_SOUTH],
x, window_border.top + height,
@@ -7109,13 +7109,6 @@ update_border_windows (GtkWindow *window)
gdk_window_hide (priv->border_window[GDK_WINDOW_EDGE_SOUTH]);
}
/*
* Horizontal edges
*/
y = (resize_n || resize_s) ? window_border.top + handle_v : 0;
h = (resize_n || resize_s) ? height - 2 * handle_v : height + window_border.top + window_border.bottom;
/* East */
if (resize_e)
{

View File

@@ -65,21 +65,15 @@ create_combo_box_grid_demo (void)
GtkCellRenderer *cell = gtk_cell_renderer_pixbuf_new ();
GtkListStore *store;
store = gtk_list_store_new (1, GDK_TYPE_PIXBUF);
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo),
cell, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
cell, "pixbuf", 0, NULL);
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo),
3);
store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
/* first row */
pixbuf = create_color_pixbuf ("red");
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1, /* row span */
2, 1, /* column span */
-1);
g_object_unref (pixbuf);
@@ -87,6 +81,8 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1,
2, 1,
-1);
g_object_unref (pixbuf);
@@ -94,6 +90,8 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1,
2, 1,
-1);
g_object_unref (pixbuf);
@@ -102,6 +100,8 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1,
2, 2, /* Span 2 columns */
-1);
g_object_unref (pixbuf);
@@ -109,13 +109,8 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
-1);
g_object_unref (pixbuf);
pixbuf = create_color_pixbuf ("white");
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 2, /* Span 2 rows */
2, 1,
-1);
g_object_unref (pixbuf);
@@ -124,13 +119,8 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
-1);
g_object_unref (pixbuf);
pixbuf = create_color_pixbuf ("snow");
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1,
2, 1,
-1);
g_object_unref (pixbuf);
@@ -138,11 +128,25 @@ create_combo_box_grid_demo (void)
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, 1,
2, 1,
-1);
g_object_unref (pixbuf);
/* Create ComboBox after model to avoid gtk_menu_attach() warnings(?) */
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
g_object_unref (store);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo),
cell, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo),
cell, "pixbuf", 0, NULL);
/* Set wrap-width != 0 to enforce grid mode */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 3);
gtk_combo_box_set_row_span_column (GTK_COMBO_BOX (combo), 1);
gtk_combo_box_set_column_span_column (GTK_COMBO_BOX (combo), 2);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
return combo;