Beispiel #1
0
static void
ViewAutoDrawerEnforce(ViewAutoDrawer *that, // IN
                      gboolean animate)     // IN
{
   double fraction;
   GtkAllocation allocation;
   ViewAutoDrawerPrivate *priv = that->priv;

   if (!priv->active) {
      ViewOvBox_SetMin(VIEW_OV_BOX(that), -1);
      ViewOvBox_SetFraction(VIEW_OV_BOX(that), 0);
      return;
   }

   g_assert(priv->over != NULL);
   g_assert(GTK_IS_WIDGET(priv->over));

   ViewOvBox_SetMin(VIEW_OV_BOX(that), priv->noOverlapPixels);

   // The forceClosing flag overrides the opened flag.
   if (priv->opened && !priv->forceClosing) {
      fraction = 1;
   } else {
      gtk_widget_get_allocation (priv->over, &allocation);
      fraction = ((double)priv->overlapPixels / allocation.height);
   }

   if (!animate) {
      ViewOvBox_SetFraction(VIEW_OV_BOX(that), fraction);
   }
   ViewDrawer_SetGoal(VIEW_DRAWER(that), fraction);
}
Beispiel #2
0
static void
ViewAutoDrawerEnforce(ViewAutoDrawer *that, // IN
                      gboolean animate)     // IN
{
   double fraction;
   ViewAutoDrawerPrivate *priv = that->priv;

   if (!priv->active) {
      ViewOvBox_SetMin(VIEW_OV_BOX(that), -1);
      ViewOvBox_SetFraction(VIEW_OV_BOX(that), 0);
      return;
   }

   g_assert(priv->over != NULL);
   g_assert(GTK_IS_WIDGET(priv->over));

   ViewOvBox_SetMin(VIEW_OV_BOX(that), priv->noOverlapPixels);
   fraction = priv->opened
      ? 1 : ((double)priv->overlapPixels / priv->over->allocation.height);
   if (!animate) {
      ViewOvBox_SetFraction(VIEW_OV_BOX(that), fraction);
   }
   ViewDrawer_SetGoal(VIEW_DRAWER(that), fraction);
}