mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
checkmenuitem: deprecate indicator-size style property
We can now use min-width/min-height.
This commit is contained in:
parent
5a87b5bbce
commit
4ec99db368
@ -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);
|
||||
|
@ -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; }
|
||||
}
|
||||
|
@ -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 *
|
||||
|
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user