/* Callback when the configuration dialog has recorded a configuration change. */ static gboolean dirmenu_apply_configuration(gpointer user_data) { GtkWidget * p = user_data; DirMenuPlugin * dm = lxpanel_plugin_get_data(p); char * path = dm->path; /* Normalize path */ if (path == NULL) dm->path = g_strdup(fm_get_home_dir()); else if (path[0] == '~') { dm->path = expand_tilda(path); g_free(path); } /* Save configuration */ config_group_set_string(dm->settings, "path", dm->path); config_group_set_string(dm->settings, "name", dm->name); config_group_set_string(dm->settings, "image", dm->image); lxpanel_button_set_icon(p, ((dm->image != NULL) ? dm->image : "file-manager"), -1); lxpanel_button_set_label(p, dm->name); gtk_widget_set_tooltip_text(p, dm->path); return FALSE; }
/* Callback when panel configuration changes. */ static void wincmd_panel_reconfigure(LXPanel *panel, GtkWidget *p) { WinCmdPlugin * wc = lxpanel_plugin_get_data(p); lxpanel_button_set_icon(p, wc->image, panel_get_icon_size(panel)); }
/* parameters width and keep_ratio are unused, kept for backward compatibility */ void fb_button_set_from_file(GtkWidget * btn, const char * img_file, gint width, gint height, gboolean keep_ratio) { lxpanel_button_set_icon(btn, img_file, height); }