[Xfce4-commits] [apps/xfdashboard] 02/03: Move XfdashboardStyle to XfdashboardButton and rename it to XfdashboardButtonStyle
noreply at xfce.org
noreply at xfce.org
Thu Aug 13 20:57:37 CEST 2015
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit 0e812090fbe664c560903a0bc4b0e5474ee1917c
Author: Stephan Haller <nomad at froevel.de>
Date: Thu Aug 13 20:54:07 2015 +0200
Move XfdashboardStyle to XfdashboardButton and rename it to XfdashboardButtonStyle
---
xfdashboard/application-button.c | 4 ++--
xfdashboard/button.c | 36 ++++++++++++++++++------------------
xfdashboard/button.h | 22 ++++++++++++++++++++--
xfdashboard/quicklaunch.c | 6 +++---
xfdashboard/toggle-button.c | 8 ++++----
xfdashboard/types.h | 15 ---------------
6 files changed, 47 insertions(+), 44 deletions(-)
diff --git a/xfdashboard/application-button.c b/xfdashboard/application-button.c
index b2ecc29..9bb1e86 100644
--- a/xfdashboard/application-button.c
+++ b/xfdashboard/application-button.c
@@ -409,7 +409,7 @@ static void xfdashboard_application_button_init(XfdashboardApplicationButton *se
ClutterActor* xfdashboard_application_button_new(void)
{
return(g_object_new(XFDASHBOARD_TYPE_APPLICATION_BUTTON,
- "button-style", XFDASHBOARD_STYLE_BOTH,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_BOTH,
"single-line", FALSE,
NULL));
}
@@ -419,7 +419,7 @@ ClutterActor* xfdashboard_application_button_new_from_app_info(GAppInfo *inAppIn
g_return_val_if_fail(G_IS_APP_INFO(inAppInfo), NULL);
return(g_object_new(XFDASHBOARD_TYPE_APPLICATION_BUTTON,
- "button-style", XFDASHBOARD_STYLE_BOTH,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_BOTH,
"single-line", FALSE,
"app-info", inAppInfo,
NULL));
diff --git a/xfdashboard/button.c b/xfdashboard/button.c
index df69ba6..cbb2631 100644
--- a/xfdashboard/button.c
+++ b/xfdashboard/button.c
@@ -50,7 +50,7 @@ struct _XfdashboardButtonPrivate
/* Properties related */
gfloat padding;
gfloat spacing;
- XfdashboardStyle style;
+ XfdashboardButtonStyle style;
gchar *iconName;
ClutterImage *iconImage;
@@ -679,15 +679,15 @@ static void _xfdashboard_button_show_all(ClutterActor *self)
{
XfdashboardButtonPrivate *priv=XFDASHBOARD_BUTTON(self)->priv;
- if(priv->style==XFDASHBOARD_STYLE_ICON ||
- priv->style==XFDASHBOARD_STYLE_BOTH)
+ if(priv->style==XFDASHBOARD_BUTTON_STYLE_ICON ||
+ priv->style==XFDASHBOARD_BUTTON_STYLE_BOTH)
{
clutter_actor_show(CLUTTER_ACTOR(priv->actorIcon));
}
else clutter_actor_hide(CLUTTER_ACTOR(priv->actorIcon));
- if(priv->style==XFDASHBOARD_STYLE_TEXT ||
- priv->style==XFDASHBOARD_STYLE_BOTH)
+ if(priv->style==XFDASHBOARD_BUTTON_STYLE_TEXT ||
+ priv->style==XFDASHBOARD_BUTTON_STYLE_BOTH)
{
clutter_actor_show(CLUTTER_ACTOR(priv->actorLabel));
}
@@ -1290,8 +1290,8 @@ static void xfdashboard_button_class_init(XfdashboardButtonClass *klass)
g_param_spec_enum("button-style",
_("Button style"),
_("Style of button showing text and/or icon"),
- XFDASHBOARD_TYPE_STYLE,
- XFDASHBOARD_STYLE_TEXT,
+ XFDASHBOARD_TYPE_BUTTON_STYLE,
+ XFDASHBOARD_BUTTON_STYLE_TEXT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
XfdashboardButtonProperties[PROP_ICON_NAME]=
@@ -1459,7 +1459,7 @@ ClutterActor* xfdashboard_button_new(void)
{
return(g_object_new(XFDASHBOARD_TYPE_BUTTON,
"text", N_(""),
- "button-style", XFDASHBOARD_STYLE_TEXT,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_TEXT,
NULL));
}
@@ -1467,7 +1467,7 @@ ClutterActor* xfdashboard_button_new_with_text(const gchar *inText)
{
return(g_object_new(XFDASHBOARD_TYPE_BUTTON,
"text", inText,
- "button-style", XFDASHBOARD_STYLE_TEXT,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_TEXT,
NULL));
}
@@ -1475,7 +1475,7 @@ ClutterActor* xfdashboard_button_new_with_icon(const gchar *inIconName)
{
return(g_object_new(XFDASHBOARD_TYPE_BUTTON,
"icon-name", inIconName,
- "button-style", XFDASHBOARD_STYLE_ICON,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_ICON,
NULL));
}
@@ -1484,7 +1484,7 @@ ClutterActor* xfdashboard_button_new_full(const gchar *inIconName, const gchar *
return(g_object_new(XFDASHBOARD_TYPE_BUTTON,
"text", inText,
"icon-name", inIconName,
- "button-style", XFDASHBOARD_STYLE_BOTH,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_BOTH,
NULL));
}
@@ -1550,14 +1550,14 @@ void xfdashboard_button_set_spacing(XfdashboardButton *self, const gfloat inSpac
}
/* Get/set style of button */
-XfdashboardStyle xfdashboard_button_get_style(XfdashboardButton *self)
+XfdashboardButtonStyle xfdashboard_button_get_style(XfdashboardButton *self)
{
- g_return_val_if_fail(XFDASHBOARD_IS_BUTTON(self), XFDASHBOARD_STYLE_TEXT);
+ g_return_val_if_fail(XFDASHBOARD_IS_BUTTON(self), XFDASHBOARD_BUTTON_STYLE_TEXT);
return(self->priv->style);
}
-void xfdashboard_button_set_style(XfdashboardButton *self, const XfdashboardStyle inStyle)
+void xfdashboard_button_set_style(XfdashboardButton *self, const XfdashboardButtonStyle inStyle)
{
XfdashboardButtonPrivate *priv;
@@ -1572,15 +1572,15 @@ void xfdashboard_button_set_style(XfdashboardButton *self, const XfdashboardStyl
priv->style=inStyle;
/* Show actors depending on style */
- if(priv->style==XFDASHBOARD_STYLE_TEXT ||
- priv->style==XFDASHBOARD_STYLE_BOTH)
+ if(priv->style==XFDASHBOARD_BUTTON_STYLE_TEXT ||
+ priv->style==XFDASHBOARD_BUTTON_STYLE_BOTH)
{
clutter_actor_show(CLUTTER_ACTOR(priv->actorLabel));
}
else clutter_actor_hide(CLUTTER_ACTOR(priv->actorLabel));
- if(priv->style==XFDASHBOARD_STYLE_ICON ||
- priv->style==XFDASHBOARD_STYLE_BOTH)
+ if(priv->style==XFDASHBOARD_BUTTON_STYLE_ICON ||
+ priv->style==XFDASHBOARD_BUTTON_STYLE_BOTH)
{
clutter_actor_show(CLUTTER_ACTOR(priv->actorIcon));
}
diff --git a/xfdashboard/button.h b/xfdashboard/button.h
index a5ffaa7..f858a42 100644
--- a/xfdashboard/button.h
+++ b/xfdashboard/button.h
@@ -32,6 +32,24 @@
G_BEGIN_DECLS
+/* Public definitions */
+/**
+ * XfdashboardButtonStyle:
+ * @XFDASHBOARD_BUTTON_STYLE_TEXT: The actor will show only text labels.
+ * @XFDASHBOARD_BUTTON_STYLE_ICON: The actor will show only icons.
+ * @XFDASHBOARD_BUTTON_STYLE_BOTH: The actor will show both, text labels and icons.
+ *
+ * Determines the style of an actor, e.g. text labels and icons at buttons.
+ */
+typedef enum /*< prefix=XFDASHBOARD_STYLE >*/
+{
+ XFDASHBOARD_BUTTON_STYLE_TEXT=0,
+ XFDASHBOARD_BUTTON_STYLE_ICON,
+ XFDASHBOARD_BUTTON_STYLE_BOTH
+} XfdashboardButtonStyle;
+
+
+/* Object declaration */
#define XFDASHBOARD_TYPE_BUTTON (xfdashboard_button_get_type())
#define XFDASHBOARD_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XFDASHBOARD_TYPE_BUTTON, XfdashboardButton))
#define XFDASHBOARD_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFDASHBOARD_TYPE_BUTTON))
@@ -78,8 +96,8 @@ void xfdashboard_button_set_padding(XfdashboardButton *self, const gfloat inPadd
gfloat xfdashboard_button_get_spacing(XfdashboardButton *self);
void xfdashboard_button_set_spacing(XfdashboardButton *self, const gfloat inSpacing);
-XfdashboardStyle xfdashboard_button_get_style(XfdashboardButton *self);
-void xfdashboard_button_set_style(XfdashboardButton *self, const XfdashboardStyle inStyle);
+XfdashboardButtonStyle xfdashboard_button_get_style(XfdashboardButton *self);
+void xfdashboard_button_set_style(XfdashboardButton *self, const XfdashboardButtonStyle inStyle);
/* Icon functions */
const gchar* xfdashboard_button_get_icon(XfdashboardButton *self);
diff --git a/xfdashboard/quicklaunch.c b/xfdashboard/quicklaunch.c
index e69f978..6512e86 100644
--- a/xfdashboard/quicklaunch.c
+++ b/xfdashboard/quicklaunch.c
@@ -290,7 +290,7 @@ static void _xfdashboard_quicklaunch_on_favourite_drag_begin(ClutterDragAction *
clutter_actor_set_position(dragHandle, inStageX, inStageY);
xfdashboard_button_set_icon_size(XFDASHBOARD_BUTTON(dragHandle), priv->normalIconSize);
xfdashboard_button_set_sync_icon_size(XFDASHBOARD_BUTTON(dragHandle), FALSE);
- xfdashboard_button_set_style(XFDASHBOARD_BUTTON(dragHandle), XFDASHBOARD_STYLE_ICON);
+ xfdashboard_button_set_style(XFDASHBOARD_BUTTON(dragHandle), XFDASHBOARD_BUTTON_STYLE_ICON);
clutter_actor_add_child(CLUTTER_ACTOR(stage), dragHandle);
clutter_drag_action_set_drag_handle(inAction, dragHandle);
@@ -391,7 +391,7 @@ static gboolean _xfdashboard_quicklaunch_on_drop_begin(XfdashboardQuicklaunch *s
priv->dragPreviewIcon=xfdashboard_application_button_new_from_app_info(appInfo);
xfdashboard_button_set_icon_size(XFDASHBOARD_BUTTON(priv->dragPreviewIcon), priv->normalIconSize);
xfdashboard_button_set_sync_icon_size(XFDASHBOARD_BUTTON(priv->dragPreviewIcon), FALSE);
- xfdashboard_button_set_style(XFDASHBOARD_BUTTON(priv->dragPreviewIcon), XFDASHBOARD_STYLE_ICON);
+ xfdashboard_button_set_style(XFDASHBOARD_BUTTON(priv->dragPreviewIcon), XFDASHBOARD_BUTTON_STYLE_ICON);
if(priv->dragMode==DRAG_MODE_CREATE) clutter_actor_hide(priv->dragPreviewIcon);
clutter_actor_add_child(CLUTTER_ACTOR(self), priv->dragPreviewIcon);
@@ -901,7 +901,7 @@ static void _xfdashboard_quicklaunch_update_icons_from_property(XfdashboardQuick
actor=xfdashboard_application_button_new_from_app_info(appInfo);
xfdashboard_button_set_icon_size(XFDASHBOARD_BUTTON(actor), priv->normalIconSize);
xfdashboard_button_set_sync_icon_size(XFDASHBOARD_BUTTON(actor), FALSE);
- xfdashboard_button_set_style(XFDASHBOARD_BUTTON(actor), XFDASHBOARD_STYLE_ICON);
+ xfdashboard_button_set_style(XFDASHBOARD_BUTTON(actor), XFDASHBOARD_BUTTON_STYLE_ICON);
clutter_actor_show(actor);
clutter_actor_add_child(CLUTTER_ACTOR(self), actor);
g_signal_connect_swapped(actor, "clicked", G_CALLBACK(_xfdashboard_quicklaunch_on_favourite_clicked), self);
diff --git a/xfdashboard/toggle-button.c b/xfdashboard/toggle-button.c
index 710e253..8eb2b7c 100644
--- a/xfdashboard/toggle-button.c
+++ b/xfdashboard/toggle-button.c
@@ -210,7 +210,7 @@ ClutterActor* xfdashboard_toggle_button_new(void)
{
return(g_object_new(XFDASHBOARD_TYPE_TOGGLE_BUTTON,
"text", N_(""),
- "button-style", XFDASHBOARD_STYLE_TEXT,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_TEXT,
NULL));
}
@@ -218,7 +218,7 @@ ClutterActor* xfdashboard_toggle_button_new_with_text(const gchar *inText)
{
return(g_object_new(XFDASHBOARD_TYPE_TOGGLE_BUTTON,
"text", inText,
- "button-style", XFDASHBOARD_STYLE_TEXT,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_TEXT,
NULL));
}
@@ -226,7 +226,7 @@ ClutterActor* xfdashboard_toggle_button_new_with_icon(const gchar *inIconName)
{
return(g_object_new(XFDASHBOARD_TYPE_TOGGLE_BUTTON,
"icon-name", inIconName,
- "button-style", XFDASHBOARD_STYLE_ICON,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_ICON,
NULL));
}
@@ -235,7 +235,7 @@ ClutterActor* xfdashboard_toggle_button_new_full(const gchar *inIconName, const
return(g_object_new(XFDASHBOARD_TYPE_TOGGLE_BUTTON,
"text", inText,
"icon-name", inIconName,
- "button-style", XFDASHBOARD_STYLE_BOTH,
+ "button-style", XFDASHBOARD_BUTTON_STYLE_BOTH,
NULL));
}
diff --git a/xfdashboard/types.h b/xfdashboard/types.h
index d7c3633..5328d5e 100644
--- a/xfdashboard/types.h
+++ b/xfdashboard/types.h
@@ -66,21 +66,6 @@ typedef enum /*< prefix=XFDASHBOARD_POLICY >*/
} XfdashboardPolicy;
/**
- * XfdashboardStyle:
- * @XFDASHBOARD_STYLE_TEXT: The actor will show only text labels.
- * @XFDASHBOARD_STYLE_ICON: The actor will show only icons.
- * @XFDASHBOARD_STYLE_BOTH: The actor will show both, text labels and icons.
- *
- * Determines the style of an actor, e.g. text labels and icons at buttons.
- */
-typedef enum /*< prefix=XFDASHBOARD_STYLE >*/
-{
- XFDASHBOARD_STYLE_TEXT=0,
- XFDASHBOARD_STYLE_ICON,
- XFDASHBOARD_STYLE_BOTH
-} XfdashboardStyle;
-
-/**
* XfdashboardOrientation:
* @XFDASHBOARD_ORIENTATION_LEFT: The actor is justified to left boundary.
* @XFDASHBOARD_ORIENTATION_RIGHT: The actor is justified to right boundary.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list