Beispiel #1
0
static void override_menu_key(void)
{
	if (gtk_menu_key_accel == NULL) /* for restoring the default value */
		g_object_get(G_OBJECT(gtk_settings_get_default()),
			"gtk-menu-bar-accel", &gtk_menu_key_accel, NULL);

	if (vc->ignore_menu_bar_accel)
		gtk_settings_set_string_property(gtk_settings_get_default(),
			"gtk-menu-bar-accel", "<Shift><Control><Mod1><Mod2><Mod3><Mod4><Mod5>F10", "Geany");
	else
		gtk_settings_set_string_property(gtk_settings_get_default(),
			"gtk-menu-bar-accel", gtk_menu_key_accel, "Geany");
}
Beispiel #2
0
/* perhaps needs to do something like:
    login_window_resize (FALSE);
    mdm_wm_center_window (GTK_WINDOW (login));
   after calling if doing during runtime
  */
void
mdm_set_theme (const char *theme_name)
{
	char *font_name;
	GtkSettings *settings = gtk_settings_get_default ();

	font_name = mdm_get_font (theme_name);

	gtk_settings_set_string_property (settings,
					  "gtk-theme-name", theme_name, "mdm");
	gtk_settings_set_string_property (settings,
					  "gtk-font-name", font_name, "mdm");
	g_free (font_name);
}
Beispiel #3
0
static void inline_F24_245 (EIF_POINTER arg1, EIF_POINTER arg2, EIF_POINTER arg3, EIF_POINTER arg4)
{
	#if GTK_MAJOR_VERSION > 1
	gtk_settings_set_string_property ((GtkSettings*) arg1, (gchar*) arg2, (gchar*) arg3, (gchar*) arg4);
#endif
	;
}
Beispiel #4
0
static void gtkColorDlgSetPalette(GtkColorSelection* colorsel, char* str)
{
  GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(colorsel));
  gchar* palette = gtkColorDlgStringToPalette(str);
  if (palette)
    gtk_settings_set_string_property(settings,
                                     "gtk-color-palette",
                                     palette,
                                     "gtk_color_selection_palette_to_string");
}
Beispiel #5
0
static void adjust_default_font()
{
    GtkSettings *settings = gtk_settings_get_default();
    const gchar *font = gdk_android_get_default_font();
    g_assert(settings != NULL);

    if (font)
    {
        gtk_settings_set_string_property(settings, "gtk-font-name", font, "gtk_android_init");
        g_info("Default GTK+ font is set to '%s'", font);
    }
}
Beispiel #6
0
JNIEXPORT void JNICALL
Java_org_gnome_gtk_GtkSettings_gtk_1settings_1set_1string_1property
(
	JNIEnv* env,
	jclass cls,
	jlong _self,
	jstring _name,
	jstring _vString,
	jstring _origin
)
{
	GtkSettings* self;
	const gchar* name;
	const gchar* vString;
	const gchar* origin;

	// convert parameter self
	self = (GtkSettings*) _self;

	// convert parameter name
	name = (const gchar*) bindings_java_getString(env, _name);
	if (name == NULL) {
		return; // Java Exception already thrown
	}

	// convert parameter vString
	vString = (const gchar*) bindings_java_getString(env, _vString);
	if (vString == NULL) {
		return; // Java Exception already thrown
	}

	// convert parameter origin
	origin = (const gchar*) bindings_java_getString(env, _origin);
	if (origin == NULL) {
		return; // Java Exception already thrown
	}

	// call function
	gtk_settings_set_string_property(self, name, vString, origin);

	// cleanup parameter self

	// cleanup parameter name
	bindings_java_releaseString(name);

	// cleanup parameter vString
	bindings_java_releaseString(vString);

	// cleanup parameter origin
	bindings_java_releaseString(origin);
}
Beispiel #7
0
void main (int argc, char **argv)
{
  GtkWidget *window, *entry, *hbox, *vbox, *label, *label2, *l3, *l4, *la;
  GtkWidget *scrolled_window;
  GtkWidget *table;
  int i,j;

  gtk_init (&argc, &argv);

  gtk_settings_set_string_property (gtk_settings_get_default (),
				    "gtk-theme-name", "nimbus", "gdm");


  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
  
  g_signal_connect (G_OBJECT (window),
                    "delete_event",
                    G_CALLBACK (gtk_main_quit),
                    NULL);

  entry = gtk_entry_new ();

  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 10);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
				  GTK_POLICY_AUTOMATIC,
				  GTK_POLICY_AUTOMATIC);  


  table = gtk_table_new (20, 20, FALSE);
  gtk_table_set_row_spacings (GTK_TABLE (table), 10);
  gtk_table_set_col_spacings (GTK_TABLE (table), 10);
  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), table);
  gtk_container_set_focus_hadjustment (GTK_CONTAINER (table),
    				   gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
  gtk_container_set_focus_vadjustment (GTK_CONTAINER (table),
    				   gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
  gtk_widget_show (table);

  for (i = 0; i < 20; i++)
	for (j = 0; j < 20; j++)
	  {
	    la= gtk_label_new ("     ");
	    gtk_table_attach_defaults (GTK_TABLE (table), la,
				       i, i+1, j, j+1);
	    gtk_widget_show (la);
	  }
  
  /* gtk_widget_set_sensitive (scrolled_window, FALSE);   */

  hbox = gtk_hbox_new (FALSE, 10);
  vbox = gtk_vbox_new (FALSE, 10);

  gtk_container_add (GTK_CONTAINER (window), vbox);

  label = gtk_label_new ("        ");
  label2 = gtk_label_new ("        ");
  l3 = gtk_label_new ("       ");
  l4 = gtk_label_new ("         ");
  
  gtk_container_add (GTK_CONTAINER (vbox), label);
  gtk_container_add (GTK_CONTAINER (vbox), hbox);
  gtk_container_add (GTK_CONTAINER (vbox), label2);
  
  gtk_container_add (GTK_CONTAINER (hbox), l3);
  gtk_container_add (GTK_CONTAINER (hbox), scrolled_window);
  gtk_container_add (GTK_CONTAINER (hbox), l4);

  gtk_widget_show_all (window);

  gtk_main ();
}
Beispiel #8
0
int
main (int argc, char *argv[])
{
	MplPanelClient *panel;
	GtkWidget      *window, *content;
	GtkRequisition  req;
	gboolean        standalone = FALSE;
	GtkSettings    *settings;
	GError         *error = NULL;
	GOptionEntry    entries[] = {
		{ "standalone", 's', 0, G_OPTION_ARG_NONE, &standalone,
		_("Run in standalone mode"), NULL },
		{ NULL }
	};

	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	textdomain (GETTEXT_PACKAGE);

	g_set_application_name (_("Moblin Bluetooth Panel"));
	gtk_init_with_args (&argc, &argv, _("- Moblin Bluetooth Panel"),
				entries, GETTEXT_PACKAGE, &error);

	if (error) {
		g_printerr ("%s\n", error->message);
		g_error_free (error);
		return 1;
	}

	gtk_window_set_default_icon_name ("bluetooth");

	/* Force to correct theme */
	settings = gtk_settings_get_default ();
	gtk_settings_set_string_property (settings, "gtk-theme-name",
					"Moblin-Netbook", NULL);

	if (standalone) {
		window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
		g_signal_connect (window, "delete-event", (GCallback) gtk_main_quit,
				NULL);
		gtk_widget_set_size_request (window, 1000, -1);
		content = moblin_panel_new ();
		gtk_widget_show (content);

		gtk_container_add (GTK_CONTAINER (window), content);
		gtk_widget_show (window);
	}  else {
		panel = mpl_panel_gtk_new (MPL_PANEL_BLUETOOTH, _("bluetooth"),
					THEME_DIR "/bluetooth-panel.css",
					"state-idle", TRUE);
		window  = mpl_panel_gtk_get_window (MPL_PANEL_GTK (panel));

		content = moblin_panel_new ();
		g_signal_connect (panel, "hide-end", (GCallback) _reset_view_cb, content);
		g_signal_connect (content, "state-changed",
				G_CALLBACK (bluetooth_status_changed), panel);
		g_signal_connect (content, "request-focus",
				  G_CALLBACK (panel_request_focus), panel);
		gtk_widget_show (content);

		gtk_container_add (GTK_CONTAINER (window), content);
		gtk_widget_size_request (window, &req);
		mpl_panel_client_set_height_request (panel, req.height);
	}

	gtk_main ();

	return 0;
}