Merge branch 'cursor-aspect-ratio' into 'master'
Cursor aspect ratio fixes for gtk 4 Closes #3441 See merge request GNOME/gtk!2966
This commit is contained in:
@@ -1157,6 +1157,11 @@ shows a #GtkFileChooserNative dialog when clicked; once the file selection
|
||||
has completed, you can update the label of the #GtkButton with the selected
|
||||
file.
|
||||
|
||||
### Adapt to changed GtkSettings properties
|
||||
|
||||
In GTK 3 the #GtkSettings:gtk-cursor-aspect-ratio property of #GtkSettings was
|
||||
a float. In GTK 4 this has been changed to a double.
|
||||
|
||||
## Changes to consider after the switch
|
||||
|
||||
GTK 4 has a number of new features that you may want to take
|
||||
|
||||
@@ -386,11 +386,11 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
||||
g_assert (result == PROP_SPLIT_CURSOR);
|
||||
|
||||
result = settings_install_property_parser (class,
|
||||
g_param_spec_float ("gtk-cursor-aspect-ratio",
|
||||
P_("Cursor Aspect Ratio"),
|
||||
P_("The aspect ratio of the text caret"),
|
||||
0.0, 1.0, 0.04,
|
||||
GTK_PARAM_READWRITE));
|
||||
g_param_spec_double ("gtk-cursor-aspect-ratio",
|
||||
P_("Cursor Aspect Ratio"),
|
||||
P_("The aspect ratio of the text caret"),
|
||||
0.0, 1.0, 0.04,
|
||||
GTK_PARAM_READWRITE));
|
||||
g_assert (result == PROP_CURSOR_ASPECT_RATIO);
|
||||
|
||||
result = settings_install_property_parser (class,
|
||||
|
||||
@@ -969,7 +969,7 @@ draw_insertion_cursor (GtkStyleContext *context,
|
||||
double x,
|
||||
double y,
|
||||
double height,
|
||||
float aspect_ratio,
|
||||
double aspect_ratio,
|
||||
gboolean is_primary,
|
||||
PangoDirection direction,
|
||||
gboolean draw_arrow)
|
||||
@@ -1032,7 +1032,7 @@ draw_insertion_cursor (GtkStyleContext *context,
|
||||
|
||||
static void
|
||||
get_insertion_cursor_bounds (double height,
|
||||
float aspect_ratio,
|
||||
double aspect_ratio,
|
||||
PangoDirection direction,
|
||||
gboolean draw_arrow,
|
||||
graphene_rect_t *bounds)
|
||||
@@ -1073,7 +1073,7 @@ static void
|
||||
snapshot_insertion_cursor (GtkSnapshot *snapshot,
|
||||
GtkStyleContext *context,
|
||||
double height,
|
||||
float aspect_ratio,
|
||||
double aspect_ratio,
|
||||
gboolean is_primary,
|
||||
PangoDirection direction,
|
||||
gboolean draw_arrow)
|
||||
@@ -1136,7 +1136,7 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
|
||||
{
|
||||
GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
|
||||
gboolean split_cursor;
|
||||
float aspect_ratio;
|
||||
double aspect_ratio;
|
||||
PangoRectangle strong_pos, weak_pos;
|
||||
PangoRectangle *cursor1, *cursor2;
|
||||
GdkSeat *seat;
|
||||
|
||||
Reference in New Issue
Block a user