Пример #1
0
void
orientation_change (AppletInfo  *info,
		    PanelWidget *panel)
{
	PanelOrientation orientation;

	orientation = panel_widget_get_applet_orientation (panel);

	switch (info->type) {
	case PANEL_OBJECT_APPLET:
		panel_applet_frame_change_orientation (
				PANEL_APPLET_FRAME (info->widget), orientation);
		break;
	case PANEL_OBJECT_MENU:
	case PANEL_OBJECT_LAUNCHER:
	case PANEL_OBJECT_ACTION:
		button_widget_set_orientation (BUTTON_WIDGET (info->widget), orientation);
		break;
	case PANEL_OBJECT_MENU_BAR:
	case PANEL_OBJECT_USER_MENU:
		panel_menu_bar_object_set_orientation (PANEL_MENU_BAR_OBJECT (info->widget), orientation);
		break;
	case PANEL_OBJECT_SEPARATOR:
		panel_separator_set_orientation (PANEL_SEPARATOR (info->widget),
						 orientation);
		break;
	default:
		break;
	}
}
static void
panel_menu_bar_object_set_property (GObject	  *object,
                                    guint	   prop_id,
                                    const GValue *value,
                                    GParamSpec	  *pspec)
{
    PanelMenuBarObject *menubar;

    g_return_if_fail (PANEL_IS_MENU_BAR_OBJECT (object));

    menubar = PANEL_MENU_BAR_OBJECT (object);

    switch (prop_id) {
    case PROP_ORIENTATION:
        panel_menu_bar_object_set_orientation (menubar,
                                               g_value_get_enum (value));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}