From 4ec99db368e1f7c34a7c182ed28bd6b9a3e210ba Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 18 Dec 2015 17:59:34 -0800 Subject: [PATCH] checkmenuitem: deprecate indicator-size style property We can now use min-width/min-height. --- gtk/gtkcheckmenuitem.c | 34 ++++++++---------------- gtk/theme/Adwaita/_common.scss | 4 +-- gtk/theme/Adwaita/gtk-contained-dark.css | 12 +++++---- gtk/theme/Adwaita/gtk-contained.css | 12 +++++---- 4 files changed, 27 insertions(+), 35 deletions(-) diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c index 687b5dd3d9..916d2d7bd8 100644 --- a/gtk/gtkcheckmenuitem.c +++ b/gtk/gtkcheckmenuitem.c @@ -157,26 +157,6 @@ gtk_check_menu_item_render_indicator (GtkCssGadget *gadget, return FALSE; } -static void -gtk_check_menu_item_measure_indicator (GtkCssGadget *gadget, - GtkOrientation orientation, - int size, - int *minimum, - int *natural, - int *minimum_baseline, - int *natural_baseline, - gpointer data) -{ - GtkWidget *widget = gtk_css_gadget_get_owner (gadget); - guint indicator_size; - - gtk_widget_style_get (widget, - "indicator-size", &indicator_size, - NULL); - - *minimum = *natural = indicator_size; -} - static void gtk_check_menu_item_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -279,7 +259,15 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) P_("Whether the menu item looks like a radio menu item"), FALSE, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); - + + /** + * GtkCheckMenuItem:indicator-size: + * + * The size of the check or radio indicator. + * + * Deprecated: 3.20: Use the standard CSS property min-width on the check or + * radio nodes; the value of this style property is ignored. + */ gtk_widget_class_install_style_property (widget_class, g_param_spec_int ("indicator-size", P_("Indicator Size"), @@ -287,7 +275,7 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) 0, G_MAXINT, INDICATOR_SIZE, - GTK_PARAM_READABLE)); + GTK_PARAM_READABLE|G_PARAM_DEPRECATED)); widget_class->draw = gtk_check_menu_item_draw; @@ -670,7 +658,7 @@ gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item) priv->indicator_gadget = gtk_css_custom_gadget_new_for_node (priv->indicator_node, GTK_WIDGET (check_menu_item), - gtk_check_menu_item_measure_indicator, + NULL, NULL, gtk_check_menu_item_render_indicator, NULL, NULL); diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index 416601f427..266a536e07 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -10,8 +10,6 @@ $asset_suffix: if($variant=='dark', '-dark', ''); -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: $error_color; - -GtkCheckMenuItem-indicator-size: 16; - // The size for scrollbars. The slider is 2px smaller, but we keep it // up so that the whole area is sensitive to button presses for the // slider. The stepper button is larger in both directions, the slider @@ -1544,6 +1542,8 @@ menuitem { & accelerator { color: gtkalpha(currentColor,0.55); } & check, & radio { + min-height: 16px; + min-width: 16px; &:dir(ltr) { margin-right: 7px; } &:dir(rtl) { margin-left: 7px; } } diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css index e3db13a3f9..3f1c0b4694 100644 --- a/gtk/theme/Adwaita/gtk-contained-dark.css +++ b/gtk/theme/Adwaita/gtk-contained-dark.css @@ -2,7 +2,6 @@ padding: 0; -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: #cc0000; - -GtkCheckMenuItem-indicator-size: 16; -GtkScrolledWindow-scrollbar-spacing: 0; -GtkScrolledWindow-scrollbars-within-bevel: 1; -GtkToolItemGroup-expander-size: 11; @@ -2154,10 +2153,13 @@ menu, menuitem accelerator { color: alpha(currentColor,0.55); } -menuitem check:dir(ltr), menuitem radio:dir(ltr) { - margin-right: 7px; } -menuitem check:dir(rtl), menuitem radio:dir(rtl) { - margin-left: 7px; } +menuitem check, menuitem radio { + min-height: 16px; + min-width: 16px; } + menuitem check:dir(ltr), menuitem radio:dir(ltr) { + margin-right: 7px; } + menuitem check:dir(rtl), menuitem radio:dir(rtl) { + margin-left: 7px; } /*************** * Popovers * diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css index 5745ea3465..33a4f9ab81 100644 --- a/gtk/theme/Adwaita/gtk-contained.css +++ b/gtk/theme/Adwaita/gtk-contained.css @@ -2,7 +2,6 @@ padding: 0; -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: #cc0000; - -GtkCheckMenuItem-indicator-size: 16; -GtkScrolledWindow-scrollbar-spacing: 0; -GtkScrolledWindow-scrollbars-within-bevel: 1; -GtkToolItemGroup-expander-size: 11; @@ -2160,10 +2159,13 @@ menu, menuitem accelerator { color: alpha(currentColor,0.55); } -menuitem check:dir(ltr), menuitem radio:dir(ltr) { - margin-right: 7px; } -menuitem check:dir(rtl), menuitem radio:dir(rtl) { - margin-left: 7px; } +menuitem check, menuitem radio { + min-height: 16px; + min-width: 16px; } + menuitem check:dir(ltr), menuitem radio:dir(ltr) { + margin-right: 7px; } + menuitem check:dir(rtl), menuitem radio:dir(rtl) { + margin-left: 7px; } /*************** * Popovers *