Compare commits

...

38 Commits

Author SHA1 Message Date
Matthias Clasen
9e53d1ea45 filechooser: Make files unselectable in folder mode
This is a bit of an adventure, and a better way
to do this would perhaps be a custom selection
model. For now, we just change GtkListItem::selectable.
2023-03-01 07:09:58 -05:00
Matthias Clasen
b2af4006ba inspector: Look for icon themes in system data dirs
For some reason, these were not included, and they should.
2023-02-28 07:18:42 -05:00
Matthias Clasen
5d3942e5fa NEWS: Updates 2023-02-28 06:53:26 -05:00
Matthias Clasen
a7a498e803 Merge branch 'alloc-needed-on-child-fix' into 'main'
widget: Reset alloc_needed_on_child before allocating children

See merge request GNOME/gtk!5564
2023-02-28 10:40:02 +00:00
Ivan Molodetskikh
75a417e337 widget: Reset alloc_needed_on_child before allocating children
Reset alloc_needed_on_child *before* allocating the children. This is
because some child's size_allocate() may call queue_allocate(), which
will bubble up alloc_needed_on_child. An example of this happening is
with GtkScrollable implementations, which are supposed to configure
their adjustments in size_allocate(), which will cause GtkScrollbar's
GtkRange to notice and queue_allocate() on itself.

If we reset alloc_needed_on_child after this happens, then our children
will have a lingering alloc_needed_on_child and will not receive an
allocation.

This commit fixes widgets occasionally losing an allocation when this
scenario happens.
2023-02-27 21:38:42 -08:00
Matthias Clasen
dbaaa59758 Merge branch 'fix-text-undo-disabling' into 'main'
text: Fix disabling of history

Closes #5622

See merge request GNOME/gtk!5565
2023-02-28 02:39:30 +00:00
Matthias Clasen
73ba043b02 text: Make editable API irreversible
Programmatic changes to the entry contents should
not become part of the undo history.

Sadly, the editable implementations are also used
in the code paths that we use for user-initiated changes,
so we have to be careful to only set them as
irreversible if we are not already in a user action.

Fixes: #5622
2023-02-27 19:43:11 -05:00
Matthias Clasen
61e4eadbce text: Fix disabling of history
Keep a separate boolean for enable-undo, and
disable the history if it is false, or the entry
is not using visible text, or isn't editable.

Related to: #5622
2023-02-27 19:17:08 -05:00
Matthias Clasen
0db2d0bc07 Merge branch 'expose_autocomplete' into 'main'
a11y: Expose GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE

See merge request GNOME/gtk!5563
2023-02-27 16:49:00 +00:00
Lukáš Tyrychtr
c57d6c5575 a11y: Expose GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE
Previously, it was not exposed at all, now it at least somewhat is.
2023-02-27 15:27:07 +01:00
Emmanuele Bassi
73057b267e Merge branch 'expose_has_popup' into 'main'
a11y: Expose GTK_ACCESSIBLE_PROPERTY_HAS_POPUP

See merge request GNOME/gtk!5562
2023-02-27 14:20:44 +00:00
Lukáš Tyrychtr
9d4bb77263 a11y: Expose GTK_ACCESSIBLE_PROPERTY_HAS_POPUP
This property was not exposed before, not it is.
2023-02-27 14:10:11 +01:00
Emmanuele Bassi
0d6cee9763 Merge branch 'expose_multi_selectable' into 'main'
a11y: Expose GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE to at-spi2

See merge request GNOME/gtk!5561
2023-02-27 12:41:11 +00:00
Lukáš Tyrychtr
b33bfe26fe a11y: Expose GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE to at-spi2
Previously, this property was not exposed to the a11y backend, now, it is.
2023-02-27 13:24:56 +01:00
Emmanuele Bassi
0cacaa08f5 Merge branch 'expose_required' into 'main'
a11y: Expose GTK_ACCESSIBLE_PROPERTY_REQUIRED to at-spi2

See merge request GNOME/gtk!5560
2023-02-27 11:30:59 +00:00
Lukáš Tyrychtr
cbf4a546b4 a11y: Expose GTK_ACCESSIBLE_PROPERTY_REQUIRED to at-spi2
Up until now, this property was silently not exposed to assistive technologies.
2023-02-27 12:17:58 +01:00
Emmanuele Bassi
03732c1d48 Merge branch 'fix_invalid_role_mapping' into 'main'
a11y: Map GTK_ACCESSIBLE_STATE_INVALID to ATSPI_STATE_INVALID_ENTRY

See merge request GNOME/gtk!5559
2023-02-27 11:02:40 +00:00
Lukáš Tyrychtr
568cf21486 a11y: Map GTK_ACCESSIBLE_STATE_INVALID to ATSPI_STATE_INVALID_ENTRY
Previously, it was mapped to ATSPI_STATE_INVALID. However, that state
is used for some internal errors, and not user errors, so use the correct
one for that purpose.
2023-02-27 11:40:46 +01:00
Hugo Carvalho
49feaf465d Update Portuguese translation 2023-02-26 16:20:29 +00:00
Matthias Clasen
9b0afd8bff Merge branch 'pickers-demo-dnd' into 'main'
gtk4-demo: Accept file dnd in the pickers demo

See merge request GNOME/gtk!5556
2023-02-26 13:44:30 +00:00
Matthias Clasen
495ca72232 gtk4-demo: Accept file dnd in the pickers demo
Easy to add and expected of a file picker.
2023-02-26 08:28:38 -05:00
Alexander Shopov
e6f4464a3d Update Bulgarian translation 2023-02-26 08:48:06 +00:00
Anders Jonsson
cb0e4ee2be Update Swedish translation 2023-02-25 21:57:36 +00:00
Matthias Clasen
6f7b6ad61a Merge branch 'ebassi/button-no-check' into 'main'
Remove unused code in GtkButton

See merge request GNOME/gtk!5553
2023-02-25 13:41:52 +00:00
Emmanuele Bassi
1e599c9141 Remove unused code in GtkButton
GtkButton still has some code checking if the instance passed to
gtk_button_set_label() is a GtkCheckButton; GtkCheckButton is not a
GtkButton any more.
2023-02-24 14:38:39 +00:00
Yosef Or Boczko
4cf42eb19c Update Hebrew translation 2023-02-24 09:57:37 +00:00
Matthias Clasen
b0fc2f99ba Merge branch 'mcatanzaro/#5619' into 'main'
filesystemmodel: fix crash when file is removed

Closes #5619

See merge request GNOME/gtk!5550
2023-02-23 16:24:06 +00:00
Emmanuele Bassi
2b4dd182c1 Merge branch 'add_toggle_button_role' into 'main'
a11y: Introduce a dedicated role for toggle buttons

See merge request GNOME/gtk!5549
2023-02-23 15:22:16 +00:00
Michael Catanzaro
c141d0a70a filesystemmodel: fix crash when file is removed
In 32247bc50e node_get_for_file() was
changed to return GTK_INVALID_LIST_POSITION rather than 0 when the file
is untracked. Most call sites were updated accordingly, but this one was
missed.

Fixes #5619
2023-02-23 09:20:03 -06:00
Lukáš Tyrychtr
6fa8033c7c Use the correct role for GtkToggleButton 2023-02-23 15:02:29 +01:00
Lukáš Tyrychtr
de80f503e4 a11y: Introduce a dedicated role for toggle buttons
Up until now, toggle buttons were presented as regular push buttons.
That's the approach used by the ARIA specification, however, our platform
accessibility backend, at-spi2, can not represent accessibe states with values,
so we can not represent the design pattern precisely enough for screen readers.
If, in future, the a11y backends gain this capability, we might consider again
removing this role.
2023-02-23 14:22:20 +01:00
Matthias Clasen
41b67c4722 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Fix the shortcuts-window demo

See merge request GNOME/gtk!5548
2023-02-23 01:03:41 +00:00
Matthias Clasen
1eae87621d gtk-demo: Fix the shortcuts-window demo
Presenting the shortcutswindow got lost
in fb8e52f0c9. Oops.
2023-02-22 14:57:47 -05:00
Fran Dieguez
5f502601c8 Update Galician translation 2023-02-22 17:23:21 +00:00
Sabri Ünal
04d23c5cb9 Update Turkish translation 2023-02-22 11:41:36 +00:00
Philipp Kiemle
d9b6f814ad Update German translation 2023-02-22 10:34:50 +00:00
Matthias Clasen
871c46591a Merge branch 'improve_gtknotebook_a11y' into 'main'
GtkNotebook: Improve the labels of notebook pages for a11y

See merge request GNOME/gtk!5546
2023-02-21 16:48:28 +00:00
Lukáš Tyrychtr
d906b456a8 GtkNotebook: Improve the labels of notebook pages for a11y 2023-02-21 15:29:00 +01:00
21 changed files with 4024 additions and 3701 deletions

56
NEWS
View File

@@ -1,5 +1,57 @@
Overview of Changes in 4.9.5, xx-xx-xxxx
========================================
Overview of Changes in 4.10.0, xx-xx-xxxx
=========================================
* GtkTextView
- Document hanging indentation
* GtkListView
- Fix a size allocation problem
* GtkFileChooser
- Fix paned behavior
- Fix a crash
* GtkText
- Fix various problems with undo
* Accessibility
- Allow setting accessible parents and siblings
- Add a role for toggle buttons
- Miscellaneous property fixes and improvements
* gtk
- Improve the handling resize-during-size-allocate
* gdk
- Introduce GdkTextureDownloader and use it
- Make gdk_texture_get_format public
* gsk
- Make mask nodes more versatile
* X11
- Fix key handling during DND
* Tools
- gtk-builder-tool: Try harder to handle templates
- gtk-builder-tool: Prefer properties over <child>
* Translation updates
Basque
Belarusian
Bulgarian
Indonesian
Galician
Georgian
German
Hebrew
Lithuanian
Portuguese
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in 4.9.4, 12-02-2023
========================================

View File

@@ -13,20 +13,13 @@
static GtkWidget *app_picker;
static void
file_opened (GObject *source,
GAsyncResult *result,
void *data)
set_file (GFile *file,
gpointer data)
{
GFile *file;
GError *error = NULL;
char *name;
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
if (!file)
{
g_print ("%s\n", error->message);
g_error_free (error);
gtk_widget_set_sensitive (app_picker, FALSE);
g_object_set_data (G_OBJECT (app_picker), "file", NULL);
return;
@@ -40,6 +33,25 @@ file_opened (GObject *source,
g_object_set_data_full (G_OBJECT (app_picker), "file", g_object_ref (file), g_object_unref);
}
static void
file_opened (GObject *source,
GAsyncResult *result,
void *data)
{
GFile *file;
GError *error = NULL;
file = gtk_file_dialog_open_finish (GTK_FILE_DIALOG (source), result, &error);
if (!file)
{
g_print ("%s\n", error->message);
g_error_free (error);
}
set_file (file, data);
}
static gboolean
abort_mission (gpointer data)
{
@@ -130,11 +142,28 @@ launch_uri (GtkButton *picker)
g_object_unref (launcher);
}
static gboolean
on_drop (GtkDropTarget *target,
const GValue *value,
double x,
double y,
gpointer data)
{
if (G_VALUE_HOLDS (value, G_TYPE_FILE))
{
set_file (g_value_get_object (value), data);
return TRUE;
}
return FALSE;
}
GtkWidget *
do_pickers (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *table, *label, *picker, *button;
GtkDropTarget *drop_target;
if (!window)
{
@@ -179,7 +208,13 @@ do_pickers (GtkWidget *do_widget)
picker = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
button = gtk_button_new_from_icon_name ("document-open-symbolic");
label = gtk_label_new ("None");
drop_target = gtk_drop_target_new (G_TYPE_FILE, GDK_ACTION_COPY);
g_signal_connect (drop_target, "drop", G_CALLBACK (on_drop), label);
gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (drop_target));
gtk_label_set_xalign (GTK_LABEL (label), 0.);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
gtk_widget_set_hexpand (label, TRUE);

View File

@@ -22,6 +22,7 @@ show_shortcuts (GtkWidget *window,
gtk_window_set_transient_for (GTK_WINDOW (overlay), GTK_WINDOW (window));
g_object_set (overlay, "view-name", view, NULL);
g_object_unref (builder);
gtk_window_present (GTK_WINDOW (overlay));
}
G_MODULE_EXPORT void

View File

@@ -246,7 +246,7 @@ collect_states (GtkAtSpiContext *self,
case GTK_ACCESSIBLE_INVALID_TRUE:
case GTK_ACCESSIBLE_INVALID_GRAMMAR:
case GTK_ACCESSIBLE_INVALID_SPELLING:
set_atspi_state (&states, ATSPI_STATE_INVALID);
set_atspi_state (&states, ATSPI_STATE_INVALID_ENTRY);
break;
case GTK_ACCESSIBLE_INVALID_FALSE:
default:
@@ -282,6 +282,34 @@ collect_states (GtkAtSpiContext *self,
}
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_REQUIRED);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_REQUIRED);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_MULTISELECTABLE);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_HAS_POPUP))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_HAS_POPUP);
if (gtk_boolean_accessible_value_get (value))
set_atspi_state (&states, ATSPI_STATE_HAS_POPUP);
}
if (gtk_at_context_has_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE))
{
value = gtk_at_context_get_accessible_property (ctx, GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE);
if (gtk_autocomplete_accessible_value_get (value) != GTK_ACCESSIBLE_AUTOCOMPLETE_NONE)
set_atspi_state (&states, ATSPI_STATE_SUPPORTS_AUTOCOMPLETION);
}
g_variant_builder_add (builder, "u", (guint32) (states & 0xffffffff));
g_variant_builder_add (builder, "u", (guint32) (states >> 32));
}

View File

@@ -273,6 +273,8 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
case GTK_ACCESSIBLE_ROLE_WINDOW:
return ATSPI_ROLE_FRAME;
case GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON:
return ATSPI_ROLE_TOGGLE_BUTTON;
default:
break;
}

View File

@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/**
@@ -63,7 +63,6 @@
#include "gtkactionhelperprivate.h"
#include "gtkbuildable.h"
#include "gtkcheckbutton.h"
#include "gtkgestureclick.h"
#include "gtkeventcontrollerkey.h"
#include "gtkbinlayout.h"
@@ -829,8 +828,6 @@ gtk_button_set_label (GtkButton *button,
gtk_label_set_use_underline (GTK_LABEL (child), priv->use_underline);
gtk_label_set_mnemonic_widget (GTK_LABEL (child), GTK_WIDGET (button));
}
if (GTK_IS_CHECK_BUTTON (button))
gtk_label_set_xalign (GTK_LABEL (child), 0.0);
gtk_button_set_child (button, child);
}

View File

@@ -1306,6 +1306,9 @@ typedef enum {
* @GTK_ACCESSIBLE_ROLE_WIDGET: An interactive component of a graphical user
* interface. This is the role that GTK uses by default for widgets.
* @GTK_ACCESSIBLE_ROLE_WINDOW: An application window.
* @GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON: A type of push button
* which stays pressed until depressed by a second activation.
* Since: 4.10
*
* The accessible role for a [iface@Accessible] implementation.
*
@@ -1390,7 +1393,8 @@ typedef enum {
GTK_ACCESSIBLE_ROLE_TREE_GRID,
GTK_ACCESSIBLE_ROLE_TREE_ITEM,
GTK_ACCESSIBLE_ROLE_WIDGET,
GTK_ACCESSIBLE_ROLE_WINDOW
GTK_ACCESSIBLE_ROLE_WINDOW,
GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
} GtkAccessibleRole;
/**

View File

@@ -31,6 +31,10 @@
#include "gtkselectionmodel.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtklistitem.h"
#include "gtklistitemwidgetprivate.h"
#include "gtkcolumnviewcellprivate.h"
#include "deprecated/gtkfilechooser.h"
struct _GtkFileChooserCell
{
@@ -197,6 +201,48 @@ gtk_file_chooser_cell_dispose (GObject *object)
G_OBJECT_CLASS (gtk_file_chooser_cell_parent_class)->dispose (object);
}
static void
update_selectable (GtkFileChooserCell *self)
{
GtkWidget *ancestor;
GtkListItem *item = NULL;
GtkListItem *item2 = NULL;
gboolean selectable = TRUE;
if (!self->item)
return;
ancestor = gtk_widget_get_ancestor (GTK_WIDGET (self), GTK_TYPE_FILE_CHOOSER);
if (!ancestor)
return;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (ancestor)) == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
selectable = g_file_info_get_file_type (self->item) == G_FILE_TYPE_DIRECTORY;
G_GNUC_END_IGNORE_DEPRECATIONS
ancestor = gtk_widget_get_ancestor (GTK_WIDGET (self), GTK_TYPE_LIST_ITEM_WIDGET);
if (ancestor)
item = gtk_list_item_widget_get_list_item (GTK_LIST_ITEM_WIDGET (ancestor));
if (GTK_IS_COLUMN_VIEW_CELL (ancestor))
{
ancestor = gtk_widget_get_ancestor (gtk_widget_get_parent (GTK_WIDGET (ancestor)), GTK_TYPE_LIST_ITEM_WIDGET);
if (ancestor)
item2 = gtk_list_item_widget_get_list_item (GTK_LIST_ITEM_WIDGET (ancestor));
}
if (item)
gtk_list_item_set_selectable (item, selectable);
if (item2)
gtk_list_item_set_selectable (item2, selectable);
if (selectable)
gtk_widget_remove_css_class (GTK_WIDGET (self), "dim-label");
else
gtk_widget_add_css_class (GTK_WIDGET (self), "dim-label");
}
static void
gtk_file_chooser_cell_set_property (GObject *object,
guint prop_id,
@@ -217,6 +263,7 @@ gtk_file_chooser_cell_set_property (GObject *object,
case PROP_ITEM:
self->item = g_value_get_object (value);
update_selectable (self);
break;
case PROP_SHOW_TIME:
@@ -261,6 +308,15 @@ gtk_file_chooser_cell_get_property (GObject *object,
}
}
static void
gtk_file_chooser_cell_root (GtkWidget *widget)
{
GtkFileChooserCell *self = GTK_FILE_CHOOSER_CELL (widget);
GTK_WIDGET_CLASS (gtk_file_chooser_cell_parent_class)->root (widget);
update_selectable (self);
}
static void
gtk_file_chooser_cell_class_init (GtkFileChooserCellClass *klass)
@@ -272,6 +328,8 @@ gtk_file_chooser_cell_class_init (GtkFileChooserCellClass *klass)
object_class->set_property = gtk_file_chooser_cell_set_property;
object_class->get_property = gtk_file_chooser_cell_get_property;
widget_class->root = gtk_file_chooser_cell_root;
g_object_class_install_property (object_class, PROP_POSITION,
g_param_spec_uint ("position", NULL, NULL,
0, G_MAXUINT, 0,

View File

@@ -459,7 +459,7 @@ remove_file (GtkFileSystemModel *model,
g_return_if_fail (G_IS_FILE (file));
id = node_get_for_file (model, file);
if (id == 0)
if (id == GTK_INVALID_LIST_POSITION)
return;
node = get_node (model, id);

View File

@@ -4033,9 +4033,6 @@ gtk_notebook_insert_notebook_page (GtkNotebook *notebook,
g_signal_connect (controller, "enter", G_CALLBACK (gtk_notebook_tab_drop_enter), page);
g_signal_connect (controller, "leave", G_CALLBACK (gtk_notebook_tab_drop_leave), page);
gtk_widget_add_controller (page->tab_widget, controller);
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, _("Tab"),
-1);
page->expand = FALSE;
page->fill = TRUE;
@@ -4335,6 +4332,11 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
text = page->tab_text;
else
text = string;
gtk_accessible_update_property (GTK_ACCESSIBLE (page->tab_widget),
GTK_ACCESSIBLE_PROPERTY_LABEL, text,
-1);
if (notebook->show_tabs)
{
if (page->default_tab)

View File

@@ -247,6 +247,7 @@ struct _GtkTextPrivate
guint populate_all : 1;
guint propagate_text_width : 1;
guint text_handles_enabled : 1;
guint enable_undo : 1;
};
struct _GtkTextPasswordHint
@@ -397,6 +398,9 @@ static void gtk_text_set_max_width_chars (GtkText *self,
static void gtk_text_set_alignment (GtkText *self,
float xalign);
static void gtk_text_set_enable_undo (GtkText *self,
gboolean enable_undo);
/* Default signal handlers
*/
static GMenuModel *gtk_text_get_menu_model (GtkText *self);
@@ -561,6 +565,7 @@ static void begin_change (GtkText *self);
static void end_change (GtkText *self);
static void emit_changed (GtkText *self);
static void gtk_text_update_history (GtkText *self);
static void gtk_text_update_clipboard_actions (GtkText *self);
static void gtk_text_update_emoji_action (GtkText *self);
static void gtk_text_update_handles (GtkText *self);
@@ -1602,11 +1607,7 @@ gtk_text_set_property (GObject *object,
break;
case NUM_PROPERTIES + GTK_EDITABLE_PROP_ENABLE_UNDO:
if (g_value_get_boolean (value) != gtk_text_history_get_enabled (priv->history))
{
gtk_text_history_set_enabled (priv->history, g_value_get_boolean (value));
g_object_notify_by_pspec (object, pspec);
}
gtk_text_set_enable_undo (self, g_value_get_boolean (value));
break;
/* GtkText properties */
@@ -1732,7 +1733,7 @@ gtk_text_get_property (GObject *object,
break;
case NUM_PROPERTIES + GTK_EDITABLE_PROP_ENABLE_UNDO:
g_value_set_boolean (value, gtk_text_history_get_enabled (priv->history));
g_value_set_boolean (value, priv->enable_undo);
break;
/* GtkText properties */
@@ -1858,6 +1859,7 @@ gtk_text_init (GtkText *self)
priv->cursor_alpha = 1.0;
priv->invisible_char = 0;
priv->history = gtk_text_history_new (&history_funcs, self);
priv->enable_undo = TRUE;
gtk_text_history_set_max_undo_levels (priv->history, DEFAULT_MAX_UNDO);
@@ -3400,11 +3402,15 @@ gtk_text_insert_text (GtkText *self,
* The incoming text may a password or other secret. We make sure
* not to copy it into temporary buffers.
*/
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
n_inserted = gtk_entry_buffer_insert_text (get_buffer (self), *position, text, n_chars);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
if (n_inserted != n_chars)
gtk_widget_error_bell (GTK_WIDGET (self));
@@ -3426,11 +3432,16 @@ gtk_text_delete_text (GtkText *self,
if (start_pos == end_pos)
return;
if (priv->change_count == 0)
gtk_text_history_begin_irreversible_action (priv->history);
begin_change (self);
gtk_entry_buffer_delete_text (get_buffer (self), start_pos, end_pos - start_pos);
end_change (self);
if (priv->change_count == 0)
gtk_text_history_end_irreversible_action (priv->history);
update_placeholder_visibility (self);
if (priv->propagate_text_width)
gtk_widget_queue_resize (GTK_WIDGET (self));
@@ -5525,6 +5536,7 @@ gtk_text_set_editable (GtkText *self,
gtk_event_controller_key_set_im_context (GTK_EVENT_CONTROLLER_KEY (priv->key_controller),
is_editable ? priv->im_context : NULL);
gtk_text_update_history (self);
gtk_text_update_clipboard_actions (self);
gtk_text_update_emoji_action (self);
@@ -5605,7 +5617,7 @@ gtk_text_set_visibility (GtkText *self,
gtk_text_recompute (self);
/* disable undo when invisible text is used */
gtk_text_history_set_enabled (priv->history, visible);
gtk_text_update_history (self);
gtk_text_update_clipboard_actions (self);
}
@@ -7284,3 +7296,28 @@ gtk_text_history_select_cb (gpointer funcs_data,
selection_insert,
selection_bound);
}
static void
gtk_text_set_enable_undo (GtkText *self,
gboolean enable_undo)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
if (priv->enable_undo == enable_undo)
return;
priv->enable_undo = enable_undo;
gtk_text_update_history (self);
g_object_notify (G_OBJECT (self), "enable-undo");
}
static void
gtk_text_update_history (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
gtk_text_history_set_enabled (priv->history,
priv->enable_undo &&
priv->visible &&
priv->editable);
}

View File

@@ -67,6 +67,10 @@
* `GtkToggleButton` has a single CSS node with name button. To differentiate
* it from a plain `GtkButton`, it gets the `.toggle` style class.
*
* ## Accessibility
*
* `GtkToggleButton` uses the %GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON role.
*
* ## Creating two `GtkToggleButton` widgets.
*
* ```c
@@ -311,6 +315,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
G_TYPE_NONE, 0);
gtk_widget_class_set_css_name (widget_class, I_("button"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON);
}
static void

View File

@@ -4032,6 +4032,8 @@ gtk_widget_allocate (GtkWidget *widget,
priv->height = adjusted.height;
priv->baseline = baseline;
priv->alloc_needed_on_child = FALSE;
if (priv->layout_manager != NULL)
{
gtk_layout_manager_allocate (priv->layout_manager, widget,
@@ -4059,7 +4061,6 @@ gtk_widget_allocate (GtkWidget *widget,
gtk_widget_ensure_resize (widget);
priv->alloc_needed = FALSE;
priv->alloc_needed_on_child = FALSE;
gtk_widget_update_paintables (widget);

View File

@@ -630,6 +630,8 @@ fill_icons (const char *path,
const char *dir_entry;
GDir *dir;
g_print ("fill icons from %s\n", path);
dir = g_dir_open (path, 0, NULL);
if (!dir)
return;
@@ -658,6 +660,7 @@ init_icons (GtkInspectorVisual *vis)
GList *list, *l;
int i;
GtkStringList *names;
const char * const *dirs;
t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -669,6 +672,14 @@ init_icons (GtkInspectorVisual *vis)
fill_icons (path, t);
g_free (path);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
{
path = g_build_filename (dirs[i], "icons", NULL);
fill_icons (path, t);
g_free (path);
}
list = NULL;
g_hash_table_iter_init (&iter, t);
while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))
@@ -723,6 +734,7 @@ init_cursors (GtkInspectorVisual *vis)
GList *list, *l;
GtkStringList *names;
int i;
const char * const *dirs;
t = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -734,6 +746,14 @@ init_cursors (GtkInspectorVisual *vis)
fill_cursors (path, t);
g_free (path);
dirs = g_get_system_data_dirs ();
for (i = 0; dirs[i]; i++)
{
path = g_build_filename (dirs[i], "icons", NULL);
fill_cursors (path, t);
g_free (path);
}
list = NULL;
g_hash_table_iter_init (&iter, t);
while (g_hash_table_iter_next (&iter, (gpointer *)&theme, NULL))

1792
po/bg.po

File diff suppressed because it is too large Load Diff

574
po/de.po

File diff suppressed because it is too large Load Diff

567
po/gl.po

File diff suppressed because it is too large Load Diff

1716
po/he.po

File diff suppressed because it is too large Load Diff

567
po/pt.po

File diff suppressed because it is too large Load Diff

1527
po/sv.po

File diff suppressed because it is too large Load Diff

681
po/tr.po

File diff suppressed because it is too large Load Diff