Compare commits
38 Commits
frame-cloc
...
file-choos
Author | SHA1 | Date | |
---|---|---|---|
|
9e53d1ea45 | ||
|
b2af4006ba | ||
|
5d3942e5fa | ||
|
a7a498e803 | ||
|
75a417e337 | ||
|
dbaaa59758 | ||
|
73ba043b02 | ||
|
61e4eadbce | ||
|
0db2d0bc07 | ||
|
c57d6c5575 | ||
|
73057b267e | ||
|
9d4bb77263 | ||
|
0d6cee9763 | ||
|
b33bfe26fe | ||
|
0cacaa08f5 | ||
|
cbf4a546b4 | ||
|
03732c1d48 | ||
|
568cf21486 | ||
|
49feaf465d | ||
|
9b0afd8bff | ||
|
495ca72232 | ||
|
e6f4464a3d | ||
|
cb0e4ee2be | ||
|
6f7b6ad61a | ||
|
1e599c9141 | ||
|
4cf42eb19c | ||
|
b0fc2f99ba | ||
|
2b4dd182c1 | ||
|
c141d0a70a | ||
|
6fa8033c7c | ||
|
de80f503e4 | ||
|
41b67c4722 | ||
|
1eae87621d | ||
|
5f502601c8 | ||
|
04d23c5cb9 | ||
|
d9b6f814ad | ||
|
871c46591a | ||
|
d906b456a8 |
56
NEWS
56
NEWS
@@ -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
|
||||
========================================
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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));
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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,
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user