static void mate_panel_applet_frame_matecomponent_change_orientation (MatePanelAppletFrame *frame, PanelOrientation orientation) { MatePanelAppletFrameMateComponent *matecomponent_frame = MATE_PANEL_APPLET_FRAME_MATECOMPONENT (frame); CORBA_unsigned_short orient = 0; switch (orientation) { case PANEL_ORIENTATION_TOP: orient = MATE_Vertigo_PANEL_ORIENT_DOWN; break; case PANEL_ORIENTATION_BOTTOM: orient = MATE_Vertigo_PANEL_ORIENT_UP; break; case PANEL_ORIENTATION_LEFT: orient = MATE_Vertigo_PANEL_ORIENT_RIGHT; break; case PANEL_ORIENTATION_RIGHT: orient = MATE_Vertigo_PANEL_ORIENT_LEFT; break; default: g_assert_not_reached (); break; } matecomponent_pbclient_set_short (matecomponent_frame->priv->property_bag, PROPERTY_ORIENT, orient, NULL); gtk_widget_queue_resize (GTK_WIDGET (frame)); }
static void xfapplet_screen_position_changed (XfcePanelPlugin *plugin, XfceScreenPosition position, gpointer data) { unsigned short orientation; GtkWidget *child = NULL; XfAppletPlugin *xap = (XfAppletPlugin*) data; if (!xap->configured) return; /* * Workaround: Xfce panel makes all items in all panels insensitive when * moving items between panels. Some Mate applets (noticeably the Mixer * applet) misbehave when the following happens: * 1. Applet is set insensitive; * 2. Applet changes orientation; * 3. Applet is set sensitive again. * The following makes sure the applet is set sensitive before it * changes orientation. */ child = xfapplet_get_plugin_child (xap->plugin); if (child) gtk_widget_set_sensitive (child, TRUE); orientation = xfapplet_xfce_screen_position_to_mate_applet_orientation (plugin, position); matecomponent_pbclient_set_short (xap->prop_bag, "panel-applet-orient", orientation, NULL); gtk_widget_queue_resize (GTK_WIDGET (plugin)); }
static gboolean xfapplet_size_changed (XfcePanelPlugin *plugin, int size, gpointer data) { XfAppletPlugin *xap = (XfAppletPlugin*) data; if (xap->configured) { gint sz = xfapplet_xfce_size_to_mate_size (size); matecomponent_pbclient_set_short (xap->prop_bag, "panel-applet-size", sz, NULL); } if (xfce_panel_plugin_get_orientation (plugin) == GTK_ORIENTATION_HORIZONTAL) gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size); else gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1); return TRUE; }
static void mate_panel_applet_frame_matecomponent_change_size (MatePanelAppletFrame *frame, guint size) { MatePanelAppletFrameMateComponent *matecomponent_frame = MATE_PANEL_APPLET_FRAME_MATECOMPONENT (frame); /* Normalise the size to the constants defined in the IDL. */ size = size <= PANEL_SIZE_XX_SMALL ? PANEL_SIZE_XX_SMALL : size <= PANEL_SIZE_X_SMALL ? PANEL_SIZE_X_SMALL : size <= PANEL_SIZE_SMALL ? PANEL_SIZE_SMALL : size <= PANEL_SIZE_MEDIUM ? PANEL_SIZE_MEDIUM : size <= PANEL_SIZE_LARGE ? PANEL_SIZE_LARGE : size <= PANEL_SIZE_X_LARGE ? PANEL_SIZE_X_LARGE : PANEL_SIZE_XX_LARGE; matecomponent_pbclient_set_short (matecomponent_frame->priv->property_bag, PROPERTY_SIZE, size, NULL); }