forked from AuroraMiddleware/gtk
menubar: Ignore the shadow-type style property
The border can be controlled with regular CSS, so deprecate and ignore this style property.
This commit is contained in:
parent
af04390b29
commit
3aa9293258
@ -105,8 +105,6 @@ static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell);
|
||||
static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
||||
GtkMenuDirectionType direction);
|
||||
|
||||
static GtkShadowType get_shadow_type (GtkMenuBar *menubar);
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL)
|
||||
|
||||
static void
|
||||
@ -214,6 +212,14 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
|
||||
/**
|
||||
* GtkMenuBar:shadow-type:
|
||||
*
|
||||
* The style of the shadow around the menubar.
|
||||
*
|
||||
* Deprecated: 3.20: Use CSS to determine the shadow; the value of
|
||||
* this style property is ignored.
|
||||
*/
|
||||
gtk_widget_class_install_style_property (widget_class,
|
||||
g_param_spec_enum ("shadow-type",
|
||||
P_("Shadow type"),
|
||||
@ -398,8 +404,6 @@ gtk_menu_bar_size_request (GtkWidget *widget,
|
||||
*minimum += border_width * 2;
|
||||
*natural += border_width * 2;
|
||||
|
||||
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
|
||||
{
|
||||
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
@ -413,7 +417,6 @@ gtk_menu_bar_size_request (GtkWidget *widget,
|
||||
*natural += border.top + border.bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_bar_get_preferred_width (GtkWidget *widget,
|
||||
@ -495,15 +498,12 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
|
||||
remaining_space.height = allocation->height -
|
||||
2 * border_width - border.top - border.bottom;
|
||||
|
||||
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
|
||||
{
|
||||
gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
|
||||
|
||||
remaining_space.x += border.left;
|
||||
remaining_space.y += border.top;
|
||||
remaining_space.width -= border.left + border.right;
|
||||
remaining_space.height -= border.top + border.bottom;
|
||||
}
|
||||
|
||||
requested_sizes = g_array_new (FALSE, FALSE, sizeof (GtkRequestedSize));
|
||||
|
||||
@ -636,7 +636,6 @@ gtk_menu_bar_draw (GtkWidget *widget,
|
||||
gtk_widget_get_allocated_width (widget) - border * 2,
|
||||
gtk_widget_get_allocated_height (widget) - border * 2);
|
||||
|
||||
if (get_shadow_type (GTK_MENU_BAR (widget)) != GTK_SHADOW_NONE)
|
||||
gtk_render_frame (context, cr,
|
||||
border, border,
|
||||
gtk_widget_get_allocated_width (widget) - border * 2,
|
||||
@ -770,18 +769,6 @@ _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
|
||||
g_signal_emit_by_name (to_activate, "activate_item");
|
||||
}
|
||||
|
||||
static GtkShadowType
|
||||
get_shadow_type (GtkMenuBar *menubar)
|
||||
{
|
||||
GtkShadowType shadow_type = GTK_SHADOW_OUT;
|
||||
|
||||
gtk_widget_style_get (GTK_WIDGET (menubar),
|
||||
"shadow-type", &shadow_type,
|
||||
NULL);
|
||||
|
||||
return shadow_type;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user