当前位置: 首页>>代码示例>>C++>>正文


C++ MX_STYLABLE函数代码示例

本文整理汇总了C++中MX_STYLABLE函数的典型用法代码示例。如果您正苦于以下问题:C++ MX_STYLABLE函数的具体用法?C++ MX_STYLABLE怎么用?C++ MX_STYLABLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MX_STYLABLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: penge_count_tile_set_count

static void
penge_count_tile_set_count (PengeCountTile *self,
                            guint           count)
{
  PengeCountTilePrivate *priv = self->priv;
  gchar *count_str;

  priv->count = count;

  /* min-width does not seem to work, so we workaround adding padding spaced
   * around the number for 1 digit version */
  if (count < 10)
    count_str = g_strdup_printf (" %u ", count);
  else
    count_str = g_strdup_printf ("%u", count);

  mx_label_set_text (MX_LABEL (priv->count_label), count_str);
  g_free (count_str);

  if (count == 0)
    mx_stylable_set_style_class (MX_STYLABLE (priv->count_label),
                                 "PengeZeroCountLabel");
  else
    mx_stylable_set_style_class (MX_STYLABLE (priv->count_label),
                                 "PengeCountLabel");

  if (priv->compact)
    penge_count_tile_update_tooltip (self);
}
开发者ID:dudochkin-victor,项目名称:gogoo-panel-myzone,代码行数:29,代码来源:penge-count-tile.c

示例2: mx_button_leave

static gboolean
mx_button_leave (ClutterActor         *actor,
                 ClutterCrossingEvent *event)
{
  MxButton *button = MX_BUTTON (actor);
  MxWidget *widget = MX_WIDGET (actor);

  if (event->source != actor)
    return FALSE;

  /* hide the tooltip */
  if (mx_widget_get_tooltip_text (widget))
    mx_widget_hide_tooltip (widget);

  /* check if the widget is disabled */
  if (mx_widget_get_disabled (MX_WIDGET (actor)))
    return FALSE;

  if (button->priv->is_pressed)
    {
      //clutter_ungrab_pointer ();

      mx_widget_long_press_cancel (widget);
      mx_stylable_style_pseudo_class_remove (MX_STYLABLE (widget), "active");
      button->priv->is_pressed = FALSE;
    }

  mx_stylable_style_pseudo_class_remove (MX_STYLABLE (widget), "hover");

  return FALSE;
}
开发者ID:danni,项目名称:mx,代码行数:31,代码来源:mx-button.c

示例3: dawati_bt_device_init

static void
dawati_bt_device_init (DawatiBtDevice *device)
{
  ClutterActor *button;
  DawatiBtDevicePrivate *priv = GET_PRIVATE (device);

  mx_stylable_set_style_class (MX_STYLABLE (device), "BtDevice");

  priv->label = mx_label_new ();
  mx_stylable_set_style_class (MX_STYLABLE (priv->label), "BtTitle");
  mx_box_layout_insert_actor_with_properties (MX_BOX_LAYOUT (device), priv->label, -1,
                                              "expand", TRUE,
                                              "x-fill", FALSE,
                                              "y-fill", FALSE,
                                              "x-align", MX_ALIGN_START,
                                              "y-align", MX_ALIGN_MIDDLE,
                                              NULL);

  button = mx_button_new ();
  mx_stylable_set_style_class (MX_STYLABLE (button), "BtCloseButton");
  mx_bin_set_child (MX_BIN (button), mx_icon_new ());
  g_signal_connect (button, "clicked",
                    G_CALLBACK (_disconnect_clicked_cb), device);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (device), button, -1);
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:25,代码来源:dawati-bt-device.c

示例4: mex_telepathy_channel_create_preview

static void
mex_telepathy_channel_create_preview (MexTelepathyChannel *self)
{
  MexTelepathyChannelPrivate *priv = MEX_TELEPATHY_CHANNEL (self)->priv;

  ClutterActor *video_preview_area;

  priv->video_outgoing = clutter_texture_new ();
  clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->video_outgoing),
                                         TRUE);

  priv->outgoing_sink =
    clutter_gst_video_sink_new (CLUTTER_TEXTURE (priv->video_outgoing));

  video_preview_area = mx_stack_new ();

  clutter_container_add (CLUTTER_CONTAINER (video_preview_area),
                         mex_telepathy_channel_create_static_image(),
                         priv->video_outgoing,
                         NULL);

  mx_stylable_set_style_class (MX_STYLABLE (video_preview_area),
                               "PreviewStack");

  clutter_actor_set_height (video_preview_area, 150.0);
  clutter_actor_add_effect (video_preview_area,
                            CLUTTER_EFFECT (
                              mex_telepathy_channel_create_shadow ()));

  priv->preview_area = mx_frame_new ();
  mx_stylable_set_style_class (MX_STYLABLE (priv->preview_area),
                               "PreviewPadding");
  mx_bin_set_child (MX_BIN (priv->preview_area), video_preview_area);
}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:34,代码来源:mex-telepathy-channel.c

示例5: _enter_event_cb

static gboolean
_enter_event_cb (ClutterActor         *actor,
                 ClutterCrossingEvent *event,
                 gpointer              data)
{
  MxFocusable *focusable;
  MxFocusManager *f_manager;

  f_manager =
    mx_focus_manager_get_for_stage (CLUTTER_STAGE (clutter_actor_get_stage (actor)));

  focusable = mx_focus_manager_get_focused (f_manager);

  /* hide the hover state on a button that has accepted focus via the default
   * focus as we're navigating by mouse and not keys we don't want to move
   * the focus as we may still want it in the place e.g. search bar
   */
  if ((focusable) &&
      (MNB_IS_LAUNCHER_BUTTON (focusable)) &&
      (CLUTTER_ACTOR (focusable) != actor))
    mx_stylable_set_style_pseudo_class (MX_STYLABLE (focusable), NULL);

  mx_stylable_set_style_pseudo_class (MX_STYLABLE (actor), "hover");

  return FALSE;
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:26,代码来源:mnb-launcher-button.c

示例6: mex_telepathy_channel_toggle_mute

static void
mex_telepathy_channel_toggle_mute (MxAction *action,
                                   gpointer  user_data)
{
  MexTelepathyChannel *self = MEX_TELEPATHY_CHANNEL (user_data);
  MexTelepathyChannelPrivate *priv = self->priv;

  gboolean muted;
  g_object_get (priv->mic_volume, "mute", &muted, NULL);

  muted = !muted;
  g_object_set (priv->mic_volume, "mute", muted, NULL);

  if (muted)
    {
      mx_stylable_set_style_class (MX_STYLABLE(
                                     priv->mute_button), "MediaUnmute");
      mx_action_set_display_name (action, "Mic On");
    }
  else
    {
      mx_stylable_set_style_class (MX_STYLABLE(priv->mute_button), "MediaMute");
      mx_action_set_display_name (action, "Mic Off");
    }
}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:25,代码来源:mex-telepathy-channel.c

示例7: mpl_content_pane_init

static void
mpl_content_pane_init (MplContentPane *self)
{
  MplContentPanePrivate *priv = GET_PRIVATE (self);

  mx_box_layout_set_orientation (MX_BOX_LAYOUT (self), MX_ORIENTATION_VERTICAL);
  mx_box_layout_set_spacing (MX_BOX_LAYOUT (self), 6);

  priv->header = (MxBoxLayout *) mx_box_layout_new ();
  mx_box_layout_set_spacing (priv->header, 12);
  mx_stylable_set_style_class (MX_STYLABLE (priv->header), "header");
  clutter_actor_set_height ((ClutterActor *) priv->header, 36);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (self),
                              CLUTTER_ACTOR (priv->header), 0);
  clutter_container_child_set (CLUTTER_CONTAINER (self),
                               (ClutterActor *) priv->header,
                               "expand", FALSE,
                               "x-fill", TRUE,
                               "y-fill", TRUE,
                               NULL);

  priv->title = (MxLabel *) mx_label_new ();
  mx_stylable_set_style_class (MX_STYLABLE (priv->title), "title");
  mx_box_layout_insert_actor (priv->header, (ClutterActor *) priv->title, 0);
  clutter_container_child_set (CLUTTER_CONTAINER (priv->header),
                               (ClutterActor *) priv->title,
                               "expand", TRUE,
                               "x-fill", TRUE,
                               "y-fill", FALSE,
                               NULL);
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:31,代码来源:mpl-content-pane.c

示例8: _create_power_dialog

static gboolean
_create_power_dialog (MexInfoBar *self)
{
  MexInfoBarPrivate *priv = self->priv;

  ClutterActor *dialog, *dialog_label;
  MxAction *cancel_action, *shutdown_action;

  dialog = mx_dialog_new ();
  mx_stylable_set_style_class (MX_STYLABLE (dialog), "MexInfoBarDialog");

  dialog_label = mx_label_new_with_text (_("Close Media Explorer?"));
  mx_stylable_set_style_class (MX_STYLABLE (dialog_label), "DialogHeader");
  mx_bin_set_child (MX_BIN (dialog), dialog_label);

  shutdown_action = mx_action_new_full ("yes", _("Yes"),
                                       G_CALLBACK (_close_request_cb), self);

  cancel_action = mx_action_new_full ("no", _("No"),
                                     G_CALLBACK (_close_dialog_cb), self);

  mx_dialog_add_action (MX_DIALOG (dialog), shutdown_action);
  mx_dialog_add_action (MX_DIALOG (dialog), cancel_action);

  priv->power_dialog = g_object_ref (dialog);

  clutter_actor_show (dialog);

  return TRUE;
}
开发者ID:ocrete,项目名称:media-explorer,代码行数:30,代码来源:mex-info-bar.c

示例9: mex_telepathy_channel_create_busy_box

static void
mex_telepathy_channel_create_busy_box (MexTelepathyChannel *self)
{
  MexTelepathyChannelPrivate *priv = MEX_TELEPATHY_CHANNEL (self)->priv;

  ClutterActor *calling_padding;
  ClutterActor *calling_box;
  ClutterActor *spinner;
  ClutterActor *stack;

  priv->busy_label = mx_label_new();
  mx_label_set_y_align (MX_LABEL (priv->busy_label), MX_ALIGN_MIDDLE);
  mx_label_set_x_align (MX_LABEL (priv->busy_label), MX_ALIGN_MIDDLE);

  spinner = mx_spinner_new ();

  calling_box = mx_box_layout_new ();

  mx_box_layout_add_actor_with_properties (MX_BOX_LAYOUT (calling_box),
                                           priv->busy_label,
                                           0,
                                           "expand",
                                           TRUE,
                                           "x-align",
                                           MX_ALIGN_START,
                                           "x-fill",
                                           TRUE,
                                           NULL);

  mx_box_layout_add_actor_with_properties (MX_BOX_LAYOUT (calling_box),
                                           spinner,
                                           1,
                                           "expand",
                                           TRUE,
                                           "x-align",
                                           MX_ALIGN_END,
                                           "x-fill",
                                           FALSE,
                                           NULL);

  priv->busy_box = mx_frame_new ();
  clutter_actor_set_width (CLUTTER_ACTOR (priv->busy_box), 475);
  mx_stylable_set_style_class (MX_STYLABLE (priv->busy_box),
                               "CallingFrameBorder");
  calling_padding = mx_frame_new ();
  mx_stylable_set_style_class (MX_STYLABLE (calling_padding),
                               "CallingFrame");
  mx_bin_set_child (MX_BIN (priv->busy_box), calling_padding);
  mx_bin_set_fill (MX_BIN (priv->busy_box), TRUE, TRUE);
  mx_bin_set_child (MX_BIN (calling_padding), calling_box);
  mx_bin_set_fill (MX_BIN (calling_padding), TRUE, TRUE);

  stack = mx_window_get_child (mex_get_main_window ());
  clutter_container_add (CLUTTER_CONTAINER (stack), priv->busy_box, NULL);
  mx_stack_child_set_x_fill (MX_STACK (stack), priv->busy_box, FALSE);
  mx_stack_child_set_y_fill (MX_STACK (stack), priv->busy_box, FALSE);
}
开发者ID:Cyrene,项目名称:media-explorer,代码行数:57,代码来源:mex-telepathy-channel.c

示例10: mx_toggle_set_active

void
mx_toggle_set_active (MxToggle *toggle,
                      gboolean  active)
{
  MxTogglePrivate *priv;

  g_return_if_fail (MX_IS_TOGGLE (toggle));

  priv = toggle->priv;

  if (priv->active != active
      || (priv->position > 0 && priv->position < 1))
    {
      ClutterTimeline *timeline;

      priv->active = active;

      if (active)
        mx_stylable_set_style_pseudo_class (MX_STYLABLE (toggle), "checked");
      else
        mx_stylable_set_style_pseudo_class (MX_STYLABLE (toggle), NULL);

      g_object_notify (G_OBJECT (toggle), "active");


      /* don't run an animation if the actor is not mapped */
      if (!CLUTTER_ACTOR_IS_MAPPED (CLUTTER_ACTOR (toggle)))
        {
          priv->position = (active) ? 1 : 0;
          return;
        }

      timeline = clutter_alpha_get_timeline (priv->alpha);

      if (active)
        clutter_timeline_set_direction (timeline, CLUTTER_TIMELINE_FORWARD);
      else
        clutter_timeline_set_direction (timeline, CLUTTER_TIMELINE_BACKWARD);

      if (clutter_timeline_is_playing (timeline))
        return;

      clutter_timeline_rewind (timeline);

      if (priv->drag_offset > -1)
        {
          clutter_alpha_set_mode (priv->alpha, CLUTTER_LINEAR);
          clutter_timeline_advance (timeline, priv->position * 300);
        }
      else
        {
          clutter_alpha_set_mode (priv->alpha, CLUTTER_EASE_IN_OUT_CUBIC);
        }

      clutter_timeline_start (timeline);
    }
}
开发者ID:ManMower,项目名称:mx,代码行数:57,代码来源:mx-toggle.c

示例11: mex_tile_style_changed_cb

static void
mex_tile_style_changed_cb (MexTile *self, MxStyleChangedFlags flags)
{
  MexTilePrivate *priv = self->priv;
  MxBorderImage *image;

  if (priv->header_padding)
    {
      g_boxed_free (MX_TYPE_PADDING, priv->header_padding);
      priv->header_padding = NULL;
    }

  if (priv->header_background_color)
    {
      g_boxed_free (CLUTTER_TYPE_COLOR, priv->header_background_color);
      priv->header_background_color = NULL;
    }

  mx_stylable_get (MX_STYLABLE (self),
                   "x-mex-header-background", &image,
                   "x-mex-header-background-color", &priv->header_background_color,
                   "x-mex-header-padding", &priv->header_padding,
                   NULL);

  mx_stylable_apply_clutter_text_attributes (MX_STYLABLE (self),
                                             CLUTTER_TEXT (priv->label));

  mx_stylable_apply_clutter_text_attributes (MX_STYLABLE (self),
                                             CLUTTER_TEXT (priv->secondary_label));

  if (image && image->uri)
    {
      CoglObject *background;

      background =
        mx_texture_cache_get_cogl_texture (mx_texture_cache_get_default (),
                                           image->uri);
      cogl_material_set_layer (priv->material, 0, background);
    }
  else
    {
      if (cogl_material_get_n_layers (priv->material))
        cogl_material_remove_layer (priv->material, 0);
    }

  if (image)
    g_boxed_free (MX_TYPE_BORDER_IMAGE, image);

  if (priv->icon1)
    mx_stylable_style_changed (MX_STYLABLE (priv->icon1), flags);

  if (priv->icon2)
    mx_stylable_style_changed (MX_STYLABLE (priv->icon2), flags);

  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}
开发者ID:frankopt,项目名称:media-explorer,代码行数:56,代码来源:mex-tile.c

示例12: mex_music_player_update_playing

static void
mex_music_player_update_playing (MexMusicPlayer *player)
{
  MexMusicPlayerPrivate *priv = player->priv;

  if (clutter_media_get_playing (priv->player))
    mx_stylable_set_style_class (MX_STYLABLE (priv->play_button), "MediaPause");
  else
    mx_stylable_set_style_class (MX_STYLABLE (priv->play_button), "MediaPlay");
}
开发者ID:frankopt,项目名称:media-explorer,代码行数:10,代码来源:mex-music-player.c

示例13: mx_scroll_bar_init

static void
mx_scroll_bar_init (MxScrollBar *self)
{
  self->priv = MX_SCROLL_BAR_GET_PRIVATE (self);

  self->priv->bw_stepper = (ClutterActor *) mx_button_new ();
  mx_stylable_set_style_class (MX_STYLABLE (self->priv->bw_stepper),
                               "backward-stepper");
  clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->bw_stepper),
                            CLUTTER_ACTOR (self));
  g_signal_connect (self->priv->bw_stepper, "button-press-event",
                    G_CALLBACK (stepper_button_press_event_cb), self);
  g_signal_connect (self->priv->bw_stepper, "button-release-event",
                    G_CALLBACK (stepper_button_release_cb), self);
  g_signal_connect (self->priv->bw_stepper, "leave-event",
                    G_CALLBACK (stepper_button_release_cb), self);

  self->priv->fw_stepper = (ClutterActor *) mx_button_new ();
  mx_stylable_set_style_class (MX_STYLABLE (self->priv->fw_stepper),
                               "forward-stepper");
  clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->fw_stepper),
                            CLUTTER_ACTOR (self));
  g_signal_connect (self->priv->fw_stepper, "button-press-event",
                    G_CALLBACK (stepper_button_press_event_cb), self);
  g_signal_connect (self->priv->fw_stepper, "button-release-event",
                    G_CALLBACK (stepper_button_release_cb), self);
  g_signal_connect (self->priv->fw_stepper, "leave-event",
                    G_CALLBACK (stepper_button_release_cb), self);

  self->priv->trough = mx_frame_new ();
  clutter_actor_set_reactive ((ClutterActor *) self->priv->trough, TRUE);
  mx_stylable_set_style_class (MX_STYLABLE (self->priv->trough), "htrough");
  clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->trough),
                            CLUTTER_ACTOR (self));
  g_signal_connect (self->priv->trough, "button-press-event",
                    G_CALLBACK (trough_button_press_event_cb), self);
  g_signal_connect (self->priv->trough, "button-release-event",
                    G_CALLBACK (trough_button_release_event_cb), self);
  g_signal_connect (self->priv->trough, "leave-event",
                    G_CALLBACK (trough_leave_event_cb), self);

  self->priv->handle = (ClutterActor *) mx_button_new ();
  mx_stylable_set_style_class (MX_STYLABLE (self->priv->handle), "hhandle");
  clutter_actor_set_parent (CLUTTER_ACTOR (self->priv->handle),
                            CLUTTER_ACTOR (self));
  g_signal_connect (self->priv->handle, "button-press-event",
                    G_CALLBACK (handle_button_press_event_cb), self);

  clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);

  g_signal_connect (self, "style-changed",
                    G_CALLBACK (mx_scroll_bar_style_changed), NULL);
  g_signal_connect (self, "notify::reactive",
                    G_CALLBACK (mx_scroll_bar_notify_reactive), NULL);
}
开发者ID:bhgv,项目名称:mx--clutter-based-GUI-framework--orange-pi-2-h3,代码行数:55,代码来源:mx-scroll-bar.c

示例14: mx_toggle_accept_focus

static MxFocusable*
mx_toggle_accept_focus (MxFocusable *focusable, MxFocusHint hint)
{
  MxTogglePrivate *priv = MX_TOGGLE (focusable)->priv;

  mx_stylable_style_pseudo_class_add (MX_STYLABLE (focusable), "focus");
  mx_stylable_style_pseudo_class_add (MX_STYLABLE (priv->handle), "focus");

  clutter_actor_grab_key_focus (CLUTTER_ACTOR (focusable));

  return focusable;
}
开发者ID:ManMower,项目名称:mx,代码行数:12,代码来源:mx-toggle.c

示例15: mx_scroll_view_apply_style

static void
mx_scroll_view_apply_style (MxWidget *widget,
                            MxStyle  *style)
{
  MxScrollViewPrivate *priv = MX_SCROLL_VIEW (widget)->priv;

  if (priv->hscroll != NULL)
    mx_stylable_set_style (MX_STYLABLE (priv->hscroll), style);

  if (priv->vscroll != NULL)
    mx_stylable_set_style (MX_STYLABLE (priv->vscroll), style);
}
开发者ID:ebassi,项目名称:mx,代码行数:12,代码来源:mx-scroll-view.c


注:本文中的MX_STYLABLE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。