libretro / bsnes

Super Nintendo (Super Famicom) emulator
https://bsnes.byuu.org
Other
11 stars 13 forks source link

black menubar with gtk3 gui #13

Closed galtgendo closed 4 years ago

galtgendo commented 4 years ago

The most simple way to fix that problem I found would be adding in hiro/gtk/application.cpp in the #elif HIRO_GTK==3 block something like:

  GtkStyleContext *context;
  GtkCssProvider *provider;

  provider = gtk_css_provider_new();
  gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider),
                                 "menubar {\n"
                                 "background-color : gray;\n"
                                 "}\n",
                                 -1, nullptr);
  gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
                                  GTK_STYLE_PROVIDER(provider),
                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
  g_object_unref(provider);

Minor gotcha: technically, if setting background, foreground should be set too, just in case someone's using a black theme. The colors themselves are matter of taste (standard css syntax). I'm going with gdk_screen_get_default, as at that point gtk has only just been initialized, so there's nothing else I could get access to.

rtretiakov commented 4 years ago

This issue should be posted in the upstream repository.