[Xfce4-commits] <xfce4-indicator-plugin:master> Removed row-size property and added a single-row one
Andrzej
noreply at xfce.org
Fri Sep 6 00:26:01 CEST 2013
Updating branch refs/heads/master
to a53baf18cf80b2f89a4caac31ccf08f6eff095ba (commit)
from e0b1ed0e47444d152319261e8b59f3db32c27d8d (commit)
commit a53baf18cf80b2f89a4caac31ccf08f6eff095ba
Author: Andrzej <ndrwrdck at gmail.com>
Date: Thu Sep 5 23:25:14 2013 +0100
Removed row-size property and added a single-row one
panel-plugin/indicator-config.c | 43 ++++++++++++++++-------------------
panel-plugin/indicator-config.h | 2 +-
panel-plugin/indicator-dialog.c | 8 +++----
panel-plugin/indicator-dialog.glade | 43 ++++++-----------------------------
4 files changed, 31 insertions(+), 65 deletions(-)
diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 78a42f2..fb5d505 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -45,7 +45,7 @@
-#define DEFAULT_ROW_SIZE_MAX 24
+#define DEFAULT_SINGLE_ROW FALSE
#define DEFAULT_ALIGN_LEFT FALSE
#define DEFAULT_EXCLUDED_MODULES NULL
#define DEFAULT_ORIENTATION GTK_ORIENTATION_HORIZONTAL
@@ -77,7 +77,7 @@ struct _IndicatorConfig
{
GObject __parent__;
- gint row_size_max;
+ gboolean single_row;
gboolean align_left;
gboolean mode_whitelist;
GHashTable *blacklist;
@@ -98,7 +98,7 @@ struct _IndicatorConfig
enum
{
PROP_0,
- PROP_ROW_SIZE_MAX,
+ PROP_SINGLE_ROW,
PROP_ALIGN_LEFT,
PROP_MODE_WHITELIST,
PROP_BLACKLIST,
@@ -150,14 +150,11 @@ indicator_config_class_init (IndicatorConfigClass *klass)
gobject_class->set_property = indicator_config_set_property;
g_object_class_install_property (gobject_class,
- PROP_ROW_SIZE_MAX,
- g_param_spec_uint ("row-size-max",
- NULL, NULL,
- 1,
- 128,
- DEFAULT_ROW_SIZE_MAX,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ PROP_SINGLE_ROW,
+ g_param_spec_boolean ("single-row", NULL, NULL,
+ DEFAULT_SINGLE_ROW,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_ALIGN_LEFT,
@@ -221,7 +218,7 @@ indicator_config_class_init (IndicatorConfigClass *klass)
static void
indicator_config_init (IndicatorConfig *config)
{
- config->row_size_max = DEFAULT_ROW_SIZE_MAX;
+ config->single_row = DEFAULT_SINGLE_ROW;
config->align_left = DEFAULT_ALIGN_LEFT;
config->mode_whitelist = DEFAULT_MODE_WHITELIST;
config->blacklist = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
@@ -281,8 +278,8 @@ indicator_config_get_property (GObject *object,
switch (prop_id)
{
- case PROP_ROW_SIZE_MAX:
- g_value_set_uint (value, config->row_size_max);
+ case PROP_SINGLE_ROW:
+ g_value_set_boolean (value, config->single_row);
break;
case PROP_ALIGN_LEFT:
@@ -343,11 +340,11 @@ indicator_config_set_property (GObject *object,
switch (prop_id)
{
- case PROP_ROW_SIZE_MAX:
- val = g_value_get_uint (value);
- if (config->row_size_max != val)
+ case PROP_SINGLE_ROW:
+ val = g_value_get_boolean (value);
+ if (config->single_row != val)
{
- config->row_size_max = val;
+ config->single_row = val;
g_signal_emit (G_OBJECT (config), indicator_config_signals [CONFIGURATION_CHANGED], 0);
}
break;
@@ -430,11 +427,11 @@ indicator_config_set_property (GObject *object,
gint
-indicator_config_get_row_size_max (IndicatorConfig *config)
+indicator_config_get_single_row (IndicatorConfig *config)
{
- g_return_val_if_fail (XFCE_IS_INDICATOR_CONFIG (config), DEFAULT_ROW_SIZE_MAX);
+ g_return_val_if_fail (XFCE_IS_INDICATOR_CONFIG (config), DEFAULT_SINGLE_ROW);
- return config->row_size_max;
+ return config->single_row;
}
@@ -757,8 +754,8 @@ indicator_config_new (const gchar *property_base)
{
channel = xfconf_channel_get ("xfce4-panel");
- property = g_strconcat (property_base, "/row-size-max", NULL);
- xfconf_g_property_bind (channel, property, G_TYPE_INT, config, "row-size-max");
+ property = g_strconcat (property_base, "/single-row", NULL);
+ xfconf_g_property_bind (channel, property, G_TYPE_BOOLEAN, config, "single-row");
g_free (property);
property = g_strconcat (property_base, "/align-left", NULL);
diff --git a/panel-plugin/indicator-config.h b/panel-plugin/indicator-config.h
index 8ce8e84..d898c04 100644
--- a/panel-plugin/indicator-config.h
+++ b/panel-plugin/indicator-config.h
@@ -65,7 +65,7 @@ gint indicator_config_get_nrows (IndicatorConfig
gint indicator_config_get_panel_size (IndicatorConfig *config);
-gint indicator_config_get_row_size_max (IndicatorConfig *config);
+gboolean indicator_config_get_single_row (IndicatorConfig *config);
gboolean indicator_config_get_align_left (IndicatorConfig *config);
diff --git a/panel-plugin/indicator-dialog.c b/panel-plugin/indicator-dialog.c
index eb8bd50..846aa5e 100644
--- a/panel-plugin/indicator-dialog.c
+++ b/panel-plugin/indicator-dialog.c
@@ -490,12 +490,10 @@ indicator_dialog_build (IndicatorDialog *dialog)
G_CALLBACK (indicator_dialog_help_button_clicked),
dialog);
- object = gtk_builder_get_object (builder, "size-max");
+ object = gtk_builder_get_object (builder, "checkbutton-single-row");
g_return_if_fail (GTK_IS_WIDGET (object));
- //exo_mutual_binding_new (G_OBJECT (dialog->config), "row-size-max",
- // G_OBJECT (object), "value");
- g_object_bind_property (G_OBJECT (dialog->config), "row-size-max",
- G_OBJECT (object), "value",
+ g_object_bind_property (G_OBJECT (dialog->config), "single-row",
+ G_OBJECT (object), "active",
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
object = gtk_builder_get_object (builder, "checkbutton-align-left");
diff --git a/panel-plugin/indicator-dialog.glade b/panel-plugin/indicator-dialog.glade
index 2abe2cf..d1a4c5a 100644
--- a/panel-plugin/indicator-dialog.glade
+++ b/panel-plugin/indicator-dialog.glade
@@ -83,43 +83,14 @@
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkCheckButton" id="checkbutton-single-row">
+ <property name="label" translatable="yes">Arrange indicators in a single row</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Maximum row size (px):</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">size-max</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="size-max">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Icons are scaled to fit a single row of the panel. Use this option to restrict the maximum size of the row.</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">size-adjustment</property>
- <property name="numeric">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">If enabled, ensure that the indicators are laid out in a single row or column.</property>
+ <property name="use_action_appearance">False</property>
+ <property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">True</property>
More information about the Xfce4-commits
mailing list