• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_STYLE_PROVIDER函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_STYLE_PROVIDER函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_STYLE_PROVIDER函数的具体用法?C++ GTK_STYLE_PROVIDER怎么用?C++ GTK_STYLE_PROVIDER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_STYLE_PROVIDER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cc_set_css

void cc_set_css(GtkWidget*w,gchar*file)
{
    GFile *cssfile=g_file_new_for_path(file);
GtkCssProvider*provider=gtk_css_provider_new();
GtkStyleContext*context=gtk_widget_get_style_context(w);
gtk_style_context_add_provider(context,GTK_STYLE_PROVIDER(provider),GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(provider),cssfile,NULL);
g_object_unref(provider);

}
开发者ID:zoeritic,项目名称:cclient,代码行数:10,代码来源:cc-style.c


示例2: tile_surface

static cairo_surface_t *
tile_surface (cairo_surface_t *surface,
              int              width,
              int              height)
{
	cairo_surface_t *copy;
	cairo_t *cr;

	if (surface == NULL)
	{
		copy = gdk_window_create_similar_surface (gdk_get_default_root_window (),
		                                          CAIRO_CONTENT_COLOR,
		                                          width, height);
	}
	else
	{
		copy = cairo_surface_create_similar (surface,
		                                     cairo_surface_get_content (surface),
		                                     width, height);
	}

	cr = cairo_create (copy);

	if (surface != NULL)
	{
		cairo_pattern_t *pattern;
		cairo_set_source_surface (cr, surface, 0.0, 0.0);
		pattern = cairo_get_source (cr);
		cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
	}
	else
	{
		GtkStyleContext *context;
		GdkRGBA bg;
		context = gtk_style_context_new ();
		gtk_style_context_add_provider (context,
										GTK_STYLE_PROVIDER (gtk_css_provider_get_default ()),
										GTK_STYLE_PROVIDER_PRIORITY_THEME);
		gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
		gdk_cairo_set_source_rgba(cr, &bg);
		g_object_unref (G_OBJECT (context));
	}

	cairo_paint (cr);

	if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
	{
		cairo_surface_destroy (copy);
		copy = NULL;
	}

	cairo_destroy(cr);

	return copy;
}
开发者ID:mate-desktop,项目名称:mate-desktop,代码行数:55,代码来源:mate-bg-crossfade.c


示例3: gs_feature_tile_init

static void
gs_feature_tile_init (GsFeatureTile *tile)
{
	gtk_widget_set_has_window (GTK_WIDGET (tile), FALSE);
	gtk_widget_init_template (GTK_WIDGET (tile));

	tile->provider = gtk_css_provider_new ();
	gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
						   GTK_STYLE_PROVIDER (tile->provider),
						   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
开发者ID:JamesLinus,项目名称:gnome-software,代码行数:11,代码来源:gs-feature-tile.c


示例4: side_modify_css

void side_modify_css(char *str)
{
  GdkDisplay *display;
  GdkScreen *screen;
  display = gdk_display_get_default ();
  screen = gdk_display_get_default_screen (display);
  GtkCssProvider *provider;
  provider = gtk_css_provider_new ();
  gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
  gtk_css_provider_load_from_data(provider, str, -1, NULL);
  g_object_unref (provider);
}
开发者ID:gitter-badger,项目名称:desktop-2,代码行数:12,代码来源:widgets.c


示例5: gnc_add_css_file

void
gnc_add_css_file (void)
{
    GtkCssProvider *provider_user, *provider_app, *provider_fallback;
    GdkDisplay *display;
    GdkScreen *screen;
    const gchar *var;
    GError *error = 0;

    provider_user = gtk_css_provider_new ();
    provider_app = gtk_css_provider_new ();
    provider_fallback = gtk_css_provider_new ();
    display = gdk_display_get_default ();
    screen = gdk_display_get_default_screen (display);

    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_fallback), GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_app), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_user), GTK_STYLE_PROVIDER_PRIORITY_USER);

#if GTK_CHECK_VERSION(3,20,0)
    gtk_css_provider_load_from_resource (provider_app, "/org/gnucash/gnucash-320.css");
#else
    gtk_css_provider_load_from_resource (provider_app, "/org/gnucash/gnucash-310.css");
#endif
    gtk_css_provider_load_from_resource (provider_fallback,  "/org/gnucash/gnucash-fallback-310.css");

    var = g_get_home_dir ();
    if (var)
    {
        gchar *str;
        str = g_build_filename (var, ".gtk-3.0-gnucash.css", (char *)NULL);
        gtk_css_provider_load_from_path (provider_user, str, &error);
        g_free (str);
    }
    g_object_unref (provider_user);
    g_object_unref (provider_app);
    g_object_unref (provider_fallback);
}
开发者ID:jralls,项目名称:gnucash,代码行数:38,代码来源:gnc-gnome-utils.c


示例6: set_button_style

static void
set_button_style(GtkWidget *button, gint type)
{
#if GTK_CHECK_VERSION(2, 90, 0)
    GtkStyleContext *context = gtk_widget_get_style_context(button);
    GtkCssProvider *provider = gtk_css_provider_new();
    switch (type) {
    case TYPE_ICON:
        gtk_css_provider_load_from_data(provider,
                                        "#uim-systray-button {\n"
                                        " -GtkWidget-focus-line-width: 0;\n"
                                        " -GtkWidget-focus-padding: 0;\n"
                                        " padding-top: 0;\n"
                                        " padding-bottom: 0;\n"
                                        " padding-left: 2px;\n"
                                        " padding-right: 2px;\n"
                                        "}\n", -1, NULL);
        break;
    case TYPE_STANDALONE:
        gtk_css_provider_load_from_data(provider,
                                        "#uim-toolbar-button {\n"
                                        " padding-left: 5px;\n"
                                        " padding-right: 5px;\n"
                                        "}\n", -1, NULL);
        break;
    case TYPE_APPLET:
        gtk_css_provider_load_from_data(provider,
                                        "#uim-applet-button {\n"
                                        " padding-left: 2px;\n"
                                        " padding-right: 2px;\n"
                                        "}\n", -1, NULL);
        break;
    }
    gtk_style_context_add_provider(context,
                                   GTK_STYLE_PROVIDER(provider),
                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
    g_object_unref(provider);
#endif
    switch (type) {
    case TYPE_ICON:
        gtk_widget_set_name(button, "uim-systray-button");
        break;
    case TYPE_STANDALONE:
        gtk_widget_set_name(button, "uim-toolbar-button");
        break;
    case TYPE_APPLET:
        gtk_widget_set_name(button, "uim-applet-button");
        break;
    }
}
开发者ID:na4zagin3,项目名称:uim,代码行数:50,代码来源:common-gtk.c


示例7: gtk_css_provider_get_default

void Editor::setStyle()
    {
    GtkCssProvider *provider = gtk_css_provider_get_default();
    GdkDisplay *display = gdk_display_get_default();
    GdkScreen *screen = gdk_display_get_default_screen(display);

    OovString path = Project::getBinDirectory();
    path += "OovEdit.css";
    GError *err = 0;
    gtk_css_provider_load_from_path(provider, path.getStr(), &err);
    gtk_style_context_add_provider_for_screen (screen,
        GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
    g_object_unref(provider);
    }
开发者ID:animatedb,项目名称:oovaide,代码行数:14,代码来源:oovEdit.cpp


示例8: gtk_paned_new

GtkWidget *gtk_paned_new_with_handle(GtkOrientation orientation)
{
	GtkWidget *pnd = gtk_paned_new(orientation);
	GtkStyleContext *context = gtk_widget_get_style_context(pnd);
	GtkCssProvider  *cssprv =  gtk_css_provider_new();
	GdkRGBA clrSel = {0.,0.,0.,0.};
	char css[2048];
	
	gtk_style_context_lookup_color(context, "bg_color", &clrSel);
	if (orientation == GTK_ORIENTATION_HORIZONTAL)
	{
		sprintf(css, "* {\n -GtkPaned-handle-size: 3; \n } \n .pane-separator.horizontal {\n background-image: -gtk-gradient (linear, left top, left bottom, from (%s), color-stop (0.5, shade (%s, 0.95)), to (%s)); \n -unico-centroid-texture: url(\"%s\");\n }\n", gdk_rgba_to_string(&clrSel), gdk_rgba_to_string(&clrSel), gdk_rgba_to_string(&clrSel), imgOrzHnd);
	}
	else
	{
		sprintf(css, "* {\n -GtkPaned-handle-size: 3; \n } \n \n .pane-separator.vertical {\n background-image: -gtk-gradient (linear, left top, right top, from (%s), color-stop (0.5, shade (%s, 0.95)), to (%s)); \n -unico-centroid-texture: url(\"%s\");\n }\n", gdk_rgba_to_string(&clrSel), gdk_rgba_to_string(&clrSel), gdk_rgba_to_string(&clrSel), imgVrtHnd);
	}
	gtk_style_context_remove_provider(context, GTK_STYLE_PROVIDER (cssprv));
	gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER (cssprv), GTK_STYLE_PROVIDER_PRIORITY_USER);
	gtk_css_provider_load_from_data(cssprv, css, -1, NULL);
	g_object_unref(cssprv);
	return pnd;
}
开发者ID:OpenSkyProject,项目名称:OpenSkyImager,代码行数:23,代码来源:gtkTools.c


示例9: add_css_provider

static void
add_css_provider (GApplication *application,
                  gboolean theme)
{
  gs_unref_object GtkCssProvider *provider;

  provider = gtk_css_provider_new ();
  if (!load_css_from_resource (application, provider, theme))
    return;

  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
                                             GTK_STYLE_PROVIDER (provider),
                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
开发者ID:pledges,项目名称:gnome-terminal,代码行数:14,代码来源:terminal-app.c


示例10: theme_init

void theme_init(){
    char *theme_file;

    theme_file = get_theme_file("default.css");
    if (!theme_file){
        return;
    }

    provider = GTK_STYLE_PROVIDER(gtk_css_provider_new());
    gtk_css_provider_load_from_path(
            GTK_CSS_PROVIDER(provider), theme_file, NULL);

    g_free(theme_file);
}
开发者ID:LastAvenger,项目名称:srain,代码行数:14,代码来源:theme.c


示例11: button_clicked_cb

static void
button_clicked_cb (GtkButton *b,
                   gpointer user_data)
{
  PackData *d = user_data;
  GtkCssProvider *provider;
  GtkStyleContext *style;
  GError *error = NULL;
  gchar *data, *bg_str, *grad1, *grad2;
  const gchar data_format[] = "GtkNumerableIcon { background-color: %s; color: #000000;"
    "background-image: -gtk-gradient (linear, 0 0, 1 1, from(%s), to(%s));"
    "font: Monospace 12;"
    /* "background-image: url('apple-red.png');" */
    "}";

  bg_str = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));
  grad1 = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));
  grad2 = g_strdup_printf ("rgb(%d,%d,%d)", g_random_int_range (0, 255), g_random_int_range (0, 255), g_random_int_range (0, 255));

  data = g_strdup_printf (data_format, bg_str, grad1, grad2);

  provider = gtk_css_provider_new ();
  gtk_css_provider_load_from_data (provider, data, -1, &error);

  g_assert (error == NULL);

  style = gtk_widget_get_style_context (d->image);
  gtk_style_context_add_provider (style, GTK_STYLE_PROVIDER (provider),
                                  GTK_STYLE_PROVIDER_PRIORITY_USER);

  if (d->odd) {
    gtk_numerable_icon_set_background_icon_name (GTK_NUMERABLE_ICON (d->numerable), NULL);
    gtk_numerable_icon_set_count (GTK_NUMERABLE_ICON (d->numerable), g_random_int_range (-99, 99));
  } else {
    gtk_numerable_icon_set_background_icon_name (GTK_NUMERABLE_ICON (d->numerable),
                                                 "emblem-favorite");
    gtk_numerable_icon_set_label (GTK_NUMERABLE_ICON (d->numerable), "IVX");
  }
  
  gtk_image_set_from_gicon (GTK_IMAGE (d->image), d->numerable, d->size);

  d->odd = !d->odd;

  g_free (data);
  g_free (bg_str);
  g_free (grad1);
  g_free (grad2);
  
  g_object_unref (provider);
}
开发者ID:3v1n0,项目名称:gtk,代码行数:50,代码来源:testnumerableicon.c


示例12: test_init_of_theme

static void
test_init_of_theme (void)
{
  GtkStyleContext *context;
  GtkCssProvider *provider;
  GtkWidgetPath *path;
  GdkRGBA before, after;
  char *css;

  /* Test that a style context actually uses the theme loaded for the 
   * screen it is using. If no screen is set, it's the default one.
   */
  context = gtk_style_context_new ();
  path = gtk_widget_path_new ();

  /* Set a path that will have a color set.
   * (This could actually fail if style classes change, so if this test
   *  fails, make sure to have this path represent something sane.)
   */
  gtk_widget_path_append_type (path, GTK_TYPE_WINDOW);
  gtk_widget_path_iter_add_class (path, -1, GTK_STYLE_CLASS_BACKGROUND);
  gtk_style_context_set_path (context, path);
  gtk_widget_path_free (path);

  /* Get the color. This should be initialized by the theme and not be
   * the default. */
  gtk_style_context_get_color (context, gtk_style_context_get_state (context), &before);

  /* Add a style that sets a different color for this widget.
   * This style has a higher priority than fallback, but a lower 
   * priority than the theme. */
  css = g_strdup_printf (".background { color: %s; }",
                         before.alpha < 0.5 ? "black" : "transparent");
  provider = gtk_css_provider_new ();
  gtk_css_provider_load_from_data (provider, css, -1, NULL);
  gtk_style_context_add_provider (context,
                                  GTK_STYLE_PROVIDER (provider),
                                  GTK_STYLE_PROVIDER_PRIORITY_FALLBACK + 1);
  g_object_unref (provider);

  /* Get the color again. */
  gtk_style_context_get_color (context, gtk_style_context_get_state (context), &after);

  /* Because the style we added does not influence the color,
   * the before and after colors should be identical. */
  g_assert (gdk_rgba_equal (&before, &after));

  g_object_unref (context);
}
开发者ID:ConfusedReality,项目名称:pkg_toolkit_gtk3,代码行数:49,代码来源:firefox-stylecontext.c


示例13: main

int
main(int argc, char* argv[]) {
	GtkWidget *win;
	GtkCssProvider *cssprovider;
	GdkScreen *screen;
	GError *error;

	/* Disable global menus */
	g_unsetenv ("UBUNTU_MENUPROXY");
	gtk_init(&argc, &argv);
	ido_init ();
	screen = gdk_screen_get_default();
	win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_window_set_default_size (GTK_WINDOW (win), -1, 28);
	g_signal_connect(win, "realize", G_CALLBACK(on_realize), NULL);
	g_signal_connect(screen, "monitors-changed", G_CALLBACK(on_screen_change), win);
	g_signal_connect(screen, "size-changed", G_CALLBACK(on_screen_change), win);

	cssprovider = gtk_css_provider_new ();
	gtk_css_provider_load_from_data(cssprovider,
			"GtkMenuBar {\n"
			"    -GtkMenuBar-internal-padding: 0;\n"
			"    -GtkMenuBar-shadow-type: none;\n"
			"}\n"
			"GtkWidget {\n"
			"    -GtkWidget-focus-line-width: 0;\n"
			"    -GtkWidget-focus-padding: 0;\n"
			"}\n", -1, NULL);

	gtk_style_context_add_provider_for_screen(screen,
		GTK_STYLE_PROVIDER (cssprovider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

	GtkWidget* menubar = gtk_menu_bar_new();

	load_indicator_files (INDICATOR_DIR, menubar);
	IndicatorObject * io = indicator_object_new_from_file("/usr/lib/indicators3/7/libapplication.so");
	load_indicator(io, menubar);

	GtkWidget* hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3);
	gtk_container_add(GTK_CONTAINER(win), hbox);
	gtk_box_pack_end(GTK_BOX(hbox), menubar, FALSE, FALSE, 0);
	g_signal_connect_after(menubar, "draw", G_CALLBACK(on_draw), NULL);
	g_signal_connect(win, "draw", G_CALLBACK(on_draw), NULL);
	gtk_widget_show_all(win);
	gdk_window_process_updates(gtk_widget_get_window(win), TRUE);
	gtk_widget_set_app_paintable(win, TRUE);
	gtk_main();
	return 0;
}
开发者ID:linuxmint,项目名称:ubiquity,代码行数:49,代码来源:panel.c


示例14: irc_application_activate

static void
irc_application_activate (GApplication *self)
{
  	IrcApplicationPrivate *priv = irc_application_get_instance_private (IRC_APPLICATION(self));

	if (priv->main_window == NULL)
	{
		priv->main_window = GTK_WINDOW(irc_window_new (self));
		gtk_style_context_add_provider_for_screen (gtk_window_get_screen (priv->main_window),
											 GTK_STYLE_PROVIDER(priv->css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
		irc_application_load_plugins (IRC_APPLICATION(self)); // In-case plugins modify UI
	}

	gtk_window_present (priv->main_window);
}
开发者ID:TingPing,项目名称:irc-client,代码行数:15,代码来源:irc-application.c


示例15: gui_update_font

/**************************************************************************
  Updates a gui font style.
**************************************************************************/
void gui_update_font(const char *font_name, const char *font_value)
{
  char *str;
  GtkCssProvider *provider;

  str = g_strdup_printf("#Freeciv #%s { font: %s;}", font_name, font_value);

  provider = gtk_css_provider_new();
  gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider),
    str, -1, NULL);
  gtk_style_context_add_provider_for_screen(
    gtk_widget_get_screen(toplevel), GTK_STYLE_PROVIDER(provider),
    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
  g_free(str);
}
开发者ID:longturn,项目名称:freeciv-S2_5,代码行数:18,代码来源:gui_stuff.c


示例16: sc_button_set_style

static void sc_button_set_style(GtkButton* button)
{

    GtkCssProvider* provider;
    GtkStyleContext*context;
    provider=gtk_css_provider_new();
    context=gtk_widget_get_style_context(GTK_WIDGET(button));

    gtk_style_context_add_provider(context,GTK_STYLE_PROVIDER(provider),GTK_STYLE_PROVIDER_PRIORITY_USER);

    gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider),"GtkButton {border-radius:0px ;padding:0}",-1,NULL);

    g_object_unref(provider);

}
开发者ID:ranrangor,项目名称:ScreenCapturer,代码行数:15,代码来源:sc-utils.c


示例17: gis_password_page_init

static void
gis_password_page_init (GisPasswordPage *page)
{
  GtkCssProvider *provider;

  g_resources_register (password_get_resource ());

  provider = gtk_css_provider_new ();
  gtk_css_provider_load_from_resource (provider, "/org/gnome/initial-setup/gis-password-page.css");
  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
                                             GTK_STYLE_PROVIDER (provider),
                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
  g_object_unref (provider);

  gtk_widget_init_template (GTK_WIDGET (page));
}
开发者ID:GNOME,项目名称:gnome-initial-setup,代码行数:16,代码来源:gis-password-page.c


示例18: anaconda_widget_apply_stylesheet

/**
 * anaconda_widget_apply_stylesheet:
 * @widget: The widget to apply the style data to.
 * @name: The name of the widget's stylesheet.
 *
 * Apply CSS data to a widget's #GtkStyleContext. The data will not affect any
 * other widgets, including children of this widget.
 *
 * The CSS data lives in the resource bundle, the advantage of which is that
 * the stylesheet is just a normal stylesheet in the source tree with normal
 * syntax highlighting and no weird C string stuff or anything. The
 * disadvantage is that the stylesheet can only be applied to one widget at a
 * time so there's a bunch of tiny little stylesheets in the resources
 * directory, but that's the world we live in.
 *
 * The stylesheet should live in the resources/ directory in the source tree
 * and will be fetched as /org/fedoraproject/anaconda/widgets/<name>.css.
 *
 * The stylesheet is added to the style context at one less than
 * #GTK_STYLE_PROVIDER_PRIORITY_APPLICATION so that the style will not
 * overridden by a sloppy wildcard in a theme somewhere, but it will be
 * overridden by the application-level stylesheet, which may include
 * product-specific customizations.
 *
 */
void anaconda_widget_apply_stylesheet(GtkWidget *widget, const gchar *name)
{
    GtkCssProvider *style_provider;
    GtkStyleContext *style_context;
    gchar *resource_path;

    resource_path = g_strdup_printf("/org/fedoraproject/anaconda/widgets/%s.css", name);

    style_provider = gtk_css_provider_new();
    gtk_css_provider_load_from_resource(style_provider, resource_path);
    g_free(resource_path);

    style_context = gtk_widget_get_style_context(widget);
    gtk_style_context_add_provider(style_context, GTK_STYLE_PROVIDER(style_provider),
            GTK_STYLE_PROVIDER_PRIORITY_APPLICATION - 1);
}
开发者ID:bwann,项目名称:anaconda,代码行数:41,代码来源:widgets-common.c


示例19: cc_style_setup

void cc_style_setup()
{

    GtkCssProvider* provider=gtk_css_provider_new();

    GdkScreen*screen=gdk_display_get_default_screen(gdk_display_get_default());

    GFile* cssfile=g_file_new_for_path(STYLE_PATH "image.css");
    gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(provider),cssfile,NULL);

    gtk_style_context_add_provider_for_screen(screen,GTK_STYLE_PROVIDER(provider),
            GTK_STYLE_PROVIDER_PRIORITY_USER);

    g_object_unref(provider);

}
开发者ID:zoeritic,项目名称:cclient,代码行数:16,代码来源:cc-style.c


示例20: panel_menu_bar_init

static void panel_menu_bar_init(PanelMenuBar* menubar)
{
#if GTK_CHECK_VERSION (3, 0, 0)
	GtkCssProvider *provider;
#endif

	menubar->priv = PANEL_MENU_BAR_GET_PRIVATE(menubar);

#if GTK_CHECK_VERSION (3, 0, 0)
	provider = gtk_css_provider_new ();
	gtk_css_provider_load_from_data (provider,
		"PanelMenuBar {\n"
		" border-width: 0px;\n"
		"}",
		-1, NULL);
	gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (menubar)),
		GTK_STYLE_PROVIDER (provider),
		GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
	g_object_unref (provider);
#endif

	menubar->priv->info = NULL;

	menubar->priv->settings = g_settings_new (PANEL_MENU_BAR_SCHEMA);

	menubar->priv->applications_menu = create_applications_menu("mate-applications.menu", NULL, TRUE);

	menubar->priv->applications_item = panel_image_menu_item_new();
	gtk_menu_item_set_label(GTK_MENU_ITEM(menubar->priv->applications_item), _("Applications"));

	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar->priv->applications_item), menubar->priv->applications_menu);
	gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->applications_item);

	menubar->priv->places_item = panel_place_menu_item_new(FALSE);
	gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->places_item);

	menubar->priv->desktop_item = panel_desktop_menu_item_new(FALSE, TRUE);
	gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menubar->priv->desktop_item);

	panel_menu_bar_setup_tooltip(menubar);

	panel_menu_bar_update_visibility(menubar->priv->settings, NULL, menubar);
	g_signal_connect(menubar->priv->settings, "changed", G_CALLBACK (panel_menu_bar_update_visibility), menubar);

	panel_menu_bar_update_text_gravity(menubar);
	g_signal_connect(menubar, "screen-changed", G_CALLBACK(panel_menu_bar_update_text_gravity), NULL);
}
开发者ID:j-rueger,项目名称:mate-panel,代码行数:47,代码来源:panel-menu-bar.c



注:本文中的GTK_STYLE_PROVIDER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_SWITCH函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_STATUSBAR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap