GNOME Bugzilla – Bug 761828
add a menu demo to foreigndrawing
Last modified: 2016-02-10 21:49:00 UTC
Created attachment 320802 [details] [review] patch to add a menu demo to foreigndrawing Setting GTK_STATE_FLAG_DIR_LTR/GTK_STATE_FLAG_DIR_RTL is required to get block arrows in menu context. Hacking foreigndrawing enabled me to realize that, so seems useful to add a menu demo there permanently.
Review of attachment 320802 [details] [review]: Looks interesting. Minor coding style fixes. ::: demos/gtk-demo/foreigndrawing.c @@ +157,3 @@ + /* arrow for left to right */ + arrowmenuitem_context = get_style (menuitem_context, "arrow"); + /* This information is taken from the GtkMenu docs, see "CSS nodes" */ Coding style: missing space between function name and open parenthesis. @@ +158,3 @@ + arrowmenuitem_context = get_style (menuitem_context, "arrow"); + gtk_style_context_set_state(arrowmenuitem_context, GTK_STATE_FLAG_DIR_LTR); + menu_context = get_style (NULL, "menu"); Coding style: missing space between function name and open parenthesis. Coding style: missing spaces around operators. @@ +161,3 @@ + + gtk_render_background (menuitem_context, cr, x, y+20, width, 20); + Coding style: missing spaces around operators. @@ +163,3 @@ + gtk_render_frame (menuitem_context, cr, x, y+20, width, 20); + + gtk_render_background (menu_context, cr, x, y, width, height); Coding style: same as above. @@ +329,2 @@ width = gtk_widget_get_allocated_width (widget); + panewidth = width/2; Coding style: missing spaces around operator. @@ +348,3 @@ + draw_progress (widget, cr, 10, 160, panewidth - 20, 6, 50); + + draw_menu(widget, cr, 10 + panewidth, 10, panewidth - 20, 160); Coding style: missing space between function name and open parenthesis.
Created attachment 320809 [details] [review] updated patch