forked from AuroraMiddleware/gtk
Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as needed by the application developer.
This commit is contained in:
parent
e61c124509
commit
425e977bb6
@ -499,7 +499,6 @@ static TranslationEntry translations[] = {
|
||||
{ "org.gnome.desktop.interface", "font-name", "gtk-font-name", G_TYPE_STRING, { .s = "Cantarell 11" } },
|
||||
{ "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
|
||||
{ "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ "org.gnome.desktop.interface", "toolbar-style", "gtk-toolbar-style", G_TYPE_STRING, { .s = "both-horiz"} },
|
||||
{ "org.gnome.desktop.interface", "toolbar-icons-size", "gtk-toolbar-icon-size", G_TYPE_STRING, { .s = "large"} },
|
||||
{ "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 250 } },
|
||||
{ "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
|
||||
|
@ -308,7 +308,6 @@ _gdk_win32_window_delete_property (GdkWindow *window,
|
||||
"Gtk/ColorPalette\0" "gtk-color-palette\0"
|
||||
"Gtk/FontName\0" "gtk-font-name\0"
|
||||
"Gtk/KeyThemeName\0" "gtk-key-theme-name\0"
|
||||
"Gtk/ToolbarStyle\0" "gtk-toolbar-style\0"
|
||||
"Gtk/ToolbarIconSize\0" "gtk-toolbar-icon-size\0"
|
||||
"Gtk/Modules\0" "gtk-modules\0"
|
||||
"Gtk/CursorThemeName\0" "gtk-cursor-theme-name\0"
|
||||
|
@ -33,7 +33,6 @@ static const struct {
|
||||
{"Gtk/ColorPalette", "gtk-color-palette"},
|
||||
{"Gtk/FontName", "gtk-font-name"},
|
||||
{"Gtk/KeyThemeName", "gtk-key-theme-name"},
|
||||
{"Gtk/ToolbarStyle", "gtk-toolbar-style"},
|
||||
{"Gtk/ToolbarIconSize", "gtk-toolbar-icon-size"},
|
||||
{"Gtk/Modules", "gtk-modules"},
|
||||
{"Gtk/CursorThemeName", "gtk-cursor-theme-name"},
|
||||
|
@ -1173,13 +1173,15 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
||||
* GtkSettings:gtk-toolbar-style:
|
||||
*
|
||||
* The size of icons in default toolbars.
|
||||
*
|
||||
* Deprecated: 3.10: This setting is ignored.
|
||||
*/
|
||||
result = settings_install_property_parser (class,
|
||||
g_param_spec_enum ("gtk-toolbar-style",
|
||||
P_("Toolbar style"),
|
||||
P_("Whether default toolbars have text only, text and icons, icons only, etc."),
|
||||
GTK_TYPE_TOOLBAR_STYLE,
|
||||
GTK_TOOLBAR_BOTH,
|
||||
GTK_TOOLBAR_BOTH_HORIZ,
|
||||
GTK_PARAM_READWRITE),
|
||||
gtk_rc_property_parse_enum);
|
||||
g_assert (result == PROP_TOOLBAR_STYLE);
|
||||
|
@ -91,7 +91,7 @@ typedef struct _ToolbarContent ToolbarContent;
|
||||
#define SPACE_LINE_END 8.0
|
||||
|
||||
#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||
#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH
|
||||
#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH_HORIZ
|
||||
#define DEFAULT_ANIMATION_STATE TRUE
|
||||
|
||||
#define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate
|
||||
@ -2016,19 +2016,6 @@ toolbar_get_settings (GtkToolbar *toolbar)
|
||||
return toolbar->priv->settings;
|
||||
}
|
||||
|
||||
static void
|
||||
style_change_notify (GtkToolbar *toolbar)
|
||||
{
|
||||
GtkToolbarPrivate *priv = toolbar->priv;
|
||||
|
||||
if (!priv->style_set)
|
||||
{
|
||||
/* pretend it was set, then unset, thus reverting to new default */
|
||||
priv->style_set = TRUE;
|
||||
gtk_toolbar_unset_style (toolbar);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
icon_size_change_notify (GtkToolbar *toolbar)
|
||||
{
|
||||
@ -2064,9 +2051,7 @@ settings_change_notify (GtkSettings *settings,
|
||||
const GParamSpec *pspec,
|
||||
GtkToolbar *toolbar)
|
||||
{
|
||||
if (! strcmp (pspec->name, "gtk-toolbar-style"))
|
||||
style_change_notify (toolbar);
|
||||
else if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
|
||||
if (! strcmp (pspec->name, "gtk-toolbar-icon-size"))
|
||||
icon_size_change_notify (toolbar);
|
||||
else if (! strcmp (pspec->name, "gtk-enable-animations"))
|
||||
animation_change_notify (toolbar);
|
||||
@ -2108,7 +2093,6 @@ gtk_toolbar_screen_changed (GtkWidget *widget,
|
||||
else
|
||||
priv->settings = NULL;
|
||||
|
||||
style_change_notify (toolbar);
|
||||
icon_size_change_notify (toolbar);
|
||||
animation_change_notify (toolbar);
|
||||
}
|
||||
@ -2910,14 +2894,7 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar)
|
||||
|
||||
if (priv->style_set)
|
||||
{
|
||||
GtkSettings *settings = toolbar_get_settings (toolbar);
|
||||
|
||||
if (settings)
|
||||
g_object_get (settings,
|
||||
"gtk-toolbar-style", &style,
|
||||
NULL);
|
||||
else
|
||||
style = DEFAULT_TOOLBAR_STYLE;
|
||||
style = DEFAULT_TOOLBAR_STYLE;
|
||||
|
||||
if (style != priv->style)
|
||||
g_signal_emit (toolbar, toolbar_signals[STYLE_CHANGED], 0, style);
|
||||
|
@ -892,19 +892,6 @@ gtk_tool_palette_get_child_property (GtkContainer *container,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
style_change_notify (GtkToolPalette *palette)
|
||||
{
|
||||
GtkToolPalettePrivate* priv = palette->priv;
|
||||
|
||||
if (!priv->style_set)
|
||||
{
|
||||
/* pretend it was set, then unset, thus reverting to new default */
|
||||
priv->style_set = TRUE;
|
||||
gtk_tool_palette_unset_style (palette);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
icon_size_change_notify (GtkToolPalette *palette)
|
||||
{
|
||||
@ -923,9 +910,7 @@ gtk_tool_palette_settings_change_notify (GtkSettings *settings,
|
||||
const GParamSpec *pspec,
|
||||
GtkToolPalette *palette)
|
||||
{
|
||||
if (strcmp (pspec->name, "gtk-toolbar-style") == 0)
|
||||
style_change_notify (palette);
|
||||
else if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
|
||||
if (strcmp (pspec->name, "gtk-toolbar-icon-size") == 0)
|
||||
icon_size_change_notify (palette);
|
||||
}
|
||||
|
||||
@ -1251,14 +1236,7 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
|
||||
|
||||
if (priv->style_set)
|
||||
{
|
||||
GtkSettings *settings = toolpalette_get_settings (palette);
|
||||
|
||||
if (settings)
|
||||
g_object_get (settings,
|
||||
"gtk-toolbar-style", &style,
|
||||
NULL);
|
||||
else
|
||||
style = DEFAULT_TOOLBAR_STYLE;
|
||||
style = DEFAULT_TOOLBAR_STYLE;
|
||||
|
||||
if (style != priv->style)
|
||||
gtk_tool_palette_change_style (palette, style);
|
||||
|
Loading…
Reference in New Issue
Block a user