mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #3318, #3319, and #3320 See merge request GNOME/gtk!2776
This commit is contained in:
commit
fd52220b1b
16
NEWS
16
NEWS
@ -24,6 +24,9 @@ Overview of Changes in master
|
||||
* GtkTextView:
|
||||
- Fix rendering and positioning of anchored children
|
||||
|
||||
* Constraints:
|
||||
- Fix loading constraints from ui files
|
||||
|
||||
* Media support:
|
||||
- Use cubic instead of linear volume
|
||||
|
||||
@ -42,10 +45,22 @@ Overview of Changes in master
|
||||
- Deliver events on flush
|
||||
- Drop the unused GdkPoint struct from the API
|
||||
|
||||
* Demos:
|
||||
- Add another constraints demo
|
||||
- Tweak various demos to improve consistency
|
||||
|
||||
* Tools:
|
||||
- Improve gtk4-builder-tool handling of various
|
||||
widgets when converting ui files from GTK 3
|
||||
|
||||
* Documentation:
|
||||
- Use GtkApplication in all examples
|
||||
- Improve and expand the widget gallery
|
||||
|
||||
* Testsuite:
|
||||
- Improve coverage of GDK
|
||||
- Improve coverage of gtk4-builder-tool
|
||||
|
||||
* Build:
|
||||
- Fix the build with cups 2.2.12
|
||||
- Make cloudprint support build without warnings
|
||||
@ -55,6 +70,7 @@ Overview of Changes in master
|
||||
- Make GtkGLArea work (with the cairo backend)
|
||||
|
||||
* Translation updates:
|
||||
German
|
||||
Polish
|
||||
|
||||
|
||||
|
@ -260,6 +260,8 @@ activate_about (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
GtkWindow *window;
|
||||
GtkWidget *button;
|
||||
const char *authors[] = {
|
||||
"Andrea Cimitan",
|
||||
"Cosimo Cecchi",
|
||||
@ -277,6 +279,10 @@ activate_about (GSimpleAction *action,
|
||||
|
||||
s = g_string_new ("");
|
||||
|
||||
window = gtk_application_get_active_window (app);
|
||||
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
|
||||
gtk_menu_button_popdown (GTK_MENU_BUTTON (button));
|
||||
|
||||
os_name = g_get_os_info (G_OS_INFO_KEY_NAME);
|
||||
os_version = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
|
||||
if (os_name && os_version)
|
||||
@ -326,6 +332,21 @@ activate_about (GSimpleAction *action,
|
||||
g_free (os_version);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_shortcuts_window (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
GtkWindow *window;
|
||||
GtkWidget *button;
|
||||
|
||||
window = gtk_application_get_active_window (app);
|
||||
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
|
||||
gtk_menu_button_popdown (GTK_MENU_BUTTON (button));
|
||||
gtk_widget_activate_action (GTK_WIDGET (window), "win.show-help-overlay", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_quit (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
@ -2371,6 +2392,7 @@ main (int argc, char *argv[])
|
||||
GAction *action;
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "about", activate_about, NULL, NULL, NULL },
|
||||
{ "shortcuts", activate_shortcuts_window, NULL, NULL, NULL },
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
{ "inspector", activate_inspector, NULL, NULL, NULL },
|
||||
{ "main", NULL, "s", "'steak'", NULL },
|
||||
|
@ -51,7 +51,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">win.show-help-overlay</attribute>
|
||||
<attribute name="action">app.shortcuts</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About Widget Factory</attribute>
|
||||
@ -3220,7 +3220,7 @@ bad things might happen.</property>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="halign">end</property>
|
||||
<property name="icon-name">emblem-system-symbolic</property>
|
||||
<property name="menu-model">gear_menu</property>
|
||||
<property name="menu-model">gear_menu_model</property>
|
||||
<property name="tooltip-text">This is a menu button</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
|
@ -1080,12 +1080,12 @@ gtk_icon_paintable_get_icon_name() and set the icon name on a #GtkImage.
|
||||
|
||||
### Update to GtkFileChooser API changes
|
||||
|
||||
GtkFileChooser moved to a GFile-based API. If you need to convert a
|
||||
path or a URI, use g_file_new_for_path(), g_file_new_for_commandline_arg(),
|
||||
or g_file_new_for_uri(); similarly, if you need to get a path or a URI
|
||||
from a GFile, use g_file_get_path(), or g_file_get_uri(). With the
|
||||
removal or path and URI-based functions, the "local-only" property has
|
||||
been removed; GFile can be used to access non-local as well as local
|
||||
GtkFileChooser moved to a GFile-based API. If you need to convert a path
|
||||
or a URI, use g_file_new_for_path(), g_file_new_for_commandline_arg(),
|
||||
or g_file_new_for_uri(); similarly, if you need to get a path, name or URI
|
||||
from a GFile, use g_file_get_path(), g_file_get_basename() or g_file_get_uri().
|
||||
With the removal or path and URI-based functions, the "local-only" property
|
||||
has been removed; GFile can be used to access non-local as well as local
|
||||
resources.
|
||||
|
||||
The GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER action has been removed. Use
|
||||
|
@ -1408,13 +1408,9 @@ impl_surface_add_update_area (GdkSurface *impl_surface,
|
||||
void
|
||||
gdk_surface_queue_render (GdkSurface *surface)
|
||||
{
|
||||
cairo_region_t *region;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
region = cairo_region_create ();
|
||||
impl_surface_add_update_area (surface, region);
|
||||
cairo_region_destroy (region);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1495,7 +1491,9 @@ gdk_surface_freeze_updates (GdkSurface *surface)
|
||||
|
||||
surface->update_freeze_count++;
|
||||
if (surface->update_freeze_count == 1)
|
||||
{
|
||||
_gdk_frame_clock_uninhibit_freeze (surface->frame_clock);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -202,6 +202,8 @@ gtk_magnifier_class_init (GtkMagnifierClass *klass)
|
||||
P_("resize"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
gtk_widget_class_set_css_name (widget_class, "magnifier");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -839,7 +839,7 @@ gtk_popover_init (GtkPopover *popover)
|
||||
priv->final_position = GTK_POS_BOTTOM;
|
||||
priv->autohide = TRUE;
|
||||
priv->has_arrow = TRUE;
|
||||
priv->cascade_popdown = TRUE;
|
||||
priv->cascade_popdown = FALSE;
|
||||
|
||||
controller = gtk_event_controller_key_new ();
|
||||
g_signal_connect_swapped (controller, "key-pressed", G_CALLBACK (gtk_popover_key_pressed), popover);
|
||||
@ -1674,7 +1674,7 @@ gtk_popover_class_init (GtkPopoverClass *klass)
|
||||
g_param_spec_boolean ("cascade-popdown",
|
||||
P_("Cascade popdown"),
|
||||
P_("Wether the popover pops down after a child popover"),
|
||||
TRUE,
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
|
||||
|
@ -309,6 +309,7 @@ gtk_popover_menu_init (GtkPopoverMenu *popover)
|
||||
g_free (controllers);
|
||||
|
||||
gtk_popover_disable_auto_mnemonics (GTK_POPOVER (popover));
|
||||
gtk_popover_set_cascade_popdown (GTK_POPOVER (popover), TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -116,22 +116,19 @@ gtk_text_handle_present_surface (GtkTextHandle *handle)
|
||||
GdkPopupLayout *layout;
|
||||
GdkRectangle rect;
|
||||
GtkRequisition req;
|
||||
double x, y;
|
||||
GtkWidget *parent;
|
||||
|
||||
gtk_widget_get_preferred_size (widget, NULL, &req);
|
||||
gtk_text_handle_get_padding (handle, &handle->border);
|
||||
|
||||
rect.x = handle->pointing_to.x;
|
||||
rect.y = handle->pointing_to.y + handle->pointing_to.height - handle->border.top;
|
||||
parent = gtk_widget_get_parent (widget);
|
||||
gtk_widget_get_surface_allocation (parent, &rect);
|
||||
|
||||
rect.x += handle->pointing_to.x;
|
||||
rect.y += handle->pointing_to.y + handle->pointing_to.height - handle->border.top;
|
||||
rect.width = req.width - handle->border.left - handle->border.right;
|
||||
rect.height = 1;
|
||||
|
||||
gtk_widget_translate_coordinates (gtk_widget_get_parent (widget),
|
||||
gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW),
|
||||
rect.x, rect.y, &x, &y);
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
|
||||
if (handle->role == GTK_TEXT_HANDLE_ROLE_CURSOR)
|
||||
rect.x -= rect.width / 2;
|
||||
else if ((handle->role == GTK_TEXT_HANDLE_ROLE_SELECTION_END &&
|
||||
@ -420,6 +417,8 @@ gtk_text_handle_update_for_role (GtkTextHandle *handle)
|
||||
gtk_widget_remove_css_class (widget, "bottom");
|
||||
gtk_widget_remove_css_class (widget, "insertion-cursor");
|
||||
}
|
||||
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1845,6 +1845,9 @@ popover.background {
|
||||
}
|
||||
}
|
||||
|
||||
magnifier {
|
||||
background-color: $base_color;
|
||||
}
|
||||
|
||||
/*************
|
||||
* Notebooks *
|
||||
|
Loading…
Reference in New Issue
Block a user